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

Commit dbd85e08 authored by Jigarkumar Kishorkumar Zala's avatar Jigarkumar Kishorkumar Zala Committed by Gerrit - the friendly Code Review server
Browse files

msm: qpnp-haptic: add check for haptic state



Add check for haptic state, for avoiding a worker
if haptics are disabled and gets a call for disable.

Change-Id: I47440b02b60fac2a3536e055f2d09f4e7cec2867
Signed-off-by: default avatarJigarkumar Kishorkumar Zala <j_zala@codeaurora.org>
parent 16bd12a5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1102,9 +1102,13 @@ static void qpnp_hap_td_enable(struct timed_output_dev *dev, int value)
	mutex_lock(&hap->lock);
	hrtimer_cancel(&hap->hap_timer);

	if (value == 0)
	if (value == 0) {
		if (hap->state == 0) {
			mutex_unlock(&hap->lock);
			return;
		}
		hap->state = 0;
	else {
	} else {
		value = (value > hap->timeout_ms ?
				 hap->timeout_ms : value);
		hap->state = 1;