Browse Source

ASoC: wcd937x: Fix pop after PDR

Pop is heard after PDR is triggered. This is
because while device down PA is still on.
Disable PA before SSR device down to prevent pop.

Change-Id: I6bfe3e731bdf60fba8fee90ab39c03a0512006ce
Signed-off-by: Vatsal Bucha <[email protected]>
Vatsal Bucha 6 years ago
parent
commit
79da9fb84a
2 changed files with 6 additions and 0 deletions
  1. 1 0
      asoc/codecs/wcd937x/internal.h
  2. 5 0
      asoc/codecs/wcd937x/wcd937x.c

+ 1 - 0
asoc/codecs/wcd937x/internal.h

@@ -123,6 +123,7 @@ enum {
 
 enum {
 	BOLERO_WCD_EVT_TX_CH_HOLD_CLEAR = 1,
+	BOLERO_WCD_EVT_PA_OFF_PRE_SSR,
 	BOLERO_WCD_EVT_SSR_DOWN,
 	BOLERO_WCD_EVT_SSR_UP,
 };

+ 5 - 0
asoc/codecs/wcd937x/wcd937x.c

@@ -1246,6 +1246,11 @@ static int wcd937x_event_notify(struct notifier_block *block,
 			mask = 0x20;
 		snd_soc_update_bits(codec, reg, mask, 0x00);
 		break;
+	case BOLERO_WCD_EVT_PA_OFF_PRE_SSR:
+		snd_soc_update_bits(codec, WCD937X_ANA_HPH, 0xC0, 0x00);
+		snd_soc_update_bits(codec, WCD937X_ANA_EAR, 0x80, 0x00);
+		snd_soc_update_bits(codec, WCD937X_AUX_AUXPA, 0x80, 0x00);
+		break;
 	case BOLERO_WCD_EVT_SSR_DOWN:
 		wcd937x_reset_low(wcd937x->dev);
 		break;