diff options
author | Barry Song <barry.song@analog.com> | 2010-01-21 07:20:44 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-03-09 00:30:50 -0500 |
commit | 6388d14eb2dd3af655cee28ca2a1c56881e63e56 (patch) | |
tree | 271a0d335b09ee81c8f80b56fbae4b1e1d0b815e | |
parent | 60ffdb36547da2397d6cfefe9c752ebad16524f6 (diff) | |
download | op-kernel-dev-6388d14eb2dd3af655cee28ca2a1c56881e63e56.zip op-kernel-dev-6388d14eb2dd3af655cee28ca2a1c56881e63e56.tar.gz |
Blackfin: implement ndelay()
Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | arch/blackfin/include/asm/delay.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/blackfin/include/asm/delay.h b/arch/blackfin/include/asm/delay.h index c31f91c..171d8deb 100644 --- a/arch/blackfin/include/asm/delay.h +++ b/arch/blackfin/include/asm/delay.h @@ -30,10 +30,22 @@ __asm__ __volatile__ ( #define HZSCALE (268435456 / (1000000/HZ)) -static inline void udelay(unsigned long usecs) +static inline unsigned long __to_delay(unsigned long scale) { extern unsigned long loops_per_jiffy; - __delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6); + return (((scale * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6; +} + +static inline void udelay(unsigned long usecs) +{ + __delay(__to_delay(usecs)); } +static inline void ndelay(unsigned long nsecs) +{ + __delay(__to_delay(1) * nsecs / 1000); +} + +#define ndelay ndelay + #endif |