Re: [PATCH v3 02/21] pinctrl: pinconf-generic: Add property 'input-debounce-ns'
From: Conor Dooley
Date: Wed Jun 03 2026 - 11:41:42 EST
Linus,
On Tue, Jun 02, 2026 at 10:53:28PM -0700, Changhuang Liang wrote:
> Add 'input-debounce-ns' to the generic parameters used for parsing DT
> files, along with the corresponding configuration parameter
> PIN_CONFIG_INPUT_DEBOUNCE_NS. This allows debounce time to be specified
> in nanoseconds as an alternative to the existing 'input-debounce'
> property which uses microseconds
>
> Signed-off-by: Changhuang Liang <changhuang.liang@xxxxxxxxxxxxxxxx>
> ---
> drivers/pinctrl/pinconf-generic.c | 2 ++
> include/linux/pinctrl/pinconf-generic.h | 5 +++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
> index 64ed28309788..9d67e2d26e28 100644
> --- a/drivers/pinctrl/pinconf-generic.c
> +++ b/drivers/pinctrl/pinconf-generic.c
> @@ -43,6 +43,7 @@ static const struct pin_config_item conf_items[] = {
> PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA", true),
> PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH_UA, "output drive strength", "uA", true),
> PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec", true),
> + PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE_NS, "input debounce", "nsec", true),
> PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL, false),
> PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL, false),
> PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_UV, "input schmitt threshold", "uV", true),
> @@ -185,6 +186,7 @@ static const struct pinconf_generic_params dt_params[] = {
> { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 },
> { "drive-strength-microamp", PIN_CONFIG_DRIVE_STRENGTH_UA, 0 },
> { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 },
> + { "input-debounce-ns", PIN_CONFIG_INPUT_DEBOUNCE_NS, 0 },
> { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 },
> { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 },
> { "input-schmitt", PIN_CONFIG_INPUT_SCHMITT, 0 },
> diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
> index a5d4b2d8633a..1df63c732b99 100644
> --- a/include/linux/pinctrl/pinconf-generic.h
> +++ b/include/linux/pinctrl/pinconf-generic.h
> @@ -71,6 +71,10 @@ struct pinctrl_map;
> * which means it will wait for signals to settle when reading inputs. The
> * argument gives the debounce time in usecs. Setting the
> * argument to zero turns debouncing off.
> + * @PIN_CONFIG_INPUT_DEBOUNCE_NS: this will configure the pin to debounce mode,
> + * which means it will wait for signals to settle when reading inputs. The
> + * argument gives the debounce time in nsecs. Setting the
> + * argument to zero turns debouncing off.
> * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
> * affect the pin's ability to drive output. 1 enables input, 0 disables
> * input.
> @@ -143,6 +147,7 @@ enum pin_config_param {
> PIN_CONFIG_DRIVE_STRENGTH,
> PIN_CONFIG_DRIVE_STRENGTH_UA,
> PIN_CONFIG_INPUT_DEBOUNCE,
> + PIN_CONFIG_INPUT_DEBOUNCE_NS,
> PIN_CONFIG_INPUT_ENABLE,
> PIN_CONFIG_INPUT_SCHMITT,
> PIN_CONFIG_INPUT_SCHMITT_ENABLE,
Should this grow a mutual exclusion check in parse_fw_cfg()?
Part of me says yes for consistency, but also as this is a new property
that's going to have had exclusion in the binding from the start part of
me says that it is unnecessary to add that.
Attachment:
signature.asc
Description: PGP signature