linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input
@ 2011-02-03  9:48 Sourav Poddar
  2011-02-03  9:58 ` Felipe Balbi
  0 siblings, 1 reply; 7+ messages in thread
From: Sourav Poddar @ 2011-02-03  9:48 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: linux-omap, linux-arm-kernel, charu, gadiyar, linux-input, balbi,
	Sourav Poddar

The ads7846 driver requests a gpio to detect pendown events,
but does not configure its direction. Configure this gpio
as an input after requesting it.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
changes between v2 and v1: Added return error support in v2. 
 
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 036f245..f30768b 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -962,6 +962,13 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
 		return err;
 	}
 
+	err = gpio_direction_input(pdata->gpio_pendown);
+	if (err) {
+		dev_err(&spi->dev, "failed to configure pendown GPIO input direction %d\n",
+			pdata->gpio_pendown);
+		return err;
+        }
+
 	ts->gpio_pendown = pdata->gpio_pendown;
 
 	return 0;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-03 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-03  9:48 [PATCHv2 2/2] Input: ads7846 - configure pendown gpio as input Sourav Poddar
2011-02-03  9:58 ` Felipe Balbi
2011-02-03 10:04   ` Varadarajan, Charulatha
2011-02-03 13:01     ` Poddar, Sourav
2011-02-03 10:10   ` Wolfram Sang
2011-02-03 10:22     ` Felipe Balbi
2011-02-03 11:42     ` Poddar, Sourav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).