diff options
author | Ranjith Lohithakshan <ranjithl@ti.com> | 2010-02-24 14:05:54 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-02-24 14:05:54 -0500 |
commit | 419cc97d3678f0fca5e60b3853dd9c1371f67805 (patch) | |
tree | a3997e3f9ad52abf927597f8e241fb6dfb02ab00 /arch/arm/mach-omap2/prcm.c | |
parent | cde08f81b1d7952ae00c4be2165da629ef985522 (diff) |
OMAP2/3 clock: Extend find_idlest() to pass back idle state value
Current implementation defines clock idle state indicators based on the
cpu information (cpu_is_omap24xx() or cpu_is_omap34xx()) in a system wide
manner. This patch extends the find_idlest() function in clkops to pass
back the idle state indicator for that clock, thus allowing idle state
indicators to be defined on a per clock basis if required.
This is specifically needed on AM35xx devices as the new IPSS clocks
indicates the idle status (0 is idle, 1 is ready) in a way just
opposite to how its handled in OMAP3 (0 is ready, 1 is idle).
Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com>
[paul@pwsan.com: updated to apply after commit 98c45457 et seq.]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/prcm.c')
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index e8e121a41d6d..0f87fdce02a9 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -242,26 +242,22 @@ u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx) | |||
242 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness | 242 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness |
243 | * @reg: physical address of module IDLEST register | 243 | * @reg: physical address of module IDLEST register |
244 | * @mask: value to mask against to determine if the module is active | 244 | * @mask: value to mask against to determine if the module is active |
245 | * @idlest: idle state indicator (0 or 1) for the clock | ||
245 | * @name: name of the clock (for printk) | 246 | * @name: name of the clock (for printk) |
246 | * | 247 | * |
247 | * Returns 1 if the module indicated readiness in time, or 0 if it | 248 | * Returns 1 if the module indicated readiness in time, or 0 if it |
248 | * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. | 249 | * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. |
249 | */ | 250 | */ |
250 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name) | 251 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, |
252 | const char *name) | ||
251 | { | 253 | { |
252 | int i = 0; | 254 | int i = 0; |
253 | int ena = 0; | 255 | int ena = 0; |
254 | 256 | ||
255 | /* | 257 | if (idlest) |
256 | * 24xx uses 0 to indicate not ready, and 1 to indicate ready. | ||
257 | * 34xx reverses this, just to keep us on our toes | ||
258 | */ | ||
259 | if (cpu_is_omap24xx()) | ||
260 | ena = mask; | ||
261 | else if (cpu_is_omap34xx()) | ||
262 | ena = 0; | 258 | ena = 0; |
263 | else | 259 | else |
264 | BUG(); | 260 | ena = mask; |
265 | 261 | ||
266 | /* Wait for lock */ | 262 | /* Wait for lock */ |
267 | omap_test_timeout(((__raw_readl(reg) & mask) == ena), | 263 | omap_test_timeout(((__raw_readl(reg) & mask) == ena), |