Commit 3cb81651 authored by Ashish Chavan's avatar Ashish Chavan Committed by Mark Brown

ASoC: da7210: Minor improvements and a bugfix

This patch improves playback quality for few sample rates like 8000 and
11025 Hz.

This also fixes an issue observed during testing of pll slave mode. Due
to the issue, on some rare occasions there was no sound output for first
time playback after system boot, though all subsequent playbacks were
fine. It was mainly because of the sequence in which SRM bit was
enabled.
Signed-off-by: default avatarAshish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: default avatarDavid Dajun Chen <dchen@diasemi.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9b523124
...@@ -850,8 +850,19 @@ static int da7210_hw_params(struct snd_pcm_substream *substream, ...@@ -850,8 +850,19 @@ static int da7210_hw_params(struct snd_pcm_substream *substream,
if (da7210->mclk_rate && (da7210->mclk_rate != sysclk)) { if (da7210->mclk_rate && (da7210->mclk_rate != sysclk)) {
/* PLL mode, disable PLL bypass */ /* PLL mode, disable PLL bypass */
snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, 0); snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, 0);
if (!da7210->master) {
/* PLL slave mode, also enable SRM */
snd_soc_update_bits(codec, DA7210_PLL,
(DA7210_MCLK_SRM_EN |
DA7210_MCLK_DET_EN),
(DA7210_MCLK_SRM_EN |
DA7210_MCLK_DET_EN));
}
} else { } else {
/* PLL bypass mode, enable PLL bypass */ /* PLL bypass mode, enable PLL bypass and Auto Detection */
snd_soc_update_bits(codec, DA7210_PLL, DA7210_MCLK_DET_EN,
DA7210_MCLK_DET_EN);
snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP,
DA7210_PLL_BYP); DA7210_PLL_BYP);
} }
...@@ -1014,18 +1025,9 @@ static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, ...@@ -1014,18 +1025,9 @@ static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
snd_soc_update_bits(codec, DA7210_PLL_DIV3, snd_soc_update_bits(codec, DA7210_PLL_DIV3,
DA7210_PLL_DIV_L_MASK, pll_div3); DA7210_PLL_DIV_L_MASK, pll_div3);
if (da7210->master) { /* Enable PLL */
/* In master mode, no need to enable SRM */ snd_soc_update_bits(codec, DA7210_PLL, DA7210_PLL_EN, DA7210_PLL_EN);
snd_soc_update_bits(codec, DA7210_PLL, DA7210_PLL_EN,
DA7210_PLL_EN);
} else {
/* In slave mode, enable SRM and PLL */
snd_soc_update_bits(codec, DA7210_PLL,
(DA7210_PLL_EN | DA7210_MCLK_SRM_EN |
DA7210_MCLK_DET_EN),
(DA7210_PLL_EN | DA7210_MCLK_SRM_EN |
DA7210_MCLK_DET_EN));
}
/* Enable active mode */ /* Enable active mode */
snd_soc_update_bits(codec, DA7210_STARTUP1, DA7210_SC_MST_EN, snd_soc_update_bits(codec, DA7210_STARTUP1, DA7210_SC_MST_EN,
DA7210_SC_MST_EN); DA7210_SC_MST_EN);
......
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