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

Commit e241554a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wcd: Avoid multiple insertion/removals for aux cable"

parents 05cae991 d6d62b8d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -688,6 +688,10 @@ static void wcd_correct_swch_plug(struct work_struct *work)
	if (!wrk_complete && mbhc->btn_press_intr) {
		pr_debug("%s: Can be slow insertion of headphone\n", __func__);
		wcd_cancel_btn_work(mbhc);
		/* Report as headphone only if previously
		 * not reported as lineout
		 */
		if (!mbhc->force_linein)
			plug_type = MBHC_PLUG_TYPE_HEADPHONE;
	}
	/*
+3 −0
Original line number Diff line number Diff line
@@ -605,6 +605,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
		hphrocp_off_report(mbhc, SND_JACK_OC_HPHR);
		hphlocp_off_report(mbhc, SND_JACK_OC_HPHL);
		mbhc->current_plug = MBHC_PLUG_TYPE_NONE;
		mbhc->force_linein = false;
	} else {
		/*
		 * Report removal of current jack type.
@@ -657,6 +658,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
						SND_JACK_LINEOUT |
						SND_JACK_ANC_HEADPHONE |
						SND_JACK_UNSUPPORTED);
			mbhc->force_linein = false;
		}

		if (mbhc->current_plug == MBHC_PLUG_TYPE_HEADSET &&
@@ -699,6 +701,7 @@ void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
				 mbhc->zr < MAX_IMPED) &&
				(jack_type == SND_JACK_HEADPHONE)) {
				jack_type = SND_JACK_LINEOUT;
				mbhc->force_linein = true;
				mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
				if (mbhc->hph_status) {
					mbhc->hph_status &= ~(SND_JACK_HEADSET |
+1 −0
Original line number Diff line number Diff line
@@ -589,6 +589,7 @@ struct wcd_mbhc {
	struct work_struct usbc_analog_work;

	struct wcd_mbhc_fn *mbhc_fn;
	bool force_linein;
};

void wcd_mbhc_find_plug_and_report(struct wcd_mbhc *mbhc,