devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Dong Aisheng <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH v3 4/5] pinctrl: freescale: add pad wakeup config
Date: Wed, 26 Oct 2022 16:21:39 +0800	[thread overview]
Message-ID: <20221026082139.GB18160@linux-1xn6> (raw)
In-Reply-To: <20221025183244.615318-5-shenwei.wang@nxp.com>

On Tue, Oct 25, 2022 at 01:32:43PM -0500, Shenwei Wang wrote:
>add the logic to configure the pad wakeup function via
>the pin_config_set handler.
>
>Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
>---
> drivers/pinctrl/freescale/pinctrl-scu.c | 30 +++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
>diff --git a/drivers/pinctrl/freescale/pinctrl-scu.c b/drivers/pinctrl/freescale/pinctrl-scu.c
>index 59b5f8a35111..0b172f7e7261 100644
>--- a/drivers/pinctrl/freescale/pinctrl-scu.c
>+++ b/drivers/pinctrl/freescale/pinctrl-scu.c
>@@ -15,6 +15,11 @@
> #include "../core.h"
> #include "pinctrl-imx.h"
> 
>+#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 */
>+
> enum pad_func_e {
> 	IMX_SC_PAD_FUNC_SET = 15,
> 	IMX_SC_PAD_FUNC_GET = 16,
>@@ -36,10 +41,18 @@ struct imx_sc_msg_resp_pad_get {
> 	u32 val;
> } __packed;
> 
>+struct imx_sc_msg_gpio_set_pad_wakeup {
>+	struct imx_sc_rpc_msg hdr;
>+	u16 pad;
>+	u8 wakeup;
>+} __packed __aligned(4);
>+
> static struct imx_sc_ipc *pinctrl_ipc_handle;
> 
> int imx_pinctrl_sc_ipc_init(struct platform_device *pdev)
> {
>+	imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WAKE,
>+					 IMX_SC_IRQ_PAD, true);
> 	return imx_scu_get_handle(&pinctrl_ipc_handle);
> }
> EXPORT_SYMBOL_GPL(imx_pinctrl_sc_ipc_init);
>@@ -81,6 +94,23 @@ int imx_pinconf_set_scu(struct pinctrl_dev *pctldev, unsigned pin_id,
> 	unsigned int val;
> 	int ret;
> 
>+	if (num_configs == 1) {
>+		struct imx_sc_msg_gpio_set_pad_wakeup wmsg;
>+
>+		hdr = &wmsg.hdr;
>+		hdr->ver = IMX_SC_RPC_VERSION;
>+		hdr->svc = IMX_SC_RPC_SVC_PAD;
>+		hdr->func = IMX_SC_PAD_FUNC_SET_WAKEUP;
>+		hdr->size = 2;
>+		wmsg.pad = pin_id;
>+		wmsg.wakeup = *configs;
>+		ret = imx_scu_call_rpc(pinctrl_ipc_handle, &wmsg, true);
>+
>+		dev_dbg(ipctl->dev, "wakeup pin_id: %d type: %d\n",
>+				pin_id, *configs);

Format issue, and configs should be unsigned long type. Otherwise, looks good
to me.

Regards,
Peng.

>+		return ret;
>+	}
>+
> 	/*
> 	 * Set mux and conf together in one IPC call
> 	 */
>-- 
>2.34.1
>

-- 

  parent reply	other threads:[~2022-10-26  7:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 18:32 [PATCH v3 0/5] add suspend/resume support for i.mx8x SoCs Shenwei Wang
2022-10-25 18:32 ` [PATCH v3 1/5] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property Shenwei Wang
2022-10-26  8:25   ` Peng Fan
2022-10-25 18:32 ` [PATCH v3 2/5] arm64: dts: imx8qm-ss-lsio: " Shenwei Wang
2022-10-26  8:26   ` Peng Fan
2022-10-25 18:32 ` [PATCH v3 3/5] arm64: dts: imx8qxp-ss-lsio: " Shenwei Wang
2022-10-26  8:27   ` Peng Fan
2022-10-25 18:32 ` [PATCH v3 4/5] pinctrl: freescale: add pad wakeup config Shenwei Wang
2022-10-26  3:56   ` kernel test robot
2022-10-26  8:21   ` Peng Fan [this message]
2022-10-25 18:32 ` [PATCH v3 5/5] gpio: mxc: enable pad wakeup on i.MX8x platforms Shenwei Wang
2022-10-26  6:20   ` Peng Fan
2022-10-27  2:27     ` Shenwei Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221026082139.GB18160@linux-1xn6 \
    --to=peng.fan@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ping.bai@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=shenwei.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).