Commit eada5317 authored by lamikr's avatar lamikr Committed by Tony Lindgren

[PATCH 2/3] aic23: omap-alsa-aic23.c clockrate config fix

Do not try to change the clockrate if it is already ok. This fixes the
driver for omap-innovator which uses fixed clockrate.
Signed-off-by: default avatarMika Laitio <lamikr@cc.jyu.fi>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 5a6a390b
...@@ -212,6 +212,8 @@ void aic23_clock_setup(void) ...@@ -212,6 +212,8 @@ void aic23_clock_setup(void)
*/ */
int aic23_clock_on(void) int aic23_clock_on(void)
{ {
uint curRate;
if (clk_get_usecount(aic23_mclk) > 0) { if (clk_get_usecount(aic23_mclk) > 0) {
/* MCLK is already in use */ /* MCLK is already in use */
printk(KERN_WARNING printk(KERN_WARNING
...@@ -219,13 +221,14 @@ int aic23_clock_on(void) ...@@ -219,13 +221,14 @@ int aic23_clock_on(void)
(uint) clk_get_rate(aic23_mclk), (uint) clk_get_rate(aic23_mclk),
CODEC_CLOCK); CODEC_CLOCK);
} }
curRate = (uint)clk_get_rate(aic23_mclk);
if (curRate != CODEC_CLOCK) {
if (clk_set_rate(aic23_mclk, CODEC_CLOCK)) { if (clk_set_rate(aic23_mclk, CODEC_CLOCK)) {
printk(KERN_ERR printk(KERN_ERR
"Cannot set MCLK for AIC23 CODEC\n"); "Cannot set MCLK for AIC23 CODEC\n");
return -ECANCELED; return -ECANCELED;
} }
}
clk_enable(aic23_mclk); clk_enable(aic23_mclk);
printk(KERN_DEBUG printk(KERN_DEBUG
...@@ -239,6 +242,7 @@ int aic23_clock_on(void) ...@@ -239,6 +242,7 @@ int aic23_clock_on(void)
~ADC_OFF & ~MIC_OFF & ~LINE_OFF); ~ADC_OFF & ~MIC_OFF & ~LINE_OFF);
return 0; return 0;
} }
/* /*
* Do some sanity check, turn clock off and then turn * Do some sanity check, turn clock off and then turn
* codec audio off * codec audio off
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment