On Fri, Oct 7, 2022 at 5:29 PM Shenwei Wang <shenwei.wang@xxxxxxx> wrote: > On i.MX8QM/QXP/DXL SoCs, even a GPIO is selected as the wakeup source, > the GPIO block will be powered off when system enters into suspend > state. This can greatly reduce the power consumption of suspend state > because the whole partition can be shutdown. This is called PAD wakeup > feature on i.MX8x platform. > > This patch enables this wakeup feature on i.MX8QM/QXP/DXL platforms. > > Signed-off-by: Shenwei Wang <shenwei.wang@xxxxxxx> > --- > Changes in v2: > - fix a bug when finding the pad index This: > +#define IMX_SC_PAD_FUNC_GET_WAKEUP 9 > +#define IMX_SC_PAD_FUNC_SET_WAKEUP 4 > +#define IMX_SC_IRQ_GROUP_WAKE 3 /* Wakeup interrupts */ > +#define IMX_SC_IRQ_PAD 2 /* Pad wakeup */ > + > +#define IMX_SC_PAD_WAKEUP_OFF 0 > +#define IMX_SC_PAD_WAKEUP_LOW_LVL 4 > +#define IMX_SC_PAD_WAKEUP_FALL_EDGE 5 > +#define IMX_SC_PAD_WAKEUP_RISE_EDGE 6 > +#define IMX_SC_PAD_WAKEUP_HIGH_LVL 7 (...) > +const struct mxc_gpio_pad_map imx8qm_pad_map[] = { > + /* GPIO0 */ > + { 0, IMX8QM_SIM0_CLK}, > + { 1, IMX8QM_SIM0_RST}, > + { 2, IMX8QM_SIM0_IO}, > + { 3, IMX8QM_SIM0_PD}, this is pin control. I think you need to think about adding this to the i.MX pin control driver instead, possibly cooperaring with the GPIO driver. I'm not entirely certain about the relationship between MXC and i.MX so correct me if I get this wrong... To me this looks like two drivers could end up fighting about the control of the same hardware if you don't. Also CC i.MX Freescale pin control maintainers on all patches like this, thanks! (Added on to-line.) Yours, Linus Walleij