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

Commit 5be9ddd0 authored by Yeleswarapu Nagaradhesh's avatar Yeleswarapu Nagaradhesh
Browse files

ASoC: wcd: correct handling of GND_MIC_SWAP



During playback HPHR schmitt trigger can give wrong results
and can identify as cross connection. So judge cable as
GND_MIC_SWAP only after GND_MIC_SWAP_THRESHOLD count.

CRs-Fixed: 755296
Change-Id: I9ff0457b488745ca1d23d960aae8d664fbabfcfd
Signed-off-by: default avatarYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
parent 234d6114
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -999,7 +999,6 @@ static void wcd_correct_swch_plug(struct work_struct *work)
		if ((!(result2 & 0x01)) && (!is_pa_on)) {
			/* Check for cross connection*/
			if (wcd_check_cross_conn(mbhc)) {
				plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP;
				pt_gnd_mic_swap_cnt++;
				if (pt_gnd_mic_swap_cnt <
						GND_MIC_SWAP_THRESHOLD) {
@@ -1012,6 +1011,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
					 */
					pr_debug("%s: switch didnt work\n",
						  __func__);
					plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP;
					goto report;
				} else if (mbhc->mbhc_cfg->swap_gnd_mic) {
					pr_debug("%s: US_EU gpio present, flip switch\n",
@@ -1020,6 +1020,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
					 * if switch is toggled, check again,
					 * otherwise report unsupported plug
					 */
					plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP;
					if (mbhc->mbhc_cfg->swap_gnd_mic(codec))
						continue;
				}