aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-core.c
diff options
context:
space:
mode:
authorIlkka Koskinen <ilkka.koskinen@nokia.com>2009-10-22 07:14:09 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 13:21:33 -0500
commit38a684963f619eb9117cb898b92bde92cdd09127 (patch)
tree11165f43948f3406110e5135c0479b244cc662fd /drivers/mfd/twl4030-core.c
parent75b75722b4eb1032b3fe2e56b7015f23c6080529 (diff)
mfd: Enable twl4030 32kHz oscillator low-power mode
Allows TWL's 32kHz oscillator to go in low-power mode when main battery voltage is running low. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index e3abbf66cc5c..90a38e43c313 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -183,6 +183,7 @@
183#define HFCLK_FREQ_26_MHZ (2 << 0) 183#define HFCLK_FREQ_26_MHZ (2 << 0)
184#define HFCLK_FREQ_38p4_MHZ (3 << 0) 184#define HFCLK_FREQ_38p4_MHZ (3 << 0)
185#define HIGH_PERF_SQ (1 << 3) 185#define HIGH_PERF_SQ (1 << 3)
186#define CK32K_LOWPWR_EN (1 << 7)
186 187
187 188
188/* chip-specific feature flags, for i2c_device_id.driver_data */ 189/* chip-specific feature flags, for i2c_device_id.driver_data */
@@ -695,7 +696,8 @@ static inline int __init unprotect_pm_master(void)
695 return e; 696 return e;
696} 697}
697 698
698static void clocks_init(struct device *dev) 699static void clocks_init(struct device *dev,
700 struct twl4030_clock_init_data *clock)
699{ 701{
700 int e = 0; 702 int e = 0;
701 struct clk *osc; 703 struct clk *osc;
@@ -742,6 +744,9 @@ static void clocks_init(struct device *dev)
742 } 744 }
743 745
744 ctrl |= HIGH_PERF_SQ; 746 ctrl |= HIGH_PERF_SQ;
747 if (clock && clock->ck32k_lowpwr_enable)
748 ctrl |= CK32K_LOWPWR_EN;
749
745 e |= unprotect_pm_master(); 750 e |= unprotect_pm_master();
746 /* effect->MADC+USB ck en */ 751 /* effect->MADC+USB ck en */
747 e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT); 752 e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
@@ -820,7 +825,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
820 inuse = true; 825 inuse = true;
821 826
822 /* setup clock framework */ 827 /* setup clock framework */
823 clocks_init(&client->dev); 828 clocks_init(&client->dev, pdata->clock);
824 829
825 /* load power event scripts */ 830 /* load power event scripts */
826 if (twl_has_power() && pdata->power) 831 if (twl_has_power() && pdata->power)