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

Commit c445a195 authored by Simmi Pateriya's avatar Simmi Pateriya
Browse files

ASoC: wcd9xxx: Report lineout immediately



If extension cable is inserted into the jack, it
is taking 5 sec to report the insertion. Reduce
this delay by reporting high headphone immediately.

Change-Id: I904f232ede585c39c6b600692ddb8750b848ebcd
Signed-off-by: default avatarSimmi Pateriya <simmip@codeaurora.org>
parent 2eae604f
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2221,6 +2221,7 @@ static void wcd9xxx_find_plug_and_report(struct wcd9xxx_mbhc *mbhc,
	} else if (plug_type == PLUG_TYPE_HIGH_HPH) {
		if (mbhc->mbhc_cfg->detect_extn_cable) {
			/* High impedance device found. Report as LINEOUT*/
			if (mbhc->current_plug == PLUG_TYPE_NONE)
				wcd9xxx_report_plug(mbhc, 1, SND_JACK_LINEOUT);
			wcd9xxx_cleanup_hs_polling(mbhc);
			pr_debug("%s: setup mic trigger for further detection\n",
@@ -2989,6 +2990,14 @@ static void wcd9xxx_correct_swch_plug(struct work_struct *work)
		} else if (plug_type == PLUG_TYPE_HIGH_HPH) {
			pr_debug("%s: High HPH detected, continue polling\n",
				  __func__);
			if (mbhc->mbhc_cfg->detect_extn_cable) {
				if (mbhc->current_plug != plug_type)
					wcd9xxx_report_plug(mbhc, 1,
							    SND_JACK_LINEOUT);
			} else if (mbhc->current_plug == PLUG_TYPE_NONE) {
					wcd9xxx_report_plug(mbhc, 1,
							    SND_JACK_HEADPHONE);
			}
		} else {
			if (plug_type == PLUG_TYPE_GND_MIC_SWAP) {
				pt_gnd_mic_swap_cnt++;