[PATCH 07/10] pinctrl: realtek: Initialise omitted offset fields to NA in config macros

Yu-Chun Lin [林祐君] eleanor.lin at realtek.com
Tue Nov 3 22:07:33 PST 2026


> The Realtek pinctrl driver uses NA (0xffffffff) as the sentinel for unsupported
> pin configuration features.  However, RTK_PIN_CONFIG omits
> input_volt_offset, slew_rate_offset, and hvil_offset, and
> RTK_PIN_CONFIG_V2 omits slew_rate_offset and hvil_offset.  Because C99
> designated initialisers zero-initialise omitted members, those fields default to 0
> instead of NA, causing rtd_pconf_parse_conf() to treat unsupported features as
> valid at bit offset base_bit + 0 and corrupt adjacent register bits.
> 
> Explicitly initialise the omitted offset fields to NA in RTK_PIN_CONFIG and
> RTK_PIN_CONFIG_V2.
> 
> Fixes: dcc9334435b0 ("pinctrl: realtek: add support for slew rate, input voltage
> and high VIL")

This should be:
Fixes: e99ce78030db ("pinctrl: realtek: Add common pinctrl driver for Realtek
DHC RTD SoCs")

> Fixes: e309dbd523b8 ("pinctrl: realtek: add rtd1625 pinctrl driver")
> Closes:
> https://sashiko.dev/#/bug/linux-fbd0bf54-6dba-4652-9418-270b11fb6d8b
> Cc: stable at vger.kernel.org
> Signed-off-by: Lee Jones <lee at kernel.org>

Otherwise, looks good to me.

Thanks for the fixes.

Reviewed-by: Yu-Chun Lin <eleanor.lin at realtek.com>

> ---
>  drivers/pinctrl/realtek/pinctrl-rtd.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.h
> b/drivers/pinctrl/realtek/pinctrl-rtd.h
> index 77c30ea76443..86db54ea3ce8 100644
> --- a/drivers/pinctrl/realtek/pinctrl-rtd.h
> +++ b/drivers/pinctrl/realtek/pinctrl-rtd.h
> @@ -96,6 +96,9 @@ struct rtd_pin_reg_list {
>                 .smt_offset = _smt_off, \
>                 .power_offset = _pow_off, \
>                 .curr_type = _curr_type, \
> +               .input_volt_offset = NA, \
> +               .slew_rate_offset = NA, \
> +               .hvil_offset = NA, \
>         }
> 
>  #define RTK_PIN_CONFIG_V2(_name, _reg_off, _base_bit, _pud_en_off, \
> @@ -112,6 +115,8 @@ struct rtd_pin_reg_list {
>                 .power_offset = _pow_off, \
>                 .input_volt_offset = _input_volt_off, \
>                 .curr_type = _curr_type, \
> +               .slew_rate_offset = NA, \
> +               .hvil_offset = NA, \
>         }
> 
>  #define RTK_PIN_CONFIG_I2C(_name, _reg_off, _base_bit, _pud_en_off, \
> --
> 2.56.0.385.gac671c819a-goog


More information about the linux-arm-kernel mailing list