aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prcm.c
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2010-09-21 12:34:10 -0400
committerPaul Walmsley <paul@pwsan.com>2010-09-21 17:11:42 -0400
commit16b040129e324598d13ff2e2b3469dc2e909ce12 (patch)
tree908190d1d2fb9938eda583ae08eb5240368222ad /arch/arm/mach-omap2/prcm.c
parent12b1fdb45c2594070bb36e39cd89a33547aad8fb (diff)
OMAP4: prcm: Add temporarily helper functions for rmw and read inside the PRM
Since OMAP4 is using an absolute address, the current PRM accessors are not useable. OMAP4 adaptation for these API are currently ongoing, so define temp version until the proper ones are defined. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/prcm.c')
-rw-r--r--arch/arm/mach-omap2/prcm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 96f461682c91..d4388d34c26a 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -216,6 +216,30 @@ u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
216 return v; 216 return v;
217} 217}
218 218
219/* Read a PRM register, AND it, and shift the result down to bit 0 */
220u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
221{
222 u32 v;
223
224 v = __raw_readl(reg);
225 v &= mask;
226 v >>= __ffs(mask);
227
228 return v;
229}
230
231/* Read-modify-write a register in a PRM module. Caller must lock */
232u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
233{
234 u32 v;
235
236 v = __raw_readl(reg);
237 v &= ~mask;
238 v |= bits;
239 __raw_writel(v, reg);
240
241 return v;
242}
219/* Read a register in a CM module */ 243/* Read a register in a CM module */
220u32 cm_read_mod_reg(s16 module, u16 idx) 244u32 cm_read_mod_reg(s16 module, u16 idx)
221{ 245{