[PATCH v6 07/13] gpio: mxc: convert pad wakeup compatible checks to hwdata flags
Frank Li
Frank.li at oss.nxp.com
Mon Oct 12 07:31:15 PDT 2026
On Mon, Oct 12, 2026 at 06:01:12PM +0800, Peng Fan wrote:
> On Mon, Oct 12, 2026 at 12:27:24PM +0300, Andy Shevchenko wrote:
> >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.
>
> Ah. this would need more invasive changes.
>
> Bartosz, Frank,
>
> what's your take on this?
I think your change is good enough. If need, we can change in future, which
only impact one drivers.
Frank
>
> Thanks
> Peng
>
> >
> >--
> >With Best Regards,
> >Andy Shevchenko
> >
>
More information about the linux-arm-kernel
mailing list