Skip to content

Commit

Permalink
mfd: Store twl6040-codec mclk configuration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Samuel Ortiz committed Feb 3, 2012
1 parent 62aa2b5 commit f8447d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mfd/twl6040-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ int twl6040_power(struct twl6040 *twl6040, int on)
/* Default PLL configuration after power up */
twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;
twl6040->sysclk = 19200000;
twl6040->mclk = 32768;
} else {
/* already powered-down */
if (!twl6040->power_count) {
Expand All @@ -305,6 +306,7 @@ int twl6040_power(struct twl6040 *twl6040, int on)
twl6040_power_down(twl6040);
}
twl6040->sysclk = 0;
twl6040->mclk = 0;
}

out:
Expand Down Expand Up @@ -421,6 +423,7 @@ int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
}

twl6040->sysclk = freq_out;
twl6040->mclk = freq_in;
twl6040->pll = pll_id;

pll_out:
Expand Down
2 changes: 2 additions & 0 deletions include/linux/mfd/twl6040.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ struct twl6040 {
int rev;
u8 vibra_ctrl_cache[2];

/* PLL configuration */
int pll;
unsigned int sysclk;
unsigned int mclk;

unsigned int irq;
unsigned int irq_base;
Expand Down

0 comments on commit f8447d6

Please sign in to comment.