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

Commit d09e0e06 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian
Browse files

drivers: qcom: system_pm: Set infinite sleep if sleep time is 0



The LPM driver passes in 0 as wakeup time for suspend. Interpret this as a
infinite sleep and set the wakeup to ~0ULL to prevent PDC from waking up
immediately.

Change-Id: I956fc6c57cbf4910a5f0e307bdf05ec070950ed0
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent 73e234e4
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -56,9 +56,13 @@ int system_sleep_enter(uint64_t sleep_val)
	 * Set up the wake up value offset from the current time.
	 * Convert us to ns to allow div by 19.2 Mhz tick timer.
	 */
	if (sleep_val) {
		sleep_val *= NSEC_PER_USEC;
		do_div(sleep_val, NSEC_PER_SEC/ARCH_TIMER_HZ);
		sleep_val += arch_counter_get_cntvct();
	} else {
		sleep_val = ~0ULL;
	}

	return setup_wakeup(sleep_val);
}