Re: [PATCH v7 07/18] gpiolib: Introduce gpio_set_debounce_timeout() for internal use

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

 



On Thu, Nov 12, 2020 at 12:19:57AM +0200, Andy Shevchenko wrote:
> 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@xxxxxxxxxxxxxxx>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/gpio/gpiolib.c | 7 +++++++
>  drivers/gpio/gpiolib.h | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index c4f73597a54d..0d691ec512a4 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2161,6 +2161,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);
> +}

Sorry for commenting this late but I realized we have
gpiod_set_debounce() already. At least this new function should follow
the naming (gpiod as it takes descriptior):

int gpiod_set_debounce_optional(struct gpio_desc *desc, unsigned int debounce);



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux