diff mbox

[v2] input: ads7846: fix gpio_pendown configuration

Message ID 1304844290-31233-1-git-send-email-grinberg@compulab.co.il (mailing list archive)
State Accepted
Commit 1201e7e67634624aec89317cf308cd0d3d8d4770
Headers show

Commit Message

Igor Grinberg May 8, 2011, 8:44 a.m. UTC
The pendown gpio was requested but not configured for input.
Configure it for input.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
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(-)

Comments

Dmitry Torokhov May 11, 2011, 10:44 p.m. UTC | #1
On Sun, May 08, 2011 at 11:44:50AM +0300, Igor Grinberg wrote:
> The pendown gpio was requested but not configured for input.
> Configure it for input.
> 

Applied, thanks Igor.
diff mbox

Patch

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;