xref: /openbmc/u-boot/include/linux/delay.h (revision 3ebd892f)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef _LINUX_DELAY_H
4 #define _LINUX_DELAY_H
5 
6 #include <linux/kernel.h>
7 
8 void __udelay(unsigned long usec);
9 void udelay(unsigned long usec);
10 
11 static inline void mdelay(unsigned long msec)
12 {
13 	while (msec--)
14 		udelay(1000);
15 }
16 
17 static inline void ndelay(unsigned long nsec)
18 {
19 	udelay(DIV_ROUND_UP(nsec, 1000));
20 }
21 
22 #endif /* defined(_LINUX_DELAY_H) */
23