[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1284526854-32298-1-git-send-email-sundar.iyer@stericsson.com>
Date: Wed, 15 Sep 2010 10:30:54 +0530
From: Sundar Iyer <sundar.iyer@...ricsson.com>
To: <sameo@...ux.intel.com>
Cc: <linux-kernel@...r.kernel.org>,
Sundar Iyer <sundar.iyer@...ricsson.com>,
Rabin VINCENT <rabin.vincent@...ricsson.com>,
Linus WALLEIJ <linus.walleij@...ricsson.com>
Subject: [PATCH] mfd-stmpe: Add PM support to STMPE devices
Add PM helpers to STMPE and add support to enable wakeup from low power
states
Acked-by: Rabin VINCENT <rabin.vincent@...ricsson.com>
Acked-by: Linus WALLEIJ <linus.walleij@...ricsson.com>
Signed-off-by: Sundar Iyer <sundar.iyer@...ricsson.com>
---
drivers/mfd/stmpe.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 0754c5e9..b11487f 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -873,6 +873,28 @@ static int __devinit stmpe_devices_init(struct stmpe *stmpe)
return ret;
}
+#ifdef CONFIG_PM
+static int stmpe_suspend(struct device *dev)
+{
+ struct i2c_client *i2c = to_i2c_client(dev);
+
+ if (device_may_wakeup(&i2c->dev))
+ enable_irq_wake(i2c->irq);
+
+ return 0;
+}
+
+static int stmpe_resume(struct device *dev)
+{
+ struct i2c_client *i2c = to_i2c_client(dev);
+
+ if (device_may_wakeup(&i2c->dev))
+ disable_irq_wake(i2c->irq);
+
+ return 0;
+}
+#endif
+
static int __devinit stmpe_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -960,9 +982,19 @@ static const struct i2c_device_id stmpe_id[] = {
};
MODULE_DEVICE_TABLE(i2c, stmpe_id);
+#ifdef CONFIG_PM
+static const struct dev_pm_ops stmpe_dev_pm_ops = {
+ .suspend = stmpe_suspend,
+ .resume = stmpe_resume,
+};
+#endif
+
static struct i2c_driver stmpe_driver = {
.driver.name = "stmpe",
.driver.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .driver.pm = &stmpe_dev_pm_ops,
+#endif
.probe = stmpe_probe,
.remove = __devexit_p(stmpe_remove),
.id_table = stmpe_id,
--
1.7.2.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists