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

Commit 997c13ca authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: mbhc-adc: Prevent lineout from being reported two times"

parents d153bc1d 8f1926c5
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -453,6 +453,7 @@ static bool wcd_mbhc_adc_check_for_spl_headset(struct wcd_mbhc *mbhc,
	adc_hph_threshold = wcd_mbhc_adc_get_hph_thres(mbhc);
	adc_hph_threshold = wcd_mbhc_adc_get_hph_thres(mbhc);


	if (output_mv > adc_threshold || output_mv < adc_hph_threshold) {
	if (output_mv > adc_threshold || output_mv < adc_hph_threshold) {
		if (mbhc->force_linein == true)
			spl_hs = false;
			spl_hs = false;
	} else {
	} else {
		spl_hs = true;
		spl_hs = true;
@@ -515,10 +516,13 @@ static bool wcd_is_special_headset(struct wcd_mbhc *mbhc)
		msleep(50);
		msleep(50);
		output_mv = wcd_measure_adc_once(mbhc, MUX_CTL_IN2P);
		output_mv = wcd_measure_adc_once(mbhc, MUX_CTL_IN2P);
		if (output_mv <= adc_threshold) {
		if (output_mv <= adc_threshold) {
			pr_debug("%s: Special headset detected in %d msecs\n",
			if (mbhc->force_linein != true) {
				pr_debug(
				"%s: Special headset detected in %d msecs\n",
					 __func__, delay);
					 __func__, delay);
				is_spl_hs = true;
				is_spl_hs = true;
			}
			}
		}


		if (delay == SPECIAL_HS_DETECT_TIME_MS) {
		if (delay == SPECIAL_HS_DETECT_TIME_MS) {
			pr_debug("%s: Spl headset not found in 2 sec\n",
			pr_debug("%s: Spl headset not found in 2 sec\n",
@@ -831,7 +835,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
			}
			}
		}
		}


		if (output_mv > hs_threshold) {
		if (output_mv > hs_threshold || mbhc->force_linein == true) {
			pr_debug("%s: cable is extension cable\n", __func__);
			pr_debug("%s: cable is extension cable\n", __func__);
			plug_type = MBHC_PLUG_TYPE_HIGH_HPH;
			plug_type = MBHC_PLUG_TYPE_HIGH_HPH;
			wrk_complete = true;
			wrk_complete = true;