diff options
author | Dara Ramesh <dramesh@nvidia.com> | 2013-01-28 16:54:06 +0530 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2013-01-30 03:44:46 -0800 |
commit | c11efa8716501f6f8d86e8e22aea8c689eeb1b0f (patch) | |
tree | 088b47fa1f94d99d117995da8746a0f0e7f6e3f7 /sound | |
parent | b667c1bf84c035a021a66cc3fefee065e1e4248a (diff) |
asoc: codecs: rt5640: fix headset power issue
Write back the power control register values
after detecting headset or headphone.
bug 1218111
Change-Id: I372c3d1e397290d8c31bd0591861731d4eb861db
Signed-off-by: Dara Ramesh <dramesh@nvidia.com>
Reviewed-on: http://git-master/r/194637
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vijay Mali <vmali@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/rt5640.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 2c76a96b57ca..ce9536bce8a6 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -440,11 +440,14 @@ int rt5640_headset_detect(struct snd_soc_codec *codec, int jack_insert) { int jack_type; int sclk_src; + int reg63, reg64; struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); mutex_lock(&rt5640->lock); CHECK_I2C_SHUTDOWN(rt5640, codec) if (jack_insert) { + reg63 = snd_soc_read(codec, RT5640_PWR_ANLG1); + reg64 = snd_soc_read(codec, RT5640_PWR_ANLG2); if (SND_SOC_BIAS_OFF == codec->dapm.bias_level) { snd_soc_write(codec, RT5640_PWR_ANLG1, 0x2004); snd_soc_write(codec, RT5640_MICBIAS, 0x3830); @@ -474,6 +477,8 @@ int rt5640_headset_detect(struct snd_soc_codec *codec, int jack_insert) RT5640_MB1_OC_CLR, 0); snd_soc_update_bits(codec, RT5640_GLB_CLK, RT5640_SCLK_SRC_MASK, sclk_src); + snd_soc_write(codec, RT5640_PWR_ANLG1, reg63); + snd_soc_write(codec, RT5640_PWR_ANLG2, reg64); } else { snd_soc_update_bits(codec, RT5640_MICBIAS, RT5640_MIC1_OVCD_MASK, |