Skip to content

Commit

Permalink
ASoC: tlv320aic3x: Fix codec pll configure bug
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
  • Loading branch information
ghebbar authored and broonie committed Jun 29, 2012
1 parent b0dfa45 commit c9fe573
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions sound/soc/codecs/tlv320aic3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream,
}

found:
data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG);
snd_soc_write(codec, AIC3X_PLL_PROGA_REG,
data | (pll_p << PLLP_SHIFT));
snd_soc_update_bits(codec, AIC3X_PLL_PROGA_REG, PLLP_MASK, pll_p);
snd_soc_write(codec, AIC3X_OVRF_STATUS_AND_PLLR_REG,
pll_r << PLLR_SHIFT);
snd_soc_write(codec, AIC3X_PLL_PROGB_REG, pll_j << PLLJ_SHIFT);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/tlv320aic3x.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@

/* PLL registers bitfields */
#define PLLP_SHIFT 0
#define PLLP_MASK 7
#define PLLQ_SHIFT 3
#define PLLR_SHIFT 0
#define PLLJ_SHIFT 2
Expand Down

0 comments on commit c9fe573

Please sign in to comment.