[kernel] r21994 - in dists/sid/linux/debian: . patches patches/bugfix/all

Ben Hutchings benh at moszumanska.debian.org
Fri Oct 31 01:50:29 UTC 2014


Author: benh
Date: Fri Oct 31 01:50:29 2014
New Revision: 21994

Log:
HID: i2c-hid: call the hid driver's suspend and resume callbacks (Closes: #767204)

Added:
   dists/sid/linux/debian/patches/bugfix/all/HID-i2c-hid-call-the-hid-driver-s-suspend-and-resume.patch
Modified:
   dists/sid/linux/debian/changelog
   dists/sid/linux/debian/patches/series

Modified: dists/sid/linux/debian/changelog
==============================================================================
--- dists/sid/linux/debian/changelog	Fri Oct 31 01:46:13 2014	(r21993)
+++ dists/sid/linux/debian/changelog	Fri Oct 31 01:50:29 2014	(r21994)
@@ -123,6 +123,8 @@
     parameters (Closes: #764285)
   * lockd: Try to reconnect if statd has moved (Closes: #767219)
   * m25p80: Fix module device ID table
+  * HID: i2c-hid: call the hid driver's suspend and resume callbacks
+    (Closes: #767204)
 
   [ Mauricio Faria de Oliveira ]
   * [ppc64el] Disable CONFIG_CMDLINE{,_BOOL} usage for setting consoles

Added: dists/sid/linux/debian/patches/bugfix/all/HID-i2c-hid-call-the-hid-driver-s-suspend-and-resume.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux/debian/patches/bugfix/all/HID-i2c-hid-call-the-hid-driver-s-suspend-and-resume.patch	Fri Oct 31 01:50:29 2014	(r21994)
@@ -0,0 +1,69 @@
+From: Andrew Duggan <aduggan at synaptics.com>
+Date: Fri, 11 Jul 2014 16:34:18 -0700
+Subject: HID: i2c-hid: call the hid driver's suspend and resume callbacks
+Origin: https://git.kernel.org/linus/109571cf3ec78a39477eedd6b11927f52cbcb1e8
+
+Currently, the i2c-hid driver does not call the suspend, resume, and
+reset_resume callbacks in the hid_driver struct when those events occur.
+This means that HID drivers for i2c-hid devices will not be able to execute
+commands which may be needed during suspend or resume. One example is when a
+touchpad using the hid-multitouch driver gets reset by i2c-hid coming out of
+resume. Since the reset_resume callback never gets called the device is never
+put back into the correct input mode. This patch calls the suspend and resume
+callbacks and tries to duplicate the functionality of the usb-hid driver.
+
+Signed-off-by: Andrew Duggan <aduggan at synaptics.com>
+Signed-off-by: Vincent Huang <vincent.huang at tw.synaptics.com>
+Reviewed-by: Benjamin Tissoires <benjamin.tissoires at redhat.com>
+Signed-off-by: Jiri Kosina <jkosina at suse.cz>
+---
+ drivers/hid/i2c-hid/i2c-hid.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
+index 21aafc8..747d544 100644
+--- a/drivers/hid/i2c-hid/i2c-hid.c
++++ b/drivers/hid/i2c-hid/i2c-hid.c
+@@ -1054,21 +1054,29 @@ static int i2c_hid_remove(struct i2c_client *client)
+ static int i2c_hid_suspend(struct device *dev)
+ {
+ 	struct i2c_client *client = to_i2c_client(dev);
++	struct i2c_hid *ihid = i2c_get_clientdata(client);
++	struct hid_device *hid = ihid->hid;
++	int ret = 0;
+ 
+ 	disable_irq(client->irq);
+ 	if (device_may_wakeup(&client->dev))
+ 		enable_irq_wake(client->irq);
+ 
++	if (hid->driver && hid->driver->suspend)
++		ret = hid->driver->suspend(hid, PMSG_SUSPEND);
++
+ 	/* Save some power */
+ 	i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
+ 
+-	return 0;
++	return ret;
+ }
+ 
+ static int i2c_hid_resume(struct device *dev)
+ {
+ 	int ret;
+ 	struct i2c_client *client = to_i2c_client(dev);
++	struct i2c_hid *ihid = i2c_get_clientdata(client);
++	struct hid_device *hid = ihid->hid;
+ 
+ 	enable_irq(client->irq);
+ 	ret = i2c_hid_hwreset(client);
+@@ -1078,6 +1086,11 @@ static int i2c_hid_resume(struct device *dev)
+ 	if (device_may_wakeup(&client->dev))
+ 		disable_irq_wake(client->irq);
+ 
++	if (hid->driver && hid->driver->reset_resume) {
++		ret = hid->driver->reset_resume(hid);
++		return ret;
++	}
++
+ 	return 0;
+ }
+ #endif

Modified: dists/sid/linux/debian/patches/series
==============================================================================
--- dists/sid/linux/debian/patches/series	Fri Oct 31 01:46:13 2014	(r21993)
+++ dists/sid/linux/debian/patches/series	Fri Oct 31 01:50:29 2014	(r21994)
@@ -401,3 +401,4 @@
 bugfix/all/mtd-m25p80-get-rid-of-spi_get_device_id.patch
 bugfix/all/mtd-spi-nor-make-spi_nor_scan-take-a-chip-type-name-.patch
 bugfix/all/mtd-m25p80-spi-nor-Fix-module-aliases-for-m25p80.patch
+bugfix/all/HID-i2c-hid-call-the-hid-driver-s-suspend-and-resume.patch



More information about the Kernel-svn-changes mailing list