From 1d965295d4058d8c71fcd60c59cd8f6eb0c60a22 Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Mon, 8 Jul 2019 18:47:08 +0530 Subject: [PATCH] asoc: wcd938x: Reset mbhc detection type after ssr During headset playback if we trigger SSR, headset removal is not detected. This is because after recovery mbhc driver expects a new detection event as the driver is reinitialized. Reset detection type to insertion to retrigger a hw interrupt for mbhc driver. Change-Id: Ibf6663f46e7485f5ff5c5968a71c88e59a4728e7 Signed-off-by: Vatsal Bucha --- asoc/codecs/wcd938x/wcd938x-mbhc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asoc/codecs/wcd938x/wcd938x-mbhc.c b/asoc/codecs/wcd938x/wcd938x-mbhc.c index 08a2b228df3a..47ebb072fd18 100644 --- a/asoc/codecs/wcd938x/wcd938x-mbhc.c +++ b/asoc/codecs/wcd938x/wcd938x-mbhc.c @@ -1009,6 +1009,9 @@ int wcd938x_mbhc_post_ssr_init(struct wcd938x_mbhc *mbhc, return -EINVAL; } + /* Reset detection type to insertion after SSR recovery */ + snd_soc_component_update_bits(component, WCD938X_ANA_MBHC_MECH, + 0x20, 0x20); ret = wcd_mbhc_init(wcd_mbhc, component, &mbhc_cb, &intr_ids, wcd_mbhc_registers, WCD938X_ZDET_SUPPORTED); if (ret) {