Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[linux-2.6.git] / arch / arm / mach-omap2 / powerdomain2xxx_3xxx.c
index 838ac75..cf600e2 100644 (file)
@@ -18,8 +18,7 @@
 
 #include <plat/prcm.h>
 
-#include "prm-regbits-34xx.h"
-#include "powerdomains.h"
+#include "powerdomain.h"
 #include "prm.h"
 #include "prm-regbits-24xx.h"
 #include "prm-regbits-34xx.h"
@@ -28,7 +27,7 @@
 /* Common functions across OMAP2 and OMAP3 */
 static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 {
-       prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
+       omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
                                (pwrst << OMAP_POWERSTATE_SHIFT),
                                pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
        return 0;
@@ -36,14 +35,16 @@ static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
 
 static int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs,
-                               OMAP2_PM_PWSTCTRL, OMAP_POWERSTATE_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTCTRL,
+                                            OMAP_POWERSTATE_MASK);
 }
 
 static int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs,
-                               OMAP2_PM_PWSTST, OMAP_POWERSTATEST_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTST,
+                                            OMAP_POWERSTATEST_MASK);
 }
 
 static int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
@@ -53,8 +54,8 @@ static int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
 
        m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
 
-       prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
-                               OMAP2_PM_PWSTCTRL);
+       omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
+                                  OMAP2_PM_PWSTCTRL);
 
        return 0;
 }
@@ -66,8 +67,8 @@ static int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
 
        m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
 
-       prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
-                               OMAP2_PM_PWSTCTRL);
+       omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
+                                  OMAP2_PM_PWSTCTRL);
 
        return 0;
 }
@@ -78,7 +79,8 @@ static int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
 
        m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
 
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST, m);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
+                                            m);
 }
 
 static int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
@@ -87,7 +89,8 @@ static int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
 
        m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
 
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL, m);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTCTRL, m);
 }
 
 static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
@@ -95,8 +98,8 @@ static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
        u32 v;
 
        v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
-       prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
-                               pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+       omap2_prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
+                                  pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
 
        return 0;
 }
@@ -112,7 +115,7 @@ static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
         */
 
        /* XXX Is this udelay() value meaningful? */
-       while ((prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
+       while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
                OMAP_INTRANSITION_MASK) &&
                (c++ < PWRDM_TRANSITION_BAILOUT))
                        udelay(1);
@@ -131,26 +134,30 @@ static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
 /* Applicable only for OMAP3. Not supported on OMAP2 */
 static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
-                               OMAP3430_LASTPOWERSTATEENTERED_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP3430_PM_PREPWSTST,
+                                            OMAP3430_LASTPOWERSTATEENTERED_MASK);
 }
 
 static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
-                               OMAP3430_LOGICSTATEST_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTST,
+                                            OMAP3430_LOGICSTATEST_MASK);
 }
 
 static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL,
-                               OMAP3430_LOGICSTATEST_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP2_PM_PWSTCTRL,
+                                            OMAP3430_LOGICSTATEST_MASK);
 }
 
 static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
 {
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
-                               OMAP3430_LASTLOGICSTATEENTERED_MASK);
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
+                                            OMAP3430_PM_PREPWSTST,
+                                            OMAP3430_LASTLOGICSTATEENTERED_MASK);
 }
 
 static int omap3_get_mem_bank_lastmemst_mask(u8 bank)
@@ -177,26 +184,28 @@ static int omap3_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
 
        m = omap3_get_mem_bank_lastmemst_mask(bank);
 
-       return prm_read_mod_bits_shift(pwrdm->prcm_offs,
+       return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
                                OMAP3430_PM_PREPWSTST, m);
 }
 
 static int omap3_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
 {
-       prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
+       omap2_prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
        return 0;
 }
 
 static int omap3_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
 {
-       return prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
-                               pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+       return omap2_prm_rmw_mod_reg_bits(0,
+                                         1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
+                                         pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
 }
 
 static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
 {
-       return prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0,
-                               pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
+       return omap2_prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
+                                         0, pwrdm->prcm_offs,
+                                         OMAP2_PM_PWSTCTRL);
 }
 
 struct pwrdm_ops omap2_pwrdm_operations = {