lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 27 Oct 2022 02:27:39 +0000
From:   Shenwei Wang <shenwei.wang@....com>
To:     Peng Fan <peng.fan@....com>
CC:     Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Aisheng Dong <aisheng.dong@....com>,
        Jacky Bai <ping.bai@....com>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        dl-linux-imx <linux-imx@....com>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: RE: [PATCH v3 5/5] gpio: mxc: enable pad wakeup on i.MX8x platforms



> -----Original Message-----
> From: Peng Fan <peng.fan@....com>
> 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
> >
> 
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ