Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 216851
b: refs/heads/master
c: 16b0401
h: refs/heads/master
i:
  216849: 614b7c3
  216847: aa5487b
v: v3
  • Loading branch information
Benoit Cousson authored and Paul Walmsley committed Sep 21, 2010
1 parent a3d6430 commit bc50efb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12b1fdb45c2594070bb36e39cd89a33547aad8fb
refs/heads/master: 16b040129e324598d13ff2e2b3469dc2e909ce12
24 changes: 24 additions & 0 deletions trunk/arch/arm/mach-omap2/prcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,30 @@ u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
return v;
}

/* Read a PRM register, AND it, and shift the result down to bit 0 */
u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
{
u32 v;

v = __raw_readl(reg);
v &= mask;
v >>= __ffs(mask);

return v;
}

/* Read-modify-write a register in a PRM module. Caller must lock */
u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
{
u32 v;

v = __raw_readl(reg);
v &= ~mask;
v |= bits;
__raw_writel(v, reg);

return v;
}
/* Read a register in a CM module */
u32 cm_read_mod_reg(s16 module, u16 idx)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/plat-omap/include/plat/prcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ u32 prm_read_mod_reg(s16 module, u16 idx);
void prm_write_mod_reg(u32 val, s16 module, u16 idx);
u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
u32 cm_read_mod_reg(s16 module, u16 idx);
void cm_write_mod_reg(u32 val, s16 module, u16 idx);
u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
Expand Down

0 comments on commit bc50efb

Please sign in to comment.