aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-01-14 14:58:43 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2012-02-03 13:03:44 -0500
commitf8447d6c213273b444c81eaa2449f55510229d4f (patch)
treeb5d7bcb01c892cfdf2b00215e12d2ad10b1d4003
parent62aa2b537c6f5957afd98e29f96897419ed5ebab (diff)
mfd: Store twl6040-codec mclk configuration
Store the last used mclk configuration for the PLL. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/twl6040-core.c3
-rw-r--r--include/linux/mfd/twl6040.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index dda86293dc9..c2088f4c454 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -282,6 +282,7 @@ int twl6040_power(struct twl6040 *twl6040, int on)
282 /* Default PLL configuration after power up */ 282 /* Default PLL configuration after power up */
283 twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL; 283 twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;
284 twl6040->sysclk = 19200000; 284 twl6040->sysclk = 19200000;
285 twl6040->mclk = 32768;
285 } else { 286 } else {
286 /* already powered-down */ 287 /* already powered-down */
287 if (!twl6040->power_count) { 288 if (!twl6040->power_count) {
@@ -305,6 +306,7 @@ int twl6040_power(struct twl6040 *twl6040, int on)
305 twl6040_power_down(twl6040); 306 twl6040_power_down(twl6040);
306 } 307 }
307 twl6040->sysclk = 0; 308 twl6040->sysclk = 0;
309 twl6040->mclk = 0;
308 } 310 }
309 311
310out: 312out:
@@ -421,6 +423,7 @@ int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
421 } 423 }
422 424
423 twl6040->sysclk = freq_out; 425 twl6040->sysclk = freq_out;
426 twl6040->mclk = freq_in;
424 twl6040->pll = pll_id; 427 twl6040->pll = pll_id;
425 428
426pll_out: 429pll_out:
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 2463c261959..9bc9ac651da 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -187,8 +187,10 @@ struct twl6040 {
187 int rev; 187 int rev;
188 u8 vibra_ctrl_cache[2]; 188 u8 vibra_ctrl_cache[2];
189 189
190 /* PLL configuration */
190 int pll; 191 int pll;
191 unsigned int sysclk; 192 unsigned int sysclk;
193 unsigned int mclk;
192 194
193 unsigned int irq; 195 unsigned int irq;
194 unsigned int irq_base; 196 unsigned int irq_base;