From 8fd8e2335c6e5b8d6212c3e5c819ba72da72e7f9 Mon Sep 17 00:00:00 2001 From: Laxminath Kasam Date: Thu, 13 Aug 2015 10:31:15 +0530 Subject: [PATCH] ASoC: wcd9xxx-mbhc: fix codec power leakage during suspend During suspend in 8952 with wcd9330, observe high current leakage from codec. As per designers, the register MICB_2_MBHC (0x133) bit 2 (PWR_SWCH_OVRD_EN) is set from software resulting in this issue, and this is not needed to be set. Remove setting the register bit from driver, after this observed the expected power numbers during suspend. Change-Id: I72ed7b0c953b5bd2fd52065a49d796bf8294bff7 Signed-off-by: Laxminath Kasam --- sound/soc/codecs/wcd9xxx-mbhc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd9xxx-mbhc.c b/sound/soc/codecs/wcd9xxx-mbhc.c index 69aaed48fe4e..34dcecc354e9 100644 --- a/sound/soc/codecs/wcd9xxx-mbhc.c +++ b/sound/soc/codecs/wcd9xxx-mbhc.c @@ -4255,7 +4255,10 @@ static void wcd9xxx_mbhc_setup(struct wcd9xxx_mbhc *mbhc) gain = wcd9xxx_mbhc_cal_btn_det_mp(btn_det, MBHC_BTN_DET_GAIN); snd_soc_update_bits(codec, WCD9XXX_A_CDC_MBHC_B2_CTL, 0x78, gain[idx] << 3); - snd_soc_update_bits(codec, WCD9XXX_A_MICB_2_MBHC, 0x04, 0x04); + if (mbhc->mbhc_cb && mbhc->mbhc_cb->get_cdc_type && + mbhc->mbhc_cb->get_cdc_type() != + WCD9XXX_CDC_TYPE_TOMTOM) + snd_soc_update_bits(codec, WCD9XXX_A_MICB_2_MBHC, 0x04, 0x04); pr_debug("%s: leave\n", __func__); }