From 7aa2f97f6098f8bb68c651ead76d7d4a3487b23f Mon Sep 17 00:00:00 2001 From: Vatsal Bucha Date: Thu, 3 Jan 2019 12:08:29 +0530 Subject: [PATCH] ASoC: wcd937x: Enable surge protection for talos Enable surge protection feature for talos. Change-Id: If1a5e4d60a80f288825ee0e39645166f0cb9446f Signed-off-by: Vatsal Bucha --- asoc/codecs/wcd937x/wcd937x.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/asoc/codecs/wcd937x/wcd937x.c b/asoc/codecs/wcd937x/wcd937x.c index ae286bdb7a37..beb4b177fd56 100644 --- a/asoc/codecs/wcd937x/wcd937x.c +++ b/asoc/codecs/wcd937x/wcd937x.c @@ -131,7 +131,9 @@ static int wcd937x_init_reg(struct snd_soc_component *component) 0xFF, 0x3A); snd_soc_component_update_bits(component, WCD937X_RX_OCP_CTL, 0x0F, 0x02); - + snd_soc_component_update_bits(component, + WCD937X_HPH_SURGE_HPHLR_SURGE_EN, + 0xFF, 0xD9); return 0; } @@ -1507,6 +1509,10 @@ static int wcd937x_event_notify(struct notifier_block *block, wcd937x_get_logical_addr(wcd937x->rx_swr_dev); 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);