diff mbox series

Input: da9063 - add wakeup support

Message ID 20230717192004.1304287-1-samuel.holland@sifive.com
State Accepted
Commit d7781232b5b2d049e654d5ead9921dc49090d214
Headers show
Series Input: da9063 - add wakeup support | expand

Commit Message

Samuel Holland July 17, 2023, 7:20 p.m. UTC
Mark the IRQ as a wake IRQ so it will be enabled during system suspend.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

 drivers/input/misc/da9063_onkey.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Dmitry Torokhov July 18, 2023, 6:46 p.m. UTC | #1
On Mon, Jul 17, 2023 at 12:20:03PM -0700, Samuel Holland wrote:
> Mark the IRQ as a wake IRQ so it will be enabled during system suspend.
>
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>

Applied, thank you.


--
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/misc/da9063_onkey.c b/drivers/input/misc/da9063_onkey.c
index b14a389600c9..74808bae326a 100644
--- a/drivers/input/misc/da9063_onkey.c
+++ b/drivers/input/misc/da9063_onkey.c
@@ -10,6 +10,7 @@ 
 #include <linux/input.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/pm_wakeirq.h>
 #include <linux/workqueue.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -251,6 +252,14 @@  static int da9063_onkey_probe(struct platform_device *pdev)
 		return error;
 	}
 
+	error = dev_pm_set_wake_irq(&pdev->dev, irq);
+	if (error)
+		dev_warn(&pdev->dev,
+			 "Failed to set IRQ %d as a wake IRQ: %d\n",
+			 irq, error);
+	else
+		device_init_wakeup(&pdev->dev, true);
+
 	error = input_register_device(onkey->input);
 	if (error) {
 		dev_err(&pdev->dev,