diff options
author | Hebbar, Gururaja <gururaja.hebbar@ti.com> | 2012-06-26 09:55:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 11:47:39 -0400 |
commit | c45f606a03193a95a55ef1802646e5a67fff642b (patch) | |
tree | 8a06a1e0fbc1023881f0541f8b38b648d9153e77 | |
parent | 5fe4d12cfbf9ca994640a487439a2ef2f633336c (diff) |
ASoC: tlv320aic3x: Fix codec pll configure bug
commit c9fe573a6584034670c1a55ee8162d623519cbbf upstream.
In sound/soc/codecs/tlv320aic3x.c
data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
data | (pll_p << PLLP_SHIFT));
In the above code, pll-p value is OR'ed with previous value without
clearing it. Bug is not seen if pll-p value doesn't change across
Sampling frequency.
However on some platforms (like AM335x EVM-SK), pll-p may have different
values across different sampling frequencies. In such case, above code
configures the pll with a wrong value.
Because of this bug, when a audio stream is played with pll value
different from previous stream, audio is heard as differently(like its
stretched).
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 4 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.h | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 789453d44ec..0b08bb7aa3a 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -949,9 +949,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
949 | } | 949 | } |
950 | 950 | ||
951 | found: | 951 | found: |
952 | data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); | 952 | snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, PLLP_MASK, pll_p); |
953 | snd_soc_write(codec, AIC3X_PLL_PROGA_REG, | ||
954 | data | (pll_p << PLLP_SHIFT)); | ||
955 | snd_soc_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG, | 953 | snd_soc_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG, |
956 | pll_r << PLLR_SHIFT); | 954 | pll_r << PLLR_SHIFT); |
957 | snd_soc_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT); | 955 | snd_soc_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT); |
diff --git a/sound/soc/codecs/tlv320aic3x.h b/sound/soc/codecs/tlv320aic3x.h index 06a19784b16..16d999957b8 100644 --- a/sound/soc/codecs/tlv320aic3x.h +++ b/sound/soc/codecs/tlv320aic3x.h | |||
@@ -166,6 +166,7 @@ | |||
166 | 166 | ||
167 | /* PLL registers bitfields */ | 167 | /* PLL registers bitfields */ |
168 | #define PLLP_SHIFT 0 | 168 | #define PLLP_SHIFT 0 |
169 | #define PLLP_MASK 7 | ||
169 | #define PLLQ_SHIFT 3 | 170 | #define PLLQ_SHIFT 3 |
170 | #define PLLR_SHIFT 0 | 171 | #define PLLR_SHIFT 0 |
171 | #define PLLJ_SHIFT 2 | 172 | #define PLLJ_SHIFT 2 |