mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
timer: Added usleep[_range] timer
usleep[_range] are finer precision implementations of msleep and are designed to be drop-in replacements for udelay where a precise sleep / busy-wait is unnecessary. They also allow an easy interface to specify slack when a precise (ish) wakeup is unnecessary to help minimize wakeups As ACK'd upstream: https://patchwork.kernel.org/patch/112813/ Change-Id: I277737744ca58061323837609b121a0fc9d27f33 Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org> (cherry picked from commit 08c118890b06595dfc26d47ee63f59e73256c270) Conflicts: include/linux/delay.h kernel/timer.c
This commit is contained in:
parent
fe62c33fed
commit
d73e2130f6
1 changed files with 5 additions and 0 deletions
|
@ -47,6 +47,11 @@ void msleep(unsigned int msecs);
|
|||
unsigned long msleep_interruptible(unsigned int msecs);
|
||||
void usleep_range(unsigned long min, unsigned long max);
|
||||
|
||||
static inline void usleep(unsigned long usecs)
|
||||
{
|
||||
usleep_range(usecs, usecs);
|
||||
}
|
||||
|
||||
static inline void ssleep(unsigned int seconds)
|
||||
{
|
||||
msleep(seconds * 1000);
|
||||
|
|
Loading…
Reference in a new issue