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

Commit ee8ba82e authored by Santosh Mardi's avatar Santosh Mardi Committed by Aravind Kumar
Browse files

ASoC: wcd: update mbhc driver to release pm wake lock



MBHC driver moves pm wake lock state to awake before
scheduling work which detects the headset type.
But the work scheduled does not move the pm wake lock
state back to sleepable. This is causing the target
not to enter into tcxo.

CRs-Fixed: 681157
Change-Id: Ib8d94d5d50a8180365ba4fdaee7c4c587769cbe4
Signed-off-by: default avatarSantosh Mardi <gsantosh@codeaurora.org>
parent 2f0c174f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -324,6 +324,8 @@ bool wcd9xxx_spmi_lock_sleep()
				      msm_cpuidle_get_deep_idle_latency());
	}
	mutex_unlock(&map.pm_lock);
	pr_debug("%s: wake lock counter %d\n", __func__,
			map.wlock_holders);

	if (!wait_event_timeout(map.pm_wq,
				((wcd9xxx_spmi_pm_cmpxchg(
@@ -364,6 +366,8 @@ void wcd9xxx_spmi_unlock_sleep()
				PM_QOS_DEFAULT_VALUE);
	}
	mutex_unlock(&map.pm_lock);
	pr_debug("%s: wake lock counter %d\n", __func__,
			map.wlock_holders);
	wake_up_all(&map.pm_wq);
}
EXPORT_SYMBOL(wcd9xxx_spmi_unlock_sleep);
+5 −3
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
	while (!time_after(jiffies, timeout)) {
		if (mbhc->hs_detect_work_stop) {
			pr_debug("%s: stop requested\n", __func__);
			return;
			goto exit;
		}

		/*
@@ -590,7 +590,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
		msleep(200);
		if (mbhc->hs_detect_work_stop) {
			pr_debug("%s: stop requested\n", __func__);
			return;
			goto exit;
		}
		result1 = snd_soc_read(codec,
				 MSM8X16_WCD_A_ANALOG_MBHC_BTN_RESULT);
@@ -605,7 +605,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
			plug_type = MBHC_PLUG_TYPE_HEADSET;
			if (mbhc->current_plug != MBHC_PLUG_TYPE_HEADSET) {
				wcd_mbhc_find_plug_and_report(mbhc, plug_type);
				return;
				goto exit;
			}
			wrk_complete = false;
		}
@@ -689,6 +689,8 @@ static void wcd_correct_swch_plug(struct work_struct *work)
	}

	wcd_mbhc_find_plug_and_report(mbhc, plug_type);
exit:
	wcd9xxx_spmi_unlock_sleep();
	pr_debug("%s: leave\n", __func__);
}