Linux Input/HID development
 help / color / mirror / Atom feed
From: Samuel Holland <samuel.holland@sifive.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Support Opensource <support.opensource@diasemi.com>
Cc: Samuel Holland <samuel.holland@sifive.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Input: da9063 - add wakeup support
Date: Mon, 17 Jul 2023 12:20:03 -0700	[thread overview]
Message-ID: <20230717192004.1304287-1-samuel.holland@sifive.com> (raw)

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(+)

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,
-- 
2.40.1


             reply	other threads:[~2023-07-17 19:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 19:20 Samuel Holland [this message]
2023-07-18 18:46 ` [PATCH] Input: da9063 - add wakeup support Dmitry Torokhov

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=20230717192004.1304287-1-samuel.holland@sifive.com \
    --to=samuel.holland@sifive.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=support.opensource@diasemi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox