Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Blackfin: implement ndelay()

Signed-off-by: Barry Song <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

authored by

Barry Song and committed by
Mike Frysinger
6388d14e 60ffdb36

+14 -2
+14 -2
arch/blackfin/include/asm/delay.h
··· 30 30 31 31 #define HZSCALE (268435456 / (1000000/HZ)) 32 32 33 - static inline void udelay(unsigned long usecs) 33 + static inline unsigned long __to_delay(unsigned long scale) 34 34 { 35 35 extern unsigned long loops_per_jiffy; 36 - __delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6); 36 + return (((scale * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6; 37 37 } 38 + 39 + static inline void udelay(unsigned long usecs) 40 + { 41 + __delay(__to_delay(usecs)); 42 + } 43 + 44 + static inline void ndelay(unsigned long nsecs) 45 + { 46 + __delay(__to_delay(1) * nsecs / 1000); 47 + } 48 + 49 + #define ndelay ndelay 38 50 39 51 #endif