diff options
author | Ashish Chavan <ashish.chavan@kpitcummins.com> | 2012-05-03 09:57:52 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-03 13:53:52 -0400 |
commit | 3cb81651d070edfbea83eef763c3ca3c6f3848fd (patch) | |
tree | d9c5d779560af87d8f2f2194ec17a963ea471aec | |
parent | 9b5231247c7aea3e56b6d28fa3e068e17ffc61da (diff) |
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: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/da7210.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 10f52ff14daa..af5db7080519 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c | |||
@@ -850,8 +850,19 @@ static int da7210_hw_params(struct snd_pcm_substream *substream, | |||
850 | if (da7210->mclk_rate && (da7210->mclk_rate != sysclk)) { | 850 | if (da7210->mclk_rate && (da7210->mclk_rate != sysclk)) { |
851 | /* PLL mode, disable PLL bypass */ | 851 | /* PLL mode, disable PLL bypass */ |
852 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, 0); | 852 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, 0); |
853 | |||
854 | if (!da7210->master) { | ||
855 | /* PLL slave mode, also enable SRM */ | ||
856 | snd_soc_update_bits(codec, DA7210_PLL, | ||
857 | (DA7210_MCLK_SRM_EN | | ||
858 | DA7210_MCLK_DET_EN), | ||
859 | (DA7210_MCLK_SRM_EN | | ||
860 | DA7210_MCLK_DET_EN)); | ||
861 | } | ||
853 | } else { | 862 | } else { |
854 | /* PLL bypass mode, enable PLL bypass */ | 863 | /* PLL bypass mode, enable PLL bypass and Auto Detection */ |
864 | snd_soc_update_bits(codec, DA7210_PLL, DA7210_MCLK_DET_EN, | ||
865 | DA7210_MCLK_DET_EN); | ||
855 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, | 866 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, DA7210_PLL_BYP, |
856 | DA7210_PLL_BYP); | 867 | DA7210_PLL_BYP); |
857 | } | 868 | } |
@@ -1014,18 +1025,9 @@ static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, | |||
1014 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, | 1025 | snd_soc_update_bits(codec, DA7210_PLL_DIV3, |
1015 | DA7210_PLL_DIV_L_MASK, pll_div3); | 1026 | DA7210_PLL_DIV_L_MASK, pll_div3); |
1016 | 1027 | ||
1017 | if (da7210->master) { | 1028 | /* Enable PLL */ |
1018 | /* In master mode, no need to enable SRM */ | 1029 | snd_soc_update_bits(codec, DA7210_PLL, DA7210_PLL_EN, DA7210_PLL_EN); |
1019 | snd_soc_update_bits(codec, DA7210_PLL, DA7210_PLL_EN, | 1030 | |
1020 | DA7210_PLL_EN); | ||
1021 | } else { | ||
1022 | /* In slave mode, enable SRM and PLL */ | ||
1023 | snd_soc_update_bits(codec, DA7210_PLL, | ||
1024 | (DA7210_PLL_EN | DA7210_MCLK_SRM_EN | | ||
1025 | DA7210_MCLK_DET_EN), | ||
1026 | (DA7210_PLL_EN | DA7210_MCLK_SRM_EN | | ||
1027 | DA7210_MCLK_DET_EN)); | ||
1028 | } | ||
1029 | /* Enable active mode */ | 1031 | /* Enable active mode */ |
1030 | snd_soc_update_bits(codec, DA7210_STARTUP1, DA7210_SC_MST_EN, | 1032 | snd_soc_update_bits(codec, DA7210_STARTUP1, DA7210_SC_MST_EN, |
1031 | DA7210_SC_MST_EN); | 1033 | DA7210_SC_MST_EN); |