From patchwork Fri Feb 4 13:32:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjugk manjugk X-Patchwork-Id: 531901 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p14DY5N0008986 for ; Fri, 4 Feb 2011 13:34:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752919Ab1BDNd6 (ORCPT ); Fri, 4 Feb 2011 08:33:58 -0500 Received: from na3sys009aog106.obsmtp.com ([74.125.149.77]:59799 "EHLO na3sys009aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633Ab1BDNd5 (ORCPT ); Fri, 4 Feb 2011 08:33:57 -0500 Received: from source ([209.85.213.177]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKTUwARP2QqP4cscLJYz2JH/rE1WMW2YS3@postini.com; Fri, 04 Feb 2011 05:33:57 PST Received: by mail-yx0-f177.google.com with SMTP id 30so951394yxd.8 for ; Fri, 04 Feb 2011 05:33:56 -0800 (PST) Received: by 10.90.25.19 with SMTP id 19mr15229967agy.161.1296826434835; Fri, 04 Feb 2011 05:33:54 -0800 (PST) Received: from m-desktop (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id c7sm893501ana.37.2011.02.04.05.33.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Feb 2011 05:33:53 -0800 (PST) Date: Fri, 4 Feb 2011 19:02:50 +0530 From: "G, Manjunath Kondaiah" To: Dmitry Torokhov Cc: Sourav Poddar , LW@karo-electronics.de, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, gadiyar@ti.com, charu@ti.com, grinberg@compulab.co.il, balbi@ti.com Subject: Re: [PATCH v3 2/2] Input: ads7846: use gpio_request_one to configure pendown_gpio Message-ID: <20110204133250.GB2070@m-desktop> References: <1296746506-12221-1-git-send-email-sourav.poddar@ti.com> <20110203165405.GB12802@core.coreip.homeip.net> <20110203171953.GA13997@core.coreip.homeip.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110203171953.GA13997@core.coreip.homeip.net> User-Agent: Mutt/1.5.20 (2009-06-14) 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 (demeter1.kernel.org [140.211.167.41]); Fri, 04 Feb 2011 13:34:07 +0000 (UTC) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 14ea54b..940967b 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -941,29 +941,30 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784 struct ads7846_platform_data *pdata = spi->dev.platform_data; int err; - /* REVISIT when the irq can be triggered active-low, or if for some + /* + * REVISIT when the irq can be triggered active-low, or if for some * reason the touchscreen isn't hooked up, we don't need to * access * the pendown state. */ - if (!pdata->get_pendown_state && !gpio_is_valid(pdata->gpio_pendown)) { - dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n"); - return -EINVAL; - } if (pdata->get_pendown_state) { ts->get_pendown_state = pdata->get_pendown_state; - return 0; - } + } else if (gpio_is_valid(pdata->gpio_pendown)) { + + err = gpio_request_one(pdata->gpio_pendown, GPIOF_DIR_IN, + "ads7846_pendown"); + if (err) { + dev_err(&spi->dev, "failed to request pendown GPIO%d\n", + pdata->gpio_pendown); + return err; + } - err = gpio_request(pdata->gpio_pendown, "ads7846_pendown"); - if (err) { - dev_err(&spi->dev, "failed to request pendown GPIO%d\n",