diff options
author | Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org> | 2014-06-24 21:31:54 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-06-27 05:15:31 -0700 |
commit | 3d6531fe22dc5e84f934f4291bf664992dcc1f9d (patch) | |
tree | 20e0fee5ae20675724476cbe28dc2df90405717b /sound/soc | |
parent | 4e9a89240104e17bf52899083d3a3db8c370f83e (diff) |
ASoC: wcd: enable regulators and interrupts properly
Ensure required regulators are enabled during plug type determation
otherwise it will effect Plug determination.
call enable_irq_wake properly for all the interrutps otherwise headset
won't get detected when device is in sleep mode.
CRs-Fixed: 685319 685322
Change-Id: I3f10bb4f21bdc47c3f9882ae5fc668a942390a76
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/msm8916-wcd-irq.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wcd-mbhc-v2.c | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/codecs/msm8916-wcd-irq.c b/sound/soc/codecs/msm8916-wcd-irq.c index 987e3cf847c8..4cc91ce32714 100644 --- a/sound/soc/codecs/msm8916-wcd-irq.c +++ b/sound/soc/codecs/msm8916-wcd-irq.c @@ -114,7 +114,6 @@ void wcd9xxx_spmi_enable_irq(int irq) ~(BYTE_BIT_MASK(irq)); enable_irq(map.linuxirq[irq]); - enable_irq_wake(map.linuxirq[irq]); } void wcd9xxx_spmi_disable_irq(int irq) @@ -161,6 +160,7 @@ int wcd9xxx_spmi_request_irq(int irq, irq_handler_t handler, "irq %d linuxIRQ: %d\n", irq, map.linuxirq[irq]); map.mask[BIT_BYTE(irq)] &= ~BYTE_BIT_MASK(irq); map.handler[irq] = handler; + enable_irq_wake(map.linuxirq[irq]); return 0; } diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 2ee75a7829f3..943946eb4922 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -575,6 +575,9 @@ static void wcd_correct_swch_plug(struct work_struct *work) mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch); codec = mbhc->codec; + /* Enable external voltage source to micbias if present */ + if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source) + mbhc->mbhc_cb->enable_mb_source(codec, true); timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS); while (!time_after(jiffies, timeout)) { if (mbhc->hs_detect_work_stop) { @@ -685,6 +688,9 @@ static void wcd_correct_swch_plug(struct work_struct *work) wcd_mbhc_find_plug_and_report(mbhc, plug_type); exit: + /* Disable external voltage source to micbias if present */ + if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source) + mbhc->mbhc_cb->enable_mb_source(codec, false); wcd9xxx_spmi_unlock_sleep(); pr_debug("%s: leave\n", __func__); } @@ -701,15 +707,15 @@ static void wcd_mbhc_detect_plug_type(struct wcd_mbhc *mbhc) pr_debug("%s: enter\n", __func__); WCD_MBHC_RSC_ASSERT_LOCKED(mbhc); + /* Enable external voltage source to micbias if present */ + if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source) + mbhc->mbhc_cb->enable_mb_source(codec, true); + /* Enable micbias */ snd_soc_update_bits(codec, MSM8X16_WCD_A_ANALOG_MICB_2_EN, 0x80, 0x80); - /* Enable external voltage source to micbias if present */ - if (mbhc->mbhc_cb && mbhc->mbhc_cb->enable_mb_source) - mbhc->mbhc_cb->enable_mb_source(codec, true); - /* * Wait for 50msec for FSM to complete its task. * wakeup if btn pres intr occurs |