aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2013-11-13 06:34:18 -0500
committerJiri Kosina <jkosina@suse.cz>2013-11-25 17:17:23 -0500
commit94037efe81d8e734e28f12b98f76a6e8005495d6 (patch)
treefd2c47183c18aef80ef002696d2b1eb2dd347f7a /drivers/hid/i2c-hid
parente0da5c9a49b927d9e5f62b21a7abc283e99022e2 (diff)
HID: i2c-hid: disable interrupt on suspend
When an I2C HID device is powered of during system sleep, as a result of removing its power resources (by the ACPI core) the interrupt line might go low as well. This results inadvertent interrupt and wakes the system from sleep immediately. To prevent this we disable the device interrupt in the drivers suspend method and enable it on resume. The device can still wake the system up if it is wake capable (this also means that not all of its power will be removed to keep the interrupt line high). Reported-by: Jerome Blin <jerome.blin@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index ae48d18ee315..20ab6853950e 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1061,6 +1061,7 @@ static int i2c_hid_suspend(struct device *dev)
1061{ 1061{
1062 struct i2c_client *client = to_i2c_client(dev); 1062 struct i2c_client *client = to_i2c_client(dev);
1063 1063
1064 disable_irq(client->irq);
1064 if (device_may_wakeup(&client->dev)) 1065 if (device_may_wakeup(&client->dev))
1065 enable_irq_wake(client->irq); 1066 enable_irq_wake(client->irq);
1066 1067
@@ -1075,6 +1076,7 @@ static int i2c_hid_resume(struct device *dev)
1075 int ret; 1076 int ret;
1076 struct i2c_client *client = to_i2c_client(dev); 1077 struct i2c_client *client = to_i2c_client(dev);
1077 1078
1079 enable_irq(client->irq);
1078 ret = i2c_hid_hwreset(client); 1080 ret = i2c_hid_hwreset(client);
1079 if (ret) 1081 if (ret)
1080 return ret; 1082 return ret;