From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Frank Li <Frank.Li@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Nitin Garg <nitin.garg@nxp.com>, Abel Vesa <abelvesa@kernel.org>,
"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK,
TOUCHSCREEN)..." <linux-input@vger.kernel.org>,
"open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<imx@lists.linux.dev>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/1] input: imx_sc_key: Enable wakeup according to dts property wakeup-source
Date: Wed, 24 Jul 2024 11:21:27 -0700 [thread overview]
Message-ID: <ZqFGJwb-0MU_GP28@google.com> (raw)
In-Reply-To: <20240719152259.760457-1-Frank.Li@nxp.com>
Hi Frank,
On Fri, Jul 19, 2024 at 11:22:58AM -0400, Frank Li wrote:
> From: Abel Vesa <abel.vesa@nxp.com>
>
> Enable default wakeup according to dts property 'wakeup-source'.
>
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
> Reviewed-by: Nitin Garg <nitin.garg@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change from v1 to v2
> - change int to bool
> - move of_property_read_bool() just before device_init_wakeup()
> - drop !!
> ---
> drivers/input/keyboard/imx_sc_key.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c
> index d18839f1f4f60..fc1492088b645 100644
> --- a/drivers/input/keyboard/imx_sc_key.c
> +++ b/drivers/input/keyboard/imx_sc_key.c
> @@ -110,8 +110,10 @@ static void imx_sc_key_action(void *data)
>
> static int imx_sc_key_probe(struct platform_device *pdev)
> {
> + struct device_node *np = pdev->dev.of_node;
> struct imx_key_drv_data *priv;
> struct input_dev *input;
> + bool wakeup;
> int error;
>
> priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> @@ -151,6 +153,9 @@ static int imx_sc_key_probe(struct platform_device *pdev)
> priv->input = input;
> platform_set_drvdata(pdev, priv);
>
> + wakeup = of_property_read_bool(np, "wakeup-source");
The driver uses generic device properties, why do you use OF-specific
variant here?
> + device_init_wakeup(&pdev->dev, wakeup);
> +
How does this actually work? Doesn't the call directly below
unconditionally configures button as a wakeup source?
> error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, SC_IRQ_BUTTON,
> true);
> if (error) {
Thanks.
--
Dmitry
next prev parent reply other threads:[~2024-07-24 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-19 15:22 [PATCH v2 1/1] input: imx_sc_key: Enable wakeup according to dts property wakeup-source Frank Li
2024-07-24 18:21 ` Dmitry Torokhov [this message]
2024-07-24 18:54 ` Frank Li
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=ZqFGJwb-0MU_GP28@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=Frank.Li@nxp.com \
--cc=abelvesa@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nitin.garg@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.