[PATCH v6 07/13] gpio: mxc: convert pad wakeup compatible checks to hwdata flags
Andy Shevchenko
andy.shevchenko at gmail.com
Mon Oct 12 02:27:24 PDT 2026
On Sun, Oct 11, 2026 at 2:54 PM Peng Fan (OSS) <peng.fan at oss.nxp.com> wrote:
>
> mxc_gpio_generic_config() and mxc_gpio_set_pad_wakeup() call
> of_device_is_compatible() on every invocation to determine pad wakeup
> capability and i.MX8QM-specific behavior. These properties are
> invariant for the lifetime of the device.
>
> Extend the hwdata flags scheme introduced in the previous commit with
> MXC_GPIO_HAS_PAD_WAKEUP and MXC_GPIO_FALL_EDGE_WAKEUP_BROKEN, adding
> dedicated hwdata instances for imx8qm and imx8qxp (also used by imx8dxl).
> This replaces the repeated device tree string comparisons in the
> suspend/resume path with simple flag tests on static per-compatible
> data.
>
> While at it, clean up mxc_gpio_generic_config() to use a local ret
> variable for clarity instead of the == 0 comparison.
...
> +static struct mxc_gpio_hwdata imx8qm_gpio_hwdata = {
> + MXC_GPIO_HW_DATA_COMMON,
> + .flags = MXC_GPIO_FALL_EDGE_WAKEUP_BROKEN | MXC_GPIO_HAS_PAD_WAKEUP,
> +};
> +
> +static struct mxc_gpio_hwdata imx8qxp_gpio_hwdata = {
> + MXC_GPIO_HW_DATA_COMMON,
> + .flags = MXC_GPIO_HAS_PAD_WAKEUP,
> +};
Okay, if you want to deduplicate that, make another data structure
inside hwdata, or wrap hwdata with flags. But really, kill that
definition.
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list