[PATCH v6 07/13] gpio: mxc: convert pad wakeup compatible checks to hwdata flags

Peng Fan peng.fan at oss.nxp.com
Wed Oct 14 01:34:58 PDT 2026


Hi Linus,
On Wed, Oct 14, 2026 at 01:10:48AM +0200, Linus Walleij wrote:
>Hi Peng,
>
>On Sun, Oct 11, 2026 at 1:51 PM Peng Fan (OSS) <peng.fan at oss.nxp.com> wrote:
>
>>  static bool mxc_gpio_generic_config(struct mxc_gpio_port *port,
>>                 unsigned int offset, unsigned long conf)
>>  {
>> -       struct device_node *np = port->dev->of_node;
>> +       int ret;
>> +
>> +       if (!mxc_gpio_has_pad_wakeup(port))
>> +               return false;
>
>Why is the entire call to mxc_gpio_generic_config()
>bailing out here if the port does not have pad wakeup?
>
>> -       if (of_device_is_compatible(np, "fsl,imx8dxl-gpio") ||
>> -           of_device_is_compatible(np, "fsl,imx8qxp-gpio") ||
>> -           of_device_is_compatible(np, "fsl,imx8qm-gpio"))
>> -               return (gpiochip_generic_config(&port->gen_gc.gc,
>> -                                               offset, conf) == 0);
>> +       ret = gpiochip_generic_config(&port->gen_gc.gc, offset, conf);
>> +       if (ret)
>> +               return false;
>
>Then no generic config can happen.
>
>This looks weird, isn't it just some of the configs that
>don't work?

The early return is correct and matches the original behavior - only
i.MX8 SoCs with SCU have pad wakeup hardware.

gpiochip_generic_config() here calls into the pinctrl backend's
pin_config_set(), which on i.MX8 programs the SCU firmware with the
PAD wakeup source type.  Non-i.MX8 SoCs don't have an SCU pinctrl backend.

The function name is misleading - its only caller is mxc_gpio_set_pad_wakeup().

Thanks
Peng

>
>Yours,
>Linus Walleij
>
>



More information about the linux-arm-kernel mailing list