diff options
Diffstat (limited to 'arch/arm/plat-omap/include/plat/common.h')
-rw-r--r-- | arch/arm/plat-omap/include/plat/common.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index 064f1730f43..32c22272425 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H | 27 | #ifndef __ARCH_ARM_MACH_OMAP_COMMON_H |
28 | #define __ARCH_ARM_MACH_OMAP_COMMON_H | 28 | #define __ARCH_ARM_MACH_OMAP_COMMON_H |
29 | 29 | ||
30 | #include <linux/i2c.h> | 30 | #include <plat/i2c.h> |
31 | 31 | ||
32 | struct sys_timer; | 32 | struct sys_timer; |
33 | 33 | ||
@@ -36,18 +36,6 @@ extern void __iomem *gic_cpu_base_addr; | |||
36 | 36 | ||
37 | extern void omap_map_common_io(void); | 37 | extern void omap_map_common_io(void); |
38 | extern struct sys_timer omap_timer; | 38 | extern struct sys_timer omap_timer; |
39 | #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) | ||
40 | extern int omap_register_i2c_bus(int bus_id, u32 clkrate, | ||
41 | struct i2c_board_info const *info, | ||
42 | unsigned len); | ||
43 | #else | ||
44 | static inline int omap_register_i2c_bus(int bus_id, u32 clkrate, | ||
45 | struct i2c_board_info const *info, | ||
46 | unsigned len) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | #endif | ||
51 | 39 | ||
52 | /* IO bases for various OMAP processors */ | 40 | /* IO bases for various OMAP processors */ |
53 | struct omap_globals { | 41 | struct omap_globals { |
@@ -58,6 +46,7 @@ struct omap_globals { | |||
58 | void __iomem *ctrl; /* System Control Module */ | 46 | void __iomem *ctrl; /* System Control Module */ |
59 | void __iomem *prm; /* Power and Reset Management */ | 47 | void __iomem *prm; /* Power and Reset Management */ |
60 | void __iomem *cm; /* Clock Management */ | 48 | void __iomem *cm; /* Clock Management */ |
49 | void __iomem *cm2; | ||
61 | }; | 50 | }; |
62 | 51 | ||
63 | void omap2_set_globals_242x(void); | 52 | void omap2_set_globals_242x(void); |
@@ -71,4 +60,24 @@ void omap2_set_globals_sdrc(struct omap_globals *); | |||
71 | void omap2_set_globals_control(struct omap_globals *); | 60 | void omap2_set_globals_control(struct omap_globals *); |
72 | void omap2_set_globals_prcm(struct omap_globals *); | 61 | void omap2_set_globals_prcm(struct omap_globals *); |
73 | 62 | ||
63 | /** | ||
64 | * omap_test_timeout - busy-loop, testing a condition | ||
65 | * @cond: condition to test until it evaluates to true | ||
66 | * @timeout: maximum number of microseconds in the timeout | ||
67 | * @index: loop index (integer) | ||
68 | * | ||
69 | * Loop waiting for @cond to become true or until at least @timeout | ||
70 | * microseconds have passed. To use, define some integer @index in the | ||
71 | * calling code. After running, if @index == @timeout, then the loop has | ||
72 | * timed out. | ||
73 | */ | ||
74 | #define omap_test_timeout(cond, timeout, index) \ | ||
75 | ({ \ | ||
76 | for (index = 0; index < timeout; index++) { \ | ||
77 | if (cond) \ | ||
78 | break; \ | ||
79 | udelay(1); \ | ||
80 | } \ | ||
81 | }) | ||
82 | |||
74 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ | 83 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ |