[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240716213313.1584557-1-Frank.Li@nxp.com>
Date: Tue, 16 Jul 2024 17:33:11 -0400
From: Frank Li <Frank.Li@....com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Abel Vesa <abelvesa@...nel.org>,
Nitin Garg <nitin.garg@....com>,
linux-input@...r.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)...),
imx@...ts.linux.dev (open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE),
linux-arm-kernel@...ts.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE),
linux-kernel@...r.kernel.org (open list)
Cc: imx@...ts.linux.dev
Subject: [PATCH 1/1] input: imx_sc_key: Enable wakeup according to dts property wakeup-source
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>
---
drivers/input/keyboard/imx_sc_key.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c
index d18839f1f4f60..83025407065ba 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;
+ int wakeup;
int error;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -130,6 +132,8 @@ static int imx_sc_key_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&priv->check_work, imx_sc_check_for_events);
+ wakeup = of_property_read_bool(np, "wakeup-source");
+
input = devm_input_allocate_device(&pdev->dev);
if (!input) {
dev_err(&pdev->dev, "failed to allocate the input device\n");
@@ -151,6 +155,8 @@ static int imx_sc_key_probe(struct platform_device *pdev)
priv->input = input;
platform_set_drvdata(pdev, priv);
+ device_init_wakeup(&pdev->dev, !!wakeup);
+
error = imx_scu_irq_group_enable(SC_IRQ_GROUP_WAKE, SC_IRQ_BUTTON,
true);
if (error) {
--
2.34.1
Powered by blists - more mailing lists