[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250102181953.1020878-3-aaro.koskinen@iki.fi>
Date: Thu, 2 Jan 2025 20:19:52 +0200
From: Aaro Koskinen <aaro.koskinen@....fi>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Helge Deller <deller@....de>,
Janusz Krzysztofik <jmkrzyszt@...il.com>,
Tony Lindgren <tony@...mide.com>,
Linus Walleij <linus.walleij@...aro.org>,
linux-fbdev@...r.kernel.org,
linux-omap@...r.kernel.org,
linux-input@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Aaro Koskinen <aaro.koskinen@....fi>
Subject: [PATCH 2/3] Input: ads7846 - fix up the pendown GPIO setup on Nokia 770
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@....fi>
---
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
Powered by blists - more mailing lists