summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-03-10 19:25:22 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:53:29 -0700
commitd6ffa72fa39ed2911b568eaed35fdb9881be651a (patch)
tree39bc1664b61c97b64333aa97e4fb115b5a7e55d3 /drivers/mfd
parentdce9a2554a02c53c3ede93f9e2254a3ae2cddbe9 (diff)
mfd: tps6591x: add suspend/resume handlers
If the system is woken by an tps interrupt to AP, tps' irq handler gets called and it tries to communicate on i2c. i2c adapters resume later which causes communication failures in tps' irq handler. the right way is to disable tps' irq ion AP while suspending in order to avoid such i2c communication failures. tps interrupt will still b able to wake AP from suspend. Original-Change-Id: I29c83aa80e2662793c5e9b278ad1b7efd46616be Reviewed-on: http://git-master/r/22410 Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Change-Id: Ie917b0b617bf9c0c90bfce15948340e2393ed0ce
Diffstat (limited to 'drivers/mfd')
-rwxr-xr-xdrivers/mfd/tps6591x.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/mfd/tps6591x.c b/drivers/mfd/tps6591x.c
index d19e94f0809e..0b0c39e83ce1 100755
--- a/drivers/mfd/tps6591x.c
+++ b/drivers/mfd/tps6591x.c
@@ -275,7 +275,7 @@ static int tps6591x_gpio_get(struct gpio_chip *gc, unsigned offset)
}
static void tps6591x_gpio_set(struct gpio_chip *chip, unsigned offset,
- int value)
+ int value)
{
struct tps6591x *tps6591x = container_of(chip, struct tps6591x, gpio);
@@ -423,7 +423,7 @@ static irqreturn_t tps6591x_irq(int irq, void *data)
}
static int __devinit tps6591x_irq_init(struct tps6591x *tps6591x, int irq,
- int irq_base)
+ int irq_base)
{
int i, ret;
@@ -569,6 +569,22 @@ 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)
+{
+ if (client->irq)
+ disable_irq(client->irq);
+ return 0;
+}
+
+static int tps6591x_i2c_resume(struct i2c_client *client)
+{
+ if (client->irq)
+ enable_irq(client->irq);
+ return 0;
+}
+#endif
+
static const struct i2c_device_id tps6591x_id_table[] = {
{ "tps6591x", 0 },
@@ -583,6 +599,10 @@ static struct i2c_driver tps6591x_driver = {
},
.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,
};