ASoC: wm8994: Restore AIFnCLK after reducing it for low clock rates
This helps to ensure a smooth startup when we restore. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Родитель
3cf956eebe
Коммит
d3725761ee
|
@ -2268,10 +2268,26 @@ out:
|
|||
*/
|
||||
if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) {
|
||||
dev_dbg(codec->dev, "Configuring AIFs for 128fs\n");
|
||||
|
||||
wm8994->aifdiv[0] = snd_soc_read(codec, WM8994_AIF1_RATE)
|
||||
& WM8994_AIF1CLK_RATE_MASK;
|
||||
wm8994->aifdiv[1] = snd_soc_read(codec, WM8994_AIF2_RATE)
|
||||
& WM8994_AIF1CLK_RATE_MASK;
|
||||
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_RATE,
|
||||
WM8994_AIF1CLK_RATE_MASK, 0x1);
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_RATE,
|
||||
WM8994_AIF2CLK_RATE_MASK, 0x1);
|
||||
} else if (wm8994->aifdiv[0]) {
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_RATE,
|
||||
WM8994_AIF1CLK_RATE_MASK,
|
||||
wm8994->aifdiv[0]);
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_RATE,
|
||||
WM8994_AIF2CLK_RATE_MASK,
|
||||
wm8994->aifdiv[1]);
|
||||
|
||||
wm8994->aifdiv[0] = 0;
|
||||
wm8994->aifdiv[1] = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -2368,10 +2384,26 @@ static int wm8994_set_dai_sysclk(struct snd_soc_dai *dai,
|
|||
*/
|
||||
if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) {
|
||||
dev_dbg(codec->dev, "Configuring AIFs for 128fs\n");
|
||||
|
||||
wm8994->aifdiv[0] = snd_soc_read(codec, WM8994_AIF1_RATE)
|
||||
& WM8994_AIF1CLK_RATE_MASK;
|
||||
wm8994->aifdiv[1] = snd_soc_read(codec, WM8994_AIF2_RATE)
|
||||
& WM8994_AIF1CLK_RATE_MASK;
|
||||
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_RATE,
|
||||
WM8994_AIF1CLK_RATE_MASK, 0x1);
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_RATE,
|
||||
WM8994_AIF2CLK_RATE_MASK, 0x1);
|
||||
} else if (wm8994->aifdiv[0]) {
|
||||
snd_soc_update_bits(codec, WM8994_AIF1_RATE,
|
||||
WM8994_AIF1CLK_RATE_MASK,
|
||||
wm8994->aifdiv[0]);
|
||||
snd_soc_update_bits(codec, WM8994_AIF2_RATE,
|
||||
WM8994_AIF2CLK_RATE_MASK,
|
||||
wm8994->aifdiv[1]);
|
||||
|
||||
wm8994->aifdiv[0] = 0;
|
||||
wm8994->aifdiv[1] = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -79,6 +79,7 @@ struct wm8994_priv {
|
|||
int sysclk_rate[2];
|
||||
int mclk[2];
|
||||
int aifclk[2];
|
||||
int aifdiv[2];
|
||||
int channels[2];
|
||||
struct wm8994_fll_config fll[2], fll_suspend[2];
|
||||
struct completion fll_locked[2];
|
||||
|
|
Загрузка…
Ссылка в новой задаче