aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2012-04-17 03:30:24 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-01 07:33:04 -0400
commit7e82d6ff5d2c5e35d1fcb8c673287f7d780a13bb (patch)
treed91130cc52f6c42a3a3d593c1fffd4495de91ee0 /drivers/mfd
parent44f72e53382c9c673fd54c3bab67a6b9a2d4526e (diff)
mfd: Handle the ab8500 irq for suspend/resume
Ensure that the AB interrupt is only handled at a time when all core drivers are resumed. Ensure that the AB interrupt is marked as a wakeup interrupt. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com> Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ab8500-i2c.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/mfd/ab8500-i2c.c b/drivers/mfd/ab8500-i2c.c
index b83045f102be..89b31a3409cd 100644
--- a/drivers/mfd/ab8500-i2c.c
+++ b/drivers/mfd/ab8500-i2c.c
@@ -101,10 +101,42 @@ static const struct platform_device_id ab8500_id[] = {
101 { } 101 { }
102}; 102};
103 103
104#ifdef CONFIG_PM
105static int ab8500_i2c_suspend(struct device *dev)
106{
107 struct ab8500 *ab = dev_get_drvdata(dev);
108
109 disable_irq(ab->irq);
110 enable_irq_wake(ab->irq);
111
112 return 0;
113}
114
115static int ab8500_i2c_resume(struct device *dev)
116{
117 struct ab8500 *ab = dev_get_drvdata(dev);
118
119 disable_irq_wake(ab->irq);
120 enable_irq(ab->irq);
121
122 return 0;
123}
124
125static const struct dev_pm_ops ab8500_i2c_pm_ops = {
126 .suspend = ab8500_i2c_suspend,
127 .resume = ab8500_i2c_resume,
128};
129
130#define AB8500_I2C_PM_OPS (&ab8500_i2c_pm_ops)
131#else
132#define AB8500_I2C_PM_OPS NULL
133#endif
134
104static struct platform_driver ab8500_i2c_driver = { 135static struct platform_driver ab8500_i2c_driver = {
105 .driver = { 136 .driver = {
106 .name = "ab8500-i2c", 137 .name = "ab8500-i2c",
107 .owner = THIS_MODULE, 138 .owner = THIS_MODULE,
139 .pm = AB8500_I2C_PM_OPS,
108 }, 140 },
109 .probe = ab8500_i2c_probe, 141 .probe = ab8500_i2c_probe,
110 .remove = __devexit_p(ab8500_i2c_remove), 142 .remove = __devexit_p(ab8500_i2c_remove),