Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2426d927 authored by Phani Kumar Uppalapati's avatar Phani Kumar Uppalapati
Browse files

ASoC: wcd9xxx: Avoid enabling button polling from event notify handler



During insertion, it is possible that recording is already
enabled from handset which will switch to headset. During
POST_MICBIAS_2_ON event, though button polling is not actually
enabled, due to polling_active becomes true, the event
notification handler pauses and re-starts button polling.
This could lead to unknown state for button polling state
machine.

CRs-Fixed: 639116
Change-Id: Ie379e5ff58c2e99f8e21e534cbcdb914bc98b7ec
Signed-off-by: default avatarPhani Kumar Uppalapati <phaniu@codeaurora.org>
parent 27a70795
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ static void wcd9xxx_mbhc_calc_thres(struct wcd9xxx_mbhc *mbhc);

static bool wcd9xxx_mbhc_polling(struct wcd9xxx_mbhc *mbhc)
{
	return mbhc->polling_active;
	return snd_soc_read(mbhc->codec, WCD9XXX_A_CDC_MBHC_EN_CTL) & 0x1;
}

static void wcd9xxx_turn_onoff_override(struct wcd9xxx_mbhc *mbhc, bool on)
@@ -542,13 +542,13 @@ static void wcd9xxx_codec_switch_cfilt_mode(struct wcd9xxx_mbhc *mbhc,

	if (cfilt_mode.cur_mode_val
			!= cfilt_mode.reg_mode_val) {
		if (mbhc->polling_active)
		if (mbhc->polling_active && wcd9xxx_mbhc_polling(mbhc))
			wcd9xxx_pause_hs_polling(mbhc);
		snd_soc_update_bits(codec,
				    mbhc->mbhc_bias_regs.cfilt_ctl,
					cfilt_mode.reg_mask,
					cfilt_mode.reg_mode_val);
		if (mbhc->polling_active)
		if (mbhc->polling_active && wcd9xxx_mbhc_polling(mbhc))
			wcd9xxx_start_hs_polling(mbhc);
		pr_debug("%s: CFILT mode change (%x to %x)\n", __func__,
			cfilt_mode.cur_mode_val,