]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/cm.h
OMAP2/3 clock: use clk->prcm_mod for all struct clk register addressing
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / cm.h
index 68e4971ff1ee25f6f040f79377657b677c591680..7750becd5d37c692295c29feb2037726460e003f 100644 (file)
 
 #include "prcm-common.h"
 
-#ifndef __ASSEMBLER__
-#define OMAP_CM_REGADDR(module, reg)                                   \
-       (__force void __iomem *)IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
-#endif
-
 #define OMAP2420_CM_REGADDR(module, reg)                               \
                        IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
 #define OMAP2430_CM_REGADDR(module, reg)                               \
 #define OMAP3430_CM_SYSCONFIG          OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
 #define OMAP3430_CM_POLCTRL            OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
 
-#define OMAP3430_CM_CLKOUT_CTRL                                                \
-                               OMAP34XX_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
-
-#ifndef __ASSEMBLER__
-
-/* Read-modify-write bits in a CM register */
-static __inline__ u32 __attribute__((unused)) cm_rmw_reg_bits(u32 mask,
-                                               u32 bits, void __iomem *va)
-{
-       u32 v;
-
-       v = __raw_readl(va);
-       v &= ~mask;
-       v |= bits;
-       __raw_writel(v, va);
-
-       return v;
-}
-
-#endif
+#define OMAP3430_CM_CLKOUT_CTRL_OFFSET                 0x0070
 
 /*
  * Module specific CM registers from CM_BASE + domain offset
@@ -118,22 +94,14 @@ static __inline__ u32 __attribute__((unused)) cm_rmw_reg_bits(u32 mask,
 
 extern u32 cm_read_mod_reg(s16 module, u16 idx);
 extern void cm_write_mod_reg(u32 val, s16 module, u16 idx);
+extern u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
 
-/* Read-modify-write bits in a CM register (by domain) */
-static __inline__ u32 __attribute__((unused)) cm_rmw_mod_reg_bits(u32 mask,
-                                               u32 bits, s16 module, s16 idx)
-{
-       return cm_rmw_reg_bits(mask, bits, OMAP_CM_REGADDR(module, idx));
-}
-
-static __inline__ u32 __attribute__((unused)) cm_set_mod_reg_bits(u32 bits,
-                                                       s16 module, s16 idx)
+static inline u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
 {
        return cm_rmw_mod_reg_bits(bits, bits, module, idx);
 }
 
-static __inline__ u32 __attribute__((unused)) cm_clear_mod_reg_bits(u32 bits,
-                                                       s16 module, s16 idx)
+static inline u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
 {
        return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
 }