diff options
author | Amit Kucheria <amit.kucheria@verdurent.com> | 2009-08-31 12:32:18 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2009-09-17 03:47:22 -0400 |
commit | ebf0bd366ed8161e6fbc919705d878ccbfd51624 (patch) | |
tree | e6425ad580bdc6a4bc34163dcde3f08b6deb7474 /drivers/mfd/twl4030-core.c | |
parent | 12992dd89c84839167f97aae540f2ec889daf782 (diff) |
mfd: Add support for TWL4030/5030 dynamic power switching
The TWL4030/5030 family of multifunction devices allows board-specific
control of the the various regulators, clock and reset lines through
'scripts' that are loaded into its memory. This allows for Dynamic Power
Switching (DPS).
Implement board-independent core support for DPS that is then used by
board-specific code to load custom DPS scripts.
Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl4030-core.c')
-rw-r--r-- | drivers/mfd/twl4030-core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index 1fd2620819d0..e424cf6d8e9e 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c | |||
@@ -89,6 +89,12 @@ | |||
89 | #define twl_has_madc() false | 89 | #define twl_has_madc() false |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | #ifdef CONFIG_TWL4030_POWER | ||
93 | #define twl_has_power() true | ||
94 | #else | ||
95 | #define twl_has_power() false | ||
96 | #endif | ||
97 | |||
92 | #if defined(CONFIG_RTC_DRV_TWL4030) || defined(CONFIG_RTC_DRV_TWL4030_MODULE) | 98 | #if defined(CONFIG_RTC_DRV_TWL4030) || defined(CONFIG_RTC_DRV_TWL4030_MODULE) |
93 | #define twl_has_rtc() true | 99 | #define twl_has_rtc() true |
94 | #else | 100 | #else |
@@ -801,6 +807,10 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
801 | /* setup clock framework */ | 807 | /* setup clock framework */ |
802 | clocks_init(&client->dev); | 808 | clocks_init(&client->dev); |
803 | 809 | ||
810 | /* load power event scripts */ | ||
811 | if (twl_has_power() && pdata->power) | ||
812 | twl4030_power_init(pdata->power); | ||
813 | |||
804 | /* Maybe init the T2 Interrupt subsystem */ | 814 | /* Maybe init the T2 Interrupt subsystem */ |
805 | if (client->irq | 815 | if (client->irq |
806 | && pdata->irq_base | 816 | && pdata->irq_base |