diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index ab099f482487..cb0d1bf34b57 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -767,6 +767,7 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
767 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; | 767 | int codec_clk = 0, bypass_pll = 0, fsref, last_clk = 0; |
768 | u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; | 768 | u8 data, r, p, pll_q, pll_p = 1, pll_r = 1, pll_j = 1; |
769 | u16 pll_d = 1; | 769 | u16 pll_d = 1; |
770 | u8 reg; | ||
770 | 771 | ||
771 | /* select data word length */ | 772 | /* select data word length */ |
772 | data = | 773 | data = |
@@ -801,8 +802,16 @@ static int aic3x_hw_params(struct snd_pcm_substream *substream, | |||
801 | pll_q &= 0xf; | 802 | pll_q &= 0xf; |
802 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); | 803 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, pll_q << PLLQ_SHIFT); |
803 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); | 804 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_CLKDIV); |
804 | } else | 805 | /* disable PLL if it is bypassed */ |
806 | reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); | ||
807 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg & ~PLL_ENABLE); | ||
808 | |||
809 | } else { | ||
805 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); | 810 | aic3x_write(codec, AIC3X_GPIOB_REG, CODEC_CLKIN_PLLDIV); |
811 | /* enable PLL when it is used */ | ||
812 | reg = aic3x_read_reg_cache(codec, AIC3X_PLL_PROGA_REG); | ||
813 | aic3x_write(codec, AIC3X_PLL_PROGA_REG, reg | PLL_ENABLE); | ||
814 | } | ||
806 | 815 | ||
807 | /* Route Left DAC to left channel input and | 816 | /* Route Left DAC to left channel input and |
808 | * right DAC to right channel input */ | 817 | * right DAC to right channel input */ |