[PATCH v2 4/4] HID: gamecube-adapter: restore input after suspend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: François-Xavier Carton <fx.carton91@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux