ASoC: WCD9310: Fix sequence for clock source change
For scenarios that need changing the clock source to the codec,
the sequence for switching the clock source was not done
correctly, causing the wrong clock to be selected.
If the correct clock is not selected, it is possible that playback
of audio might cause codec overflow issues due to mismatch in
rate at which the codec can consume data and rate at which data is
made availabe to the codec.
Fix the sequence for switching the clock source, this avoids
possible overflow issue during audio playback.
CRs-fixed: 329223
Change-Id: I410a4dd65cc236c28b788bc5b02db5237157ea6b
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
diff --git a/sound/soc/codecs/wcd9310.c b/sound/soc/codecs/wcd9310.c
index cec01f1..8de9dec 100644
--- a/sound/soc/codecs/wcd9310.c
+++ b/sound/soc/codecs/wcd9310.c
@@ -2640,6 +2640,7 @@
{
struct tabla_priv *tabla = snd_soc_codec_get_drvdata(codec);
+ pr_debug("%s: enable = %d\n", __func__, enable);
if (enable) {
snd_soc_update_bits(codec, TABLA_A_CONFIG_MODE_FREQ, 0x10, 0);
snd_soc_write(codec, TABLA_A_BIAS_CONFIG_MODE_BG_CTL, 0x17);
@@ -2656,6 +2657,7 @@
snd_soc_update_bits(codec, TABLA_A_BIAS_CONFIG_MODE_BG_CTL, 0x1,
0);
snd_soc_update_bits(codec, TABLA_A_CONFIG_MODE_FREQ, 0x80, 0);
+ snd_soc_update_bits(codec, TABLA_A_CLK_BUFF_EN1, 0x08, 0x00);
}
tabla->config_mode_active = enable ? true : false;
@@ -2667,7 +2669,7 @@
{
struct tabla_priv *tabla = snd_soc_codec_get_drvdata(codec);
- pr_debug("%s\n", __func__);
+ pr_debug("%s: config_mode = %d\n", __func__, config_mode);
if (config_mode) {
tabla_codec_enable_config_mode(codec, 1);