Browse Source

Merge "asoc: wcd938x: Disable EN_CUR_DET bit for receiver noise"

Linux Build Service Account 6 years ago
parent
commit
94de539c53
3 changed files with 9 additions and 1 deletions
  1. 3 0
      asoc/codecs/wcd-clsh.c
  2. 4 0
      asoc/codecs/wcd938x/wcd938x.c
  3. 2 1
      include/asoc/wcd9xxx_registers.h

+ 3 - 0
asoc/codecs/wcd-clsh.c

@@ -218,6 +218,9 @@ static void wcd_clsh_flyback_ctrl(struct snd_soc_component *component,
 	/* enable/disable flyback */
 	if ((enable && (++clsh_d->flyback_users == 1)) ||
 	   (!enable && (--clsh_d->flyback_users == 0))) {
+		snd_soc_component_update_bits(component,
+				WCD9XXX_FLYBACK_VNEG_CTRL_1,
+				0xE0, 0xE0);
 		snd_soc_component_update_bits(component,
 				WCD9XXX_ANA_RX_SUPPLIES,
 				(1 << 6), (enable << 6));

+ 4 - 0
asoc/codecs/wcd938x/wcd938x.c

@@ -532,6 +532,8 @@ static int wcd938x_codec_ear_dac_event(struct snd_soc_dapm_widget *w,
 				WCD938X_DIGITAL_CDC_COMP_CTL_0, 0x02, 0x02);
 		/* 5 msec delay as per HW requirement */
 		usleep_range(5000, 5010);
+		snd_soc_component_update_bits(component, WCD938X_FLYBACK_EN,
+				0x04, 0x00);
 		wcd_cls_h_fsm(component, &wcd938x->clsh_info,
 			     WCD_CLSH_EVENT_PRE_DAC,
 			     WCD_CLSH_STATE_EAR,
@@ -824,6 +826,8 @@ static int wcd938x_codec_enable_ear_pa(struct snd_soc_dapm_widget *w,
 			     WCD_CLSH_EVENT_POST_PA,
 			     WCD_CLSH_STATE_EAR,
 			     hph_mode);
+		snd_soc_component_update_bits(component, WCD938X_FLYBACK_EN,
+				0x04, 0x04);
 		break;
 	};
 	return ret;

+ 2 - 1
include/asoc/wcd9xxx_registers.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _WCD9XXX_REGISTERS_H
@@ -12,6 +12,7 @@
 #define WCD9XXX_ANA_HPH                             (WCD9XXX_BASE_ADDRESS+0x009)
 #define WCD9XXX_CLASSH_MODE_2                       (WCD9XXX_BASE_ADDRESS+0x098)
 #define WCD9XXX_CLASSH_MODE_3                       (WCD9XXX_BASE_ADDRESS+0x099)
+#define WCD9XXX_FLYBACK_VNEG_CTRL_1                 (WCD9XXX_BASE_ADDRESS+0x0A5)
 #define WCD9XXX_FLYBACK_VNEG_CTRL_4                 (WCD9XXX_BASE_ADDRESS+0x0A8)
 #define WCD9XXX_FLYBACK_VNEGDAC_CTRL_2              (WCD9XXX_BASE_ADDRESS+0x0AF)
 #define WCD9XXX_RX_BIAS_HPH_LOWPOWER                (WCD9XXX_BASE_ADDRESS+0x0BF)