Re: [PATCH v3 4/5] pinctrl: upboard: fix I2C pinmux-select set CPLD GPIO OUT not function mode

From: Andy Shevchenko

Date: Thu Nov 26 2026 - 10:26:00 EST


On Thu, Nov 26, 2026 at 11:09:47PM +0800, Gary Wang wrote:
> The CPLD I2C pin mode setting through pinmux-select is not correct.
> Should be set UPBOARD_PIN_MODE_FUNCTION on AANT0F04 devices.
>
> Set UPBOARD_PIN_MODE_FUNCTION to 1 to prevent a NULL pointer
> dereference error on .modes[i] for any pin group using this setting.

...

> enum upboard_pin_mode {
> - UPBOARD_PIN_MODE_FUNCTION,
> + UPBOARD_PIN_MODE_FUNCTION = 1,
> UPBOARD_PIN_MODE_GPIO_IN,
> UPBOARD_PIN_MODE_GPIO_OUT,
> UPBOARD_PIN_MODE_DISABLED,

This won't make it robust enough against shuffling. We better to assign
them all.

--
With Best Regards,
Andy Shevchenko