From patchwork Sun May 8 08:44:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Grinberg X-Patchwork-Id: 765372 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p488i5cb029246 for ; Sun, 8 May 2011 08:44:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752032Ab1EHIo5 (ORCPT ); Sun, 8 May 2011 04:44:57 -0400 Received: from 50.23.254.54-static.reverse.softlayer.com ([50.23.254.54]:41810 "EHLO softlayer.compulab.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751999Ab1EHIo5 (ORCPT ); Sun, 8 May 2011 04:44:57 -0400 Received: from [62.90.235.247] (port=28720 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.69) (envelope-from ) id 1QIzbk-0003n3-6e; Sun, 08 May 2011 11:44:56 +0300 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 2410D7E9214; Sun, 8 May 2011 11:44:55 +0300 (IDT) X-Virus-Scanned: amavisd-new at compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yvTjtMSnULS4; Sun, 8 May 2011 11:44:54 +0300 (IDT) Received: from grinberg-linux (grinberg-pc.compulab.local [10.1.1.13]) by zimbra-mta.compulab.co.il (Postfix) with SMTP id 03BE97E91FF; Sun, 8 May 2011 11:44:53 +0300 (IDT) Received: by grinberg-linux (sSMTP sendmail emulation); Sun, 08 May 2011 11:44:54 +0300 From: Igor Grinberg To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, Igor Grinberg Subject: [PATCH v2] input: ads7846: fix gpio_pendown configuration Date: Sun, 8 May 2011 11:44:50 +0300 Message-Id: <1304844290-31233-1-git-send-email-grinberg@compulab.co.il> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <20110505161356.GF27251@core.coreip.homeip.net> References: <20110505161356.GF27251@core.coreip.homeip.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 08 May 2011 08:44:58 +0000 (UTC) The pendown gpio was requested but not configured for input. Configure it for input. Signed-off-by: Igor Grinberg --- v2: add a separate gpio_direction_input() call instead of a single gpio_request_one() call so the driver will compile with !CONFIG_GENERIC_GPIO drivers/input/touchscreen/ads7846.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 1de1c19..886ec55 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -969,6 +969,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 pdata->gpio_pendown); return err; } + err = gpio_direction_input(pdata->gpio_pendown); + if (err) { + dev_err(&spi->dev, "failed to setup pendown GPIO%d\n", + pdata->gpio_pendown); + gpio_free(pdata->gpio_pendown); + return err; + } ts->gpio_pendown = pdata->gpio_pendown;