RE: [PATCH v3 5/5] gpio: mxc: enable pad wakeup on i.MX8x platforms

From: Shenwei Wang
Date: Wed Oct 26 2022 - 22:28:12 EST




> -----Original Message-----
> From: Peng Fan <peng.fan@xxxxxxx>
> Sent: Wednesday, October 26, 2022 1:20 AM
> >+ 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->gc, offset, config);
>
> checkpatch should report warning.
>

It is actually no warning. 😊
$ ./scripts/checkpatch.pl 0005-gpio-mxc-enable-pad-wakeup-on-i.MX8x-platforms.patch
total: 0 errors, 0 warnings, 150 lines checked

0005-gpio-mxc-enable-pad-wakeup-on-i.MX8x-platforms.patch has no obvious style problems and is ready for submission.

Regards,
Shenwei

> >+
> >+ return 0;
> >+}
> >+
> >+static void mxc_gpio_set_pad_wakeup(struct mxc_gpio_port *port, bool
> >+enable) {
> >+ unsigned long config;
> >+ int i, type;
> >+
> >+ static const u32 pad_type_map[] = {
> >+ IMX_SCU_WAKEUP_OFF, /* 0 */
> >+ IMX_SCU_WAKEUP_RISE_EDGE, /* IRQ_TYPE_EDGE_RISING */
> >+ IMX_SCU_WAKEUP_FALL_EDGE, /*
> IRQ_TYPE_EDGE_FALLING */
> >+ IMX_SCU_WAKEUP_FALL_EDGE, /*
> IRQ_TYPE_EDGE_BOTH */
> >+ IMX_SCU_WAKEUP_HIGH_LVL, /* IRQ_TYPE_LEVEL_HIGH */
> >+ IMX_SCU_WAKEUP_OFF, /* 5 */
> >+ IMX_SCU_WAKEUP_OFF, /* 6 */
> >+ IMX_SCU_WAKEUP_OFF, /* 7 */
> >+ IMX_SCU_WAKEUP_LOW_LVL, /*
> IRQ_TYPE_LEVEL_LOW */
> >+ };
> >+
> >+ for (i = 0; i < 32; i++) {
> >+ if ((port->wakeup_pads & (1<<i))) {
> >+ type = port->pad_type[i];
> >+ if (enable)
> >+ config = pad_type_map[type];
> >+ else
> >+ config = IMX_SCU_WAKEUP_OFF;
> >+ mxc_gpio_generic_config(port, i, config);
> >+ }
> >+ }
> >+}
> >+
> >+static int __maybe_unused mxc_gpio_noirq_suspend(struct device *dev) {
> >+ struct platform_device *pdev = to_platform_device(dev);
> >+ struct mxc_gpio_port *port = platform_get_drvdata(pdev);
> >+
> >+ if (port->wakeup_pads > 0) {
> >+ mxc_gpio_set_pad_wakeup(port, true);
> >+ port->is_pad_wakeup = true;
> >+ }
> >+
> >+ return 0;
> >+}
> >+
> >+static int __maybe_unused mxc_gpio_noirq_resume(struct device *dev) {
> >+ struct platform_device *pdev = to_platform_device(dev);
> >+ struct mxc_gpio_port *port = platform_get_drvdata(pdev);
> >+
> >+ if (port->wakeup_pads > 0)
> >+ mxc_gpio_set_pad_wakeup(port, false);
> >+ port->is_pad_wakeup = false;
> >+
> >+ return 0;
> >+}
> >+
> >+static const struct dev_pm_ops mxc_gpio_dev_pm_ops = {
> >+ SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mxc_gpio_noirq_suspend,
> >+mxc_gpio_noirq_resume) };
> >+
> > static int mxc_gpio_syscore_suspend(void) {
> > struct mxc_gpio_port *port;
> >@@ -537,6 +625,7 @@ static struct platform_driver mxc_gpio_driver = {
> > .name = "gpio-mxc",
> > .of_match_table = mxc_gpio_dt_ids,
> > .suppress_bind_attrs = true,
> >+ .pm = &mxc_gpio_dev_pm_ops,
> > },
> > .probe = mxc_gpio_probe,
> > };
>
>
> Except the format issue, patch looks good to me.
>
> Regards,
> Peng.
>
> >--
> >2.34.1
> >
>
> --