*/
int aic23_clock_on(void)
{
+ uint curRate;
+
if (clk_get_usecount(aic23_mclk) > 0) {
/* MCLK is already in use */
printk(KERN_WARNING
(uint) clk_get_rate(aic23_mclk),
CODEC_CLOCK);
}
-
- if (clk_set_rate(aic23_mclk, CODEC_CLOCK)) {
- printk(KERN_ERR
- "Cannot set MCLK for AIC23 CODEC\n");
- return -ECANCELED;
+ curRate = (uint)clk_get_rate(aic23_mclk);
+ if (curRate != CODEC_CLOCK) {
+ if (clk_set_rate(aic23_mclk, CODEC_CLOCK)) {
+ printk(KERN_ERR
+ "Cannot set MCLK for AIC23 CODEC\n");
+ return -ECANCELED;
+ }
}
-
clk_enable(aic23_mclk);
printk(KERN_DEBUG
~ADC_OFF & ~MIC_OFF & ~LINE_OFF);
return 0;
}
+
/*
* Do some sanity check, turn clock off and then turn
* codec audio off