diff options
Diffstat (limited to 'arch/arm/plat-omap/include/plat/common.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/common.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index 064f1730f43b..e9779676448b 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
@@ -71,4 +71,24 @@ void omap2_set_globals_sdrc(struct omap_globals *); | |||
71 | void omap2_set_globals_control(struct omap_globals *); | 71 | void omap2_set_globals_control(struct omap_globals *); |
72 | void omap2_set_globals_prcm(struct omap_globals *); | 72 | void omap2_set_globals_prcm(struct omap_globals *); |
73 | 73 | ||
74 | /** | ||
75 | * omap_test_timeout - busy-loop, testing a condition | ||
76 | * @cond: condition to test until it evaluates to true | ||
77 | * @timeout: maximum number of microseconds in the timeout | ||
78 | * @index: loop index (integer) | ||
79 | * | ||
80 | * Loop waiting for @cond to become true or until at least @timeout | ||
81 | * microseconds have passed. To use, define some integer @index in the | ||
82 | * calling code. After running, if @index == @timeout, then the loop has | ||
83 | * timed out. | ||
84 | */ | ||
85 | #define omap_test_timeout(cond, timeout, index) \ | ||
86 | ({ \ | ||
87 | for (index = 0; index < timeout; index++) { \ | ||
88 | if (cond) \ | ||
89 | break; \ | ||
90 | udelay(1); \ | ||
91 | } \ | ||
92 | }) | ||
93 | |||
74 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ | 94 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ |