Input: da9063 - add wakeup support
authorSamuel Holland <samuel.holland@sifive.com>
Mon, 17 Jul 2023 19:20:03 +0000 (12:20 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 18 Jul 2023 18:37:52 +0000 (11:37 -0700)
Mark the IRQ as a wake IRQ so it will be enabled during system suspend.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20230717192004.1304287-1-samuel.holland@sifive.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/da9063_onkey.c

index b14a389600c9eab7c356d6a85bea78aaf1e46289..74808bae326a710779cdfa455ff5781739bf6948 100644 (file)
@@ -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,