Jelajahi Sumber

asoc: codec: wsa884x: check for spkr status before enabling PA

added condition to check for spkr status before enabling
GLOBAL_PA to make sure PA is enabled only when Speaker
is in Enabled state.

Change-Id: Ifa4eeb7d8561bb68193abae16221dd8b2464029c
Signed-off-by: Ganapathiraju Sarath Varma <[email protected]>
Ganapathiraju Sarath Varma 1 tahun lalu
induk
melakukan
374374a0c4
1 mengubah file dengan 4 tambahan dan 2 penghapusan
  1. 4 2
      asoc/codecs/wsa884x/wsa884x.c

+ 4 - 2
asoc/codecs/wsa884x/wsa884x.c

@@ -227,8 +227,10 @@ static int wsa884x_handle_post_irq(void *data)
 	if (!wsa884x->pa_mute) {
 		do {
 			wsa884x->pa_mute = 0;
-			regmap_update_bits(wsa884x->regmap,
-				REG_FIELD_VALUE(PA_FSM_EN, GLOBAL_PA_EN, 0x01));
+			if (test_bit(SPKR_STATUS, &wsa884x->status_mask))
+				regmap_update_bits(wsa884x->regmap,
+					REG_FIELD_VALUE(PA_FSM_EN, GLOBAL_PA_EN, 0x01));
+
 			usleep_range(1000, 1100);
 
 			regmap_read(wsa884x->regmap, WSA884X_INTR_STATUS0, &sts1);