[PATCH 2/3] Input: ads7846 - fix up the pendown GPIO setup on Nokia 770

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The GPIO is set up as an IRQ, so request it as non-exclusive. Otherwise the
probe fails on Nokia 770 with:

    ads7846 spi2.0: failed to request pendown GPIO
    ads7846: probe of spi2.0 failed with error -16

Also the polarity is wrong. Fix it.

Fixes: 767d83361aaa ("Input: ads7846 - Convert to use software nodes")
Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 arch/arm/mach-omap1/board-nokia770.c | 2 +-
 drivers/input/touchscreen/ads7846.c  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 3312ef93355d..9153b1a81577 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -287,7 +287,7 @@ static struct gpiod_lookup_table nokia770_irq_gpio_table = {
 	.table = {
 		/* GPIO used by SPI device 1 */
 		GPIO_LOOKUP("gpio-0-15", 15, "ads7846_irq",
-			    GPIO_ACTIVE_HIGH),
+			    GPIO_ACTIVE_LOW),
 		/* GPIO used for retu IRQ */
 		GPIO_LOOKUP("gpio-48-63", 15, "retu_irq",
 			    GPIO_ACTIVE_HIGH),
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 066dc04003fa..54280ecca0a7 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1021,7 +1021,8 @@ static int ads7846_setup_pendown(struct spi_device *spi,
 	if (pdata->get_pendown_state) {
 		ts->get_pendown_state = pdata->get_pendown_state;
 	} else {
-		ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN);
+		ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN |
+					     GPIOD_FLAGS_BIT_NONEXCLUSIVE);
 		if (IS_ERR(ts->gpio_pendown)) {
 			dev_err(&spi->dev, "failed to request pendown GPIO\n");
 			return PTR_ERR(ts->gpio_pendown);
-- 
2.39.2





[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux