[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZqFGJwb-0MU_GP28@google.com>
Date: Wed, 24 Jul 2024 11:21:27 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Frank Li <Frank.Li@....com>
Cc: Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Nitin Garg <nitin.garg@....com>,
Abel Vesa <abelvesa@...nel.org>,
"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." <linux-input@...r.kernel.org>,
"open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" <imx@...ts.linux.dev>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" <linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/1] input: imx_sc_key: Enable wakeup according to dts
property wakeup-source
Hi Frank,
On Fri, Jul 19, 2024 at 11:22:58AM -0400, Frank Li wrote:
> From: Abel Vesa <abel.vesa@....com>
>
> Enable default wakeup according to dts property 'wakeup-source'.
>
> Signed-off-by: Abel Vesa <abel.vesa@....com>
> Reviewed-by: Nitin Garg <nitin.garg@....com>
> Signed-off-by: Frank Li <Frank.Li@....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
Powered by blists - more mailing lists