diff options
| author | Patrick Pannuto <ppannuto@codeaurora.org> | 2010-07-19 15:09:26 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-05-22 11:06:47 +0200 |
| commit | 59bc76e7102d397fbe72e93e7fca2fa572df0bb8 (patch) | |
| tree | 36b5932b1f8da52e7d9f516dffeb6c2c352a2e91 /include/linux | |
| parent | b93332000206a6748fa7854991b9a221ffc73ec7 (diff) | |
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)
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/delay.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/delay.h b/include/linux/delay.h index a6ecb34cf..0e303d1aa 100644 --- a/include/linux/delay.h +++ b/include/linux/delay.h @@ -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); |
