aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2011-07-13 18:30:49 -0700
committerZiyann <jaraidaniel@gmail.com>2014-10-01 13:00:11 +0200
commitdd200658bfa9157a4936c0496aecfcbb2a773fdb (patch)
treeb22972bfcfd7861dc4e51af0aca557a1b7d2ecb6 /drivers/mfd
parentf40423c4b2a10a9eea8372a506356c5ae11e2014 (diff)
downloadkernel_samsung_tuna-dd200658bfa9157a4936c0496aecfcbb2a773fdb.tar.gz
kernel_samsung_tuna-dd200658bfa9157a4936c0496aecfcbb2a773fdb.tar.bz2
kernel_samsung_tuna-dd200658bfa9157a4936c0496aecfcbb2a773fdb.zip
mfd: twl: Register suspend/resume hooks for IRQ wakeup capability.
TWL40XX and TWL60XX devices has an interrupt line which is connected to application processor like OMAP. Since these devices supports many features like MMC card detect, USB cable detect, RTC interrupt etc which needs to wakeup application processor on these events. So provide the i2c client driver suspend hooks so that wakeup capability can be enabled on these events using the common IRQ line. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl-core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 9ab40b5921a..223112fe906 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -33,6 +33,7 @@
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/err.h>
+#include <linux/interrupt.h>
#include <linux/regulator/machine.h>
@@ -1247,6 +1248,21 @@ int twl4030_init_chip_irq(const char *chip);
int twl6030_init_irq(int irq_num, unsigned irq_base, unsigned irq_end);
int twl6030_exit_irq(void);
+#ifdef CONFIG_PM
+static int twl_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ return irq_set_irq_wake(client->irq, 1);
+}
+
+static int twl_resume(struct i2c_client *client)
+{
+ return irq_set_irq_wake(client->irq, 0);
+}
+#else
+#define twl_suspend NULL
+#define twl_resume NULL
+#endif
+
static int twl_remove(struct i2c_client *client)
{
unsigned i;
@@ -1402,6 +1418,8 @@ static struct i2c_driver twl_driver = {
.id_table = twl_ids,
.probe = twl_probe,
.remove = twl_remove,
+ .suspend = twl_suspend,
+ .resume = twl_resume,
};
static int __init twl_init(void)