aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/include/asm/delay.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/blackfin/include/asm/delay.h b/arch/blackfin/include/asm/delay.h
index c31f91cc1d5d..171d8deb04a5 100644
--- a/arch/blackfin/include/asm/delay.h
+++ b/arch/blackfin/include/asm/delay.h
@@ -30,10 +30,22 @@ __asm__ __volatile__ (
30 30
31#define HZSCALE (268435456 / (1000000/HZ)) 31#define HZSCALE (268435456 / (1000000/HZ))
32 32
33static inline void udelay(unsigned long usecs) 33static inline unsigned long __to_delay(unsigned long scale)
34{ 34{
35 extern unsigned long loops_per_jiffy; 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}
38
39static inline void udelay(unsigned long usecs)
40{
41 __delay(__to_delay(usecs));
37} 42}
38 43
44static inline void ndelay(unsigned long nsecs)
45{
46 __delay(__to_delay(1) * nsecs / 1000);
47}
48
49#define ndelay ndelay
50
39#endif 51#endif