summaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/qt1070.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-09-06 20:23:44 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-09-06 20:23:44 -0700
commit07176b988ebb20f46a317a60ee1d983fe1630203 (patch)
treee54affb1f823742078c68d9506e6035016bc2ea4 /drivers/input/keyboard/qt1070.c
parentfa46c7984092f3dbdbb3bcd7338d81a1168d9d2b (diff)
parent52764fed5049655926bcecaefd52f0a415ceb105 (diff)
downloadop-kernel-dev-07176b988ebb20f46a317a60ee1d983fe1630203.zip
op-kernel-dev-07176b988ebb20f46a317a60ee1d983fe1630203.tar.gz
Merge branch 'next' into for-linus
Merge first round of changes for 3.12 merge window.
Diffstat (limited to 'drivers/input/keyboard/qt1070.c')
-rw-r--r--drivers/input/keyboard/qt1070.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index 42b773b..6c561ec 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -243,6 +243,32 @@ static int qt1070_remove(struct i2c_client *client)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int qt1070_suspend(struct device *dev)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct qt1070_data *data = i2c_get_clientdata(client);
+
+ if (device_may_wakeup(dev))
+ enable_irq_wake(data->irq);
+
+ return 0;
+}
+
+static int qt1070_resume(struct device *dev)
+{
+ struct i2c_client *client = to_i2c_client(dev);
+ struct qt1070_data *data = i2c_get_clientdata(client);
+
+ if (device_may_wakeup(dev))
+ disable_irq_wake(data->irq);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(qt1070_pm_ops, qt1070_suspend, qt1070_resume);
+
static const struct i2c_device_id qt1070_id[] = {
{ "qt1070", 0 },
{ },
@@ -253,6 +279,7 @@ static struct i2c_driver qt1070_driver = {
.driver = {
.name = "qt1070",
.owner = THIS_MODULE,
+ .pm = &qt1070_pm_ops,
},
.id_table = qt1070_id,
.probe = qt1070_probe,
OpenPOWER on IntegriCloud