From 6b4f250e7bd4b1ede0459178472cea765d5288bf Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Mon, 10 Feb 2020 16:53:58 +0530 Subject: [PATCH] ASoC: wcd937x: Fix headset record pop during SSR Pop is heard with special headset with silence record during SSR. Resolve pop by allowing sufficient time for wcd937x_reset post SSR and again initialize registers post SSR. Change-Id: I80e70a98a72b247dca878673a30651647b676659 Signed-off-by: Vatsal Bucha --- asoc/codecs/wcd937x/wcd937x.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/asoc/codecs/wcd937x/wcd937x.c b/asoc/codecs/wcd937x/wcd937x.c index 725fef85b474..67a6cb73764e 100644 --- a/asoc/codecs/wcd937x/wcd937x.c +++ b/asoc/codecs/wcd937x/wcd937x.c @@ -1596,14 +1596,13 @@ static int wcd937x_event_notify(struct notifier_block *block, break; case BOLERO_WCD_EVT_SSR_UP: wcd937x_reset(wcd937x->dev); + /* allow reset to take effect */ + usleep_range(10000, 10010); wcd937x_get_logical_addr(wcd937x->tx_swr_dev); wcd937x_get_logical_addr(wcd937x->rx_swr_dev); + wcd937x_init_reg(component); regcache_mark_dirty(wcd937x->regmap); regcache_sync(wcd937x->regmap); - /* Enable surge protection */ - snd_soc_component_update_bits(component, - WCD937X_HPH_SURGE_HPHLR_SURGE_EN, - 0xFF, 0xD9); /* Initialize MBHC module */ mbhc = &wcd937x->mbhc->wcd_mbhc; ret = wcd937x_mbhc_post_ssr_init(wcd937x->mbhc, component);