All of lore.kernel.org
 help / color / mirror / Atom feed
From: "François-Xavier Carton" <fx.carton91@gmail.com>
To: linux-input@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: "François-Xavier Carton" <fx.carton91@gmail.com>,
	"Ethan Lee" <flibitijibibo@gmail.com>,
	"Bastien Nocera" <hadess@hadess.net>
Subject: [PATCH v3 4/4] HID: gamecube-adapter: restore input after suspend
Date: Wed, 14 Oct 2020 03:30:23 +0200	[thread overview]
Message-ID: <20201014013023.23078-5-fx.carton91@gmail.com> (raw)
In-Reply-To: <20201014013023.23078-1-fx.carton91@gmail.com>

Send the init command after suspend, so that we get input reports again.

Signed-off-by: François-Xavier Carton <fx.carton91@gmail.com>
---
 drivers/hid/hid-gamecube-adapter.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/hid/hid-gamecube-adapter.c b/drivers/hid/hid-gamecube-adapter.c
index 53d372a24277..0951a25b048b 100644
--- a/drivers/hid/hid-gamecube-adapter.c
+++ b/drivers/hid/hid-gamecube-adapter.c
@@ -452,6 +452,14 @@ static int gamecube_hid_probe(struct hid_device *hdev,
 	return ret;
 }
 
+#ifdef CONFIG_PM
+static int gamecube_resume(struct hid_device *hdev)
+{
+	gamecube_send_cmd_init(hdev);
+	return 0;
+}
+#endif
+
 static void gamecube_hid_remove(struct hid_device *hdev)
 {
 	struct gamecube_adpt *adpt = hid_get_drvdata(hdev);
@@ -473,6 +481,9 @@ static struct hid_driver gamecube_hid_driver = {
 	.probe		= gamecube_hid_probe,
 	.remove		= gamecube_hid_remove,
 	.raw_event	= gamecube_hid_event,
+#ifdef CONFIG_PM
+	.reset_resume	= gamecube_resume,
+#endif
 };
 module_hid_driver(gamecube_hid_driver);
 
-- 
2.26.2


      parent reply	other threads:[~2020-10-14  9:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  1:30 [PATCH v3 0/4] HID: gamecube-adapter François-Xavier Carton
2020-10-14  1:30 ` [PATCH v3 1/4] HID: gamecube-adapter: add nintendo gamecube adapter François-Xavier Carton
2020-10-14  1:30 ` [PATCH v3 2/4] HID: gamecube-adapter: add rumble support François-Xavier Carton
2020-10-14  1:30 ` [PATCH v3 3/4] HID: gamecube-adapter: add auto calibration François-Xavier Carton
2020-10-14  1:30 ` François-Xavier Carton [this message]

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=20201014013023.23078-5-fx.carton91@gmail.com \
    --to=fx.carton91@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=flibitijibibo@gmail.com \
    --cc=hadess@hadess.net \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.