aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/powerdomain.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-05-18 20:47:24 -0400
committerPaul Walmsley <paul@pwsan.com>2010-05-20 14:31:05 -0400
commit2bc4ef71c5a3b6986b452d6c530777974d11ef4a (patch)
treefbb479aae791394b75fd598d279bb52cf015042d /arch/arm/mach-omap2/powerdomain.c
parentf38ca10a79a0cd9902b8a470901951354802faa1 (diff)
OMAP3 PRCM: convert OMAP3 PRCM macros to the _SHIFT/_MASK suffixes
Fix all of the remaining OMAP3 PRCM register shift/bitmask macros that did not use the _SHIFT/_MASK suffixes to use them. This makes the use of these macros consistent. It is intended to reduce error, as code can be inspected visually by reviewers to ensure that bitshifts and bitmasks are used in the appropriate places. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index ebfce7d1a5d3..637fdfe7acd4 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -64,10 +64,10 @@ static u16 pwrstst_reg_offs;
64#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK 64#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK
65 65
66/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */ 66/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */
67#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE 67#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK
68#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE 68#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE_MASK
69#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE 69#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK
70#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE 70#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE_MASK
71#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK 71#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK
72 72
73/* OMAP3 and OMAP4 Memory Status bits */ 73/* OMAP3 and OMAP4 Memory Status bits */
@@ -511,6 +511,8 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
511 */ 511 */
512int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) 512int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
513{ 513{
514 u32 v;
515
514 if (!pwrdm) 516 if (!pwrdm)
515 return -EINVAL; 517 return -EINVAL;
516 518
@@ -526,9 +528,9 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
526 * but the type of value returned is the same for each 528 * but the type of value returned is the same for each
527 * powerdomain. 529 * powerdomain.
528 */ 530 */
529 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE, 531 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
530 (pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE)), 532 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
531 pwrdm->prcm_offs, pwrstctrl_reg_offs); 533 pwrdm->prcm_offs, pwrstctrl_reg_offs);
532 534
533 return 0; 535 return 0;
534} 536}
@@ -676,8 +678,8 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
676 if (!pwrdm) 678 if (!pwrdm)
677 return -EINVAL; 679 return -EINVAL;
678 680
679 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 681 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstst_reg_offs,
680 pwrstst_reg_offs, OMAP3430_LOGICSTATEST); 682 OMAP3430_LOGICSTATEST_MASK);
681} 683}
682 684
683/** 685/**
@@ -700,7 +702,7 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
700 * powerdomain. 702 * powerdomain.
701 */ 703 */
702 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST, 704 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
703 OMAP3430_LASTLOGICSTATEENTERED); 705 OMAP3430_LASTLOGICSTATEENTERED_MASK);
704} 706}
705 707
706/** 708/**
@@ -723,7 +725,7 @@ int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
723 * powerdomain. 725 * powerdomain.
724 */ 726 */
725 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs, 727 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs,
726 OMAP3430_LOGICSTATEST); 728 OMAP3430_LOGICSTATEST_MASK);
727} 729}
728 730
729/** 731/**