summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSimon Je <sje@nvidia.com>2013-08-02 09:59:57 +0900
committerGabby Lee <galee@nvidia.com>2013-08-05 18:46:28 -0700
commite46f7dca63a5adb325e4f780f50f34fe23b8e02c (patch)
treec9135da7518ba20b26ce95a9e581cc9b734619f5 /sound
parenta65f96ef3f5788c44db1dca63f1d825bb10622fa (diff)
asoc: codecs: rt5639: switch codec system clock
We need to switch the codec system clock to internal clock only when bias level is OFF when plugggin earjack. Bug 1340840 Change-Id: I01ad0ccff952c1f811d24cb22fde70192753d77e Signed-off-by: Simon Je <sje@nvidia.com> Reviewed-on: http://git-master/r/257194 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt5639.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sound/soc/codecs/rt5639.c b/sound/soc/codecs/rt5639.c
index 87b2133c21b0..7df0fd691cf1 100644
--- a/sound/soc/codecs/rt5639.c
+++ b/sound/soc/codecs/rt5639.c
@@ -507,7 +507,7 @@ static void DC_Calibrate(struct snd_soc_codec *codec)
int rt5639_headset_detect(struct snd_soc_codec *codec, int jack_insert)
{
int jack_type;
- int sclk_src;
+ int sclk_src = 0;
int reg63, reg64;
if (jack_insert) {
@@ -517,11 +517,12 @@ int rt5639_headset_detect(struct snd_soc_codec *codec, int jack_insert)
snd_soc_write(codec, RT5639_PWR_ANLG1, 0xa814);
snd_soc_write(codec, RT5639_MICBIAS, 0x3830);
snd_soc_write(codec, RT5639_GEN_CTRL1 , 0x3701);
+ sclk_src = snd_soc_read(codec, RT5639_GLB_CLK) &
+ RT5639_SCLK_SRC_MASK;
+ snd_soc_update_bits(codec, RT5639_GLB_CLK,
+ RT5639_SCLK_SRC_MASK,
+ 0x3 << RT5639_SCLK_SRC_SFT);
}
- sclk_src = snd_soc_read(codec, RT5639_GLB_CLK) &
- RT5639_SCLK_SRC_MASK;
- snd_soc_update_bits(codec, RT5639_GLB_CLK,
- RT5639_SCLK_SRC_MASK, 0x3 << RT5639_SCLK_SRC_SFT);
snd_soc_update_bits(codec, RT5639_PWR_ANLG1,
RT5639_PWR_LDO2, RT5639_PWR_LDO2);
snd_soc_update_bits(codec, RT5639_PWR_ANLG2,
@@ -548,8 +549,9 @@ int rt5639_headset_detect(struct snd_soc_codec *codec, int jack_insert)
jack_type = RT5639_HEADSET_DET;
snd_soc_update_bits(codec, RT5639_IRQ_CTRL2,
RT5639_MB1_OC_CLR, 0);
- snd_soc_update_bits(codec, RT5639_GLB_CLK,
- RT5639_SCLK_SRC_MASK, sclk_src);
+ if (SND_SOC_BIAS_OFF == codec->dapm.bias_level)
+ snd_soc_update_bits(codec, RT5639_GLB_CLK,
+ RT5639_SCLK_SRC_MASK, sclk_src);
snd_soc_write(codec, RT5639_PWR_ANLG1, reg63);
snd_soc_write(codec, RT5639_PWR_ANLG2, reg64);
} else {