gpiolib: remove gpio_set_debounce()
authorArnd Bergmann <arnd@arndb.de>
Tue, 7 Feb 2023 14:29:44 +0000 (16:29 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 6 Mar 2023 10:33:01 +0000 (12:33 +0200)
gpio_set_debounce() only has a single user, which is trivially
converted to gpiod_set_debounce().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Documentation/driver-api/gpio/legacy.rst
Documentation/translations/zh_CN/driver-api/gpio/legacy.rst
Documentation/translations/zh_TW/gpio.txt
drivers/input/touchscreen/ads7846.c
include/linux/gpio.h

index a0559d93efd15a417c9ef8247a07c98c6c7d2c26..e0306e78e34baaad9520a21e9475dd222846c6c0 100644 (file)
@@ -238,8 +238,6 @@ setup or driver probe/teardown code, so this is an easy constraint.)::
         ##     gpio_free_array()
 
                 gpio_free()
-                gpio_set_debounce()
-
 
 
 Claiming and Releasing GPIOs
index 74fa473bb50408d44b490da1ef36e113fe840160..dee2a0517c1cb39aaff2bb45bb38722c1b090be6 100644 (file)
@@ -219,7 +219,6 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其
         ##     gpio_free_array()
 
                 gpio_free()
-                gpio_set_debounce()
 
 
 
index 1b986bbb090937be046c66f561128470f423628b..dc608358d90ae241edd7220455814cc8b4b95ea0 100644 (file)
@@ -226,7 +226,6 @@ GPIO 值的命令需要等待其信息排到隊首才發送命令,再獲得其
 ##     gpio_free_array()
 
        gpio_free()
-       gpio_set_debounce()
 
 
 
index 17f11bce81131831e775e1a589717a3fe2ed5224..bb1058b1e7fd453f97f835e0d88cc90fa512ce44 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_device.h>
+#include <linux/gpio/consumer.h>
 #include <linux/gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
@@ -1012,8 +1013,8 @@ 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);
+                       gpiod_set_debounce(gpio_to_desc(ts->gpio_pendown),
+                                          pdata->gpio_pendown_debounce);
        } else {
                dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
                return -EINVAL;
index d5ce78e2bdd926a32e589ad214c7bfc380adf2b1..fc56733e8514e2205c24249ceb5f18af44386a5c 100644 (file)
@@ -100,11 +100,6 @@ static inline int gpio_direction_output(unsigned gpio, int value)
        return gpiod_direction_output_raw(gpio_to_desc(gpio), value);
 }
 
-static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
-{
-       return gpiod_set_debounce(gpio_to_desc(gpio), debounce);
-}
-
 static inline int gpio_get_value_cansleep(unsigned gpio)
 {
        return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio));
@@ -214,11 +209,6 @@ static inline int gpio_direction_output(unsigned gpio, int value)
        return -ENOSYS;
 }
 
-static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
-{
-       return -ENOSYS;
-}
-
 static inline int gpio_get_value(unsigned gpio)
 {
        /* GPIO can never have been requested or set as {in,out}put */