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

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

Merge "ASoC: wcd9xxx: Handle fake mechanical interrupt"

parents 921fd8be aa8ab68f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3109,6 +3109,7 @@ static void wcd9xxx_correct_swch_plug(struct work_struct *work)

	mbhc = container_of(work, struct wcd9xxx_mbhc, correct_plug_swch);
	codec = mbhc->codec;
	mbhc->poll_swch_on = true;

	current_source_enable = (((mbhc->mbhc_cfg->cs_enable_flags &
		      (1 << MBHC_CS_ENABLE_POLLING)) != 0) &&
@@ -3287,6 +3288,7 @@ static void wcd9xxx_correct_swch_plug(struct work_struct *work)
		WCD9XXX_BCL_UNLOCK(mbhc->resmgr);
	}
	pr_debug("%s: leave current_plug(%d)\n", __func__, mbhc->current_plug);
	mbhc->poll_swch_on = false;
	/* unlock sleep */
	wcd9xxx_unlock_sleep(mbhc->resmgr->core_res);
}
@@ -3314,6 +3316,9 @@ static void wcd9xxx_swch_irq_handler(struct wcd9xxx_mbhc *mbhc)
	pr_debug("%s: Current plug type %d, insert %d\n", __func__,
		 mbhc->current_plug, insert);
	if ((mbhc->current_plug == PLUG_TYPE_NONE) && insert) {
		if (mbhc->poll_swch_on)
			goto exit;

		mbhc->lpi_enabled = false;
		wmb();
		/* cancel detect plug */
@@ -5358,6 +5363,7 @@ int wcd9xxx_mbhc_init(struct wcd9xxx_mbhc *mbhc, struct wcd9xxx_resmgr *resmgr,
	mbhc->current_plug = PLUG_TYPE_NONE;
	mbhc->lpi_enabled = false;
	mbhc->no_mic_headset_override = false;
	mbhc->poll_swch_on = false;
	mbhc->mbhc_last_resume = 0;
	mbhc->codec = codec;
	mbhc->resmgr = resmgr;
+1 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ struct wcd9xxx_mbhc {
	u8 hphlocp_cnt; /* headphone left ocp retry */
	u8 hphrocp_cnt; /* headphone right ocp retry */

	bool poll_swch_on;
	/* Work to perform MBHC Firmware Read */
	struct delayed_work mbhc_firmware_dwork;
	const struct firmware *mbhc_fw;