diff options
-rw-r--r-- | drivers/mfd/twl4030-core.c | 9 | ||||
-rw-r--r-- | include/linux/i2c/twl4030.h | 5 |
2 files changed, 12 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 | ||
698 | static void clocks_init(struct device *dev) | 699 | static 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) |
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index 8a4a58ff8dad..0c84cfa059e9 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -313,6 +313,10 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); | |||
313 | 313 | ||
314 | /*----------------------------------------------------------------------*/ | 314 | /*----------------------------------------------------------------------*/ |
315 | 315 | ||
316 | struct twl4030_clock_init_data { | ||
317 | bool ck32k_lowpwr_enable; | ||
318 | }; | ||
319 | |||
316 | struct twl4030_bci_platform_data { | 320 | struct twl4030_bci_platform_data { |
317 | int *battery_tmp_tbl; | 321 | int *battery_tmp_tbl; |
318 | unsigned int tblsize; | 322 | unsigned int tblsize; |
@@ -425,6 +429,7 @@ struct twl4030_codec_data { | |||
425 | 429 | ||
426 | struct twl4030_platform_data { | 430 | struct twl4030_platform_data { |
427 | unsigned irq_base, irq_end; | 431 | unsigned irq_base, irq_end; |
432 | struct twl4030_clock_init_data *clock; | ||
428 | struct twl4030_bci_platform_data *bci; | 433 | struct twl4030_bci_platform_data *bci; |
429 | struct twl4030_gpio_platform_data *gpio; | 434 | struct twl4030_gpio_platform_data *gpio; |
430 | struct twl4030_madc_platform_data *madc; | 435 | struct twl4030_madc_platform_data *madc; |