Merge remote-tracking branch 'asoc/topic/wm8993' into asoc-next
This commit is contained in:
commit
699ba4546c
|
@ -851,19 +851,20 @@ static int wm8983_set_pll(struct snd_soc_dai *dai, int pll_id,
|
|||
struct pll_div pll_div;
|
||||
|
||||
codec = dai->codec;
|
||||
if (freq_in && freq_out) {
|
||||
if (!freq_in || !freq_out) {
|
||||
/* disable the PLL */
|
||||
snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
|
||||
WM8983_PLLEN_MASK, 0);
|
||||
return 0;
|
||||
} else {
|
||||
ret = pll_factors(&pll_div, freq_out * 4 * 2, freq_in);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* disable the PLL before re-programming it */
|
||||
snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
|
||||
WM8983_PLLEN_MASK, 0);
|
||||
|
||||
if (!freq_in || !freq_out)
|
||||
return 0;
|
||||
|
||||
/* set PLLN and PRESCALE */
|
||||
snd_soc_write(codec, WM8983_PLL_N,
|
||||
(pll_div.div2 << WM8983_PLL_PRESCALE_SHIFT)
|
||||
|
@ -875,6 +876,8 @@ static int wm8983_set_pll(struct snd_soc_dai *dai, int pll_id,
|
|||
/* enable the PLL */
|
||||
snd_soc_update_bits(codec, WM8983_POWER_MANAGEMENT_1,
|
||||
WM8983_PLLEN_MASK, WM8983_PLLEN);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue