Thread (22 messages) 22 messages, 6 authors, 2023-02-08

Re: [PATCH v3 04/12] gpiolib: remove gpio_set_debounce

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2023-02-07 22:56:37
Also in: linux-acpi, linux-arch, linux-arm-kernel, linux-devicetree, linux-doc, linux-gpio, linux-input, linux-m68k, linux-media, linux-omap, linux-samsung-soc, linux-sh, linux-wireless, lkml, netdev

On Tue, Feb 07, 2023 at 01:32:01PM -0800, Dmitry Torokhov wrote:
On Tue, Feb 07, 2023 at 04:29:44PM +0200, Andy Shevchenko wrote:
quoted
@@ -1010,14 +1009,21 @@ static int ads7846_setup_pendown(struct spi_device *spi,
 		}
 
 		ts->gpio_pendown = pdata->gpio_pendown;
-
-		if (pdata->gpio_pendown_debounce)
-			gpio_set_debounce(pdata->gpio_pendown,
-					  pdata->gpio_pendown_debounce);
Can we please change only this to:

			gpiod_set_debounce(gpio_to_desc(pdata->gpio_pendown),
					   pdata->gpio_pendown_debounce);

and not change anything else (i.e. drop the changes below)?
Probably. I can try rollback this.
quoted
 	} else {
-		dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
-		return -EINVAL;
+		struct gpio_desc *desc;
+
+		desc = devm_gpiod_get(&spi->dev, "pendown", GPIOD_IN);
+		if (IS_ERR(desc)) {
+			dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
+			return PTR_ERR(desc);
+		}
+		gpiod_set_consumer_name(desc, "ads7846_pendown");
+
+		ts->gpio_pendown = desc_to_gpio(desc);
 	}
+	if (pdata->gpio_pendown_debounce)
+		gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown),
+				   pdata->gpio_pendown_debounce);
 
 	return 0;
-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help