summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-11-09 23:53:23 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-11-16 15:14:34 +0300
commitf725edd86b6b2415db9ae9bb6293f8300b9dbce9 (patch)
treed4bdd105e835c190834821fd8aa5c7e74f3aaa26 /drivers/gpio/gpiolib.c
parentbaca3b15cd2a171fa967223e2d7aea6e5f98ba9e (diff)
downloadlinux-f725edd86b6b2415db9ae9bb6293f8300b9dbce9.tar.xz
gpiolib: Introduce gpio_set_debounce_timeout() for internal use
In some cases we would like to have debounce setter which doesn't fail when a feature is not supported by a controller. Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index e5338f6d78d7..c6db72d5420e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2160,6 +2160,13 @@ static int gpio_set_bias(struct gpio_desc *desc)
return gpio_set_config_with_argument_optional(desc, bias, arg);
}
+int gpio_set_debounce_timeout(struct gpio_desc *desc, unsigned int debounce)
+{
+ return gpio_set_config_with_argument_optional(desc,
+ PIN_CONFIG_INPUT_DEBOUNCE,
+ debounce);
+}
+
/**
* gpiod_direction_input - set the GPIO direction to input
* @desc: GPIO to set to input