From: "François-Xavier Carton" <fx.carton91@gmail.com>
To: linux-input@vger.kernel.org
Cc: Ethan Lee <flibitijibibo@gmail.com>,
Bastien Nocera <hadess@hadess.net>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: [PATCH v2 4/4] HID: gamecube-adapter: restore input after suspend
Date: Tue, 12 May 2020 10:46:16 +0200 [thread overview]
Message-ID: <20200512084616.32158-4-fx.carton91@gmail.com> (raw)
In-Reply-To: <20200512084616.32158-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 efcbd8f27b67..11d3e483f0c1 100644
--- a/drivers/hid/hid-gamecube-adapter.c
+++ b/drivers/hid/hid-gamecube-adapter.c
@@ -441,6 +441,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_adapter *adpt = hid_get_drvdata(hdev);
@@ -462,6 +470,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
prev parent reply other threads:[~2020-05-12 8:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 8:46 [PATCH v2 1/4] HID: gamecube-adapter: add nintendo gamecube adapter François-Xavier Carton
2020-05-12 8:46 ` [PATCH v2 2/4] HID: gamecube-adapter: add rumble support François-Xavier Carton
2020-06-19 7:15 ` Jiri Kosina
2020-07-21 8:57 ` François-Xavier Carton
2020-05-12 8:46 ` [PATCH v2 3/4] HID: gamecube-adapter: add auto calibration François-Xavier Carton
2020-05-12 8:46 ` 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=20200512084616.32158-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).