summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorChaitanya Bandi <bandik@nvidia.com>2012-12-26 16:54:08 +0530
committerVarun Colbert <vcolbert@nvidia.com>2012-12-28 14:12:17 -0800
commitda257c5ca7e9e3b28bbfaeb80e496ff278c28e1b (patch)
tree496162ff03374ace1b5222454e04710b325f06c0 /drivers/mfd
parent4ae54b397651e41a4ed3d079ef1b5c689e2c6494 (diff)
mfd: tps6591x: Use dev_pm_ops for suspend/resume
Modified suspend/resume of tps6591x to use dev_pm_ops instead of using I2C client driver's suspend/resume. Bug 1166544 Change-Id: Ibf548c4cbe35ff318e8cb8719f6f289434c04a5c Signed-off-by: Chaitanya Bandi <bandik@nvidia.com> Reviewed-on: http://git-master/r/174272 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/tps6591x.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/mfd/tps6591x.c b/drivers/mfd/tps6591x.c
index c6c4231857e7..a2d8b05749a4 100644
--- a/drivers/mfd/tps6591x.c
+++ b/drivers/mfd/tps6591x.c
@@ -925,22 +925,28 @@ static int __devexit tps6591x_i2c_remove(struct i2c_client *client)
return 0;
}
#ifdef CONFIG_PM
-static int tps6591x_i2c_suspend(struct i2c_client *client, pm_message_t state)
+static int tps6591x_i2c_suspend(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
if (client->irq)
disable_irq(client->irq);
return 0;
}
-static int tps6591x_i2c_resume(struct i2c_client *client)
+static int tps6591x_i2c_resume(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
if (client->irq)
enable_irq(client->irq);
return 0;
}
-#endif
+static const struct dev_pm_ops tps6591x_pm_ops = {
+ .suspend = tps6591x_i2c_suspend,
+ .resume = tps6591x_i2c_resume,
+};
+#endif
static const struct i2c_device_id tps6591x_id_table[] = {
{ "tps6591x", 0 },
{ },
@@ -951,13 +957,12 @@ static struct i2c_driver tps6591x_driver = {
.driver = {
.name = "tps6591x",
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &tps6591x_pm_ops,
+#endif
},
.probe = tps6591x_i2c_probe,
.remove = __devexit_p(tps6591x_i2c_remove),
-#ifdef CONFIG_PM
- .suspend = tps6591x_i2c_suspend,
- .resume = tps6591x_i2c_resume,
-#endif
.id_table = tps6591x_id_table,
};