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

Commit 3692fa73 authored by Karthikeyan Mani's avatar Karthikeyan Mani
Browse files

ASoC: wcd-mbhc: Add support for unloading mbhc



Add lock and unlock for mbhc resource lock while
calling wcd_cancel_hs_detect_plug to avoid kernel
warning messages from deinit function.

CRs-fixed: 2039099
Change-Id: I732163fae68bc675e72142b3287d11a0c21f7375
Signed-off-by: default avatarKarthikeyan Mani <kmani@codeaurora.org>
parent 72f16cf8
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2058,9 +2058,12 @@ void wcd_mbhc_deinit(struct wcd_mbhc *mbhc)
	mbhc->mbhc_cb->free_irq(codec, mbhc->intr_ids->hph_right_ocp, mbhc);
	mbhc->mbhc_cb->free_irq(codec, mbhc->intr_ids->hph_right_ocp, mbhc);
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->register_notifier)
	if (mbhc->mbhc_cb && mbhc->mbhc_cb->register_notifier)
		mbhc->mbhc_cb->register_notifier(mbhc, &mbhc->nblock, false);
		mbhc->mbhc_cb->register_notifier(mbhc, &mbhc->nblock, false);
	if (mbhc->mbhc_fn->wcd_cancel_hs_detect_plug)
	if (mbhc->mbhc_fn->wcd_cancel_hs_detect_plug) {
		WCD_MBHC_RSC_LOCK(mbhc);
		mbhc->mbhc_fn->wcd_cancel_hs_detect_plug(mbhc,
		mbhc->mbhc_fn->wcd_cancel_hs_detect_plug(mbhc,
					&mbhc->correct_plug_swch);
					&mbhc->correct_plug_swch);
		WCD_MBHC_RSC_UNLOCK(mbhc);
	}
	mutex_destroy(&mbhc->codec_resource_lock);
	mutex_destroy(&mbhc->codec_resource_lock);
	mutex_destroy(&mbhc->hphl_pa_lock);
	mutex_destroy(&mbhc->hphl_pa_lock);
	mutex_destroy(&mbhc->hphr_pa_lock);
	mutex_destroy(&mbhc->hphr_pa_lock);