diff options
Diffstat (limited to 'arch/arm/mach-omap2/cm2xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/cm2xxx.c | 101 |
1 files changed, 2 insertions, 99 deletions
diff --git a/arch/arm/mach-omap2/cm2xxx.c b/arch/arm/mach-omap2/cm2xxx.c index 0827acb60584..1c6d69f4bf49 100644 --- a/arch/arm/mach-omap2/cm2xxx.c +++ b/arch/arm/mach-omap2/cm2xxx.c @@ -95,103 +95,6 @@ void omap2xxx_cm_set_dpll_auto_low_power_stop(void) _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE); } -/* - * APLL control - */ - -static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask) -{ - u32 v; - - v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); - v &= ~mask; - v |= m << __ffs(mask); - omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE); -} - -void omap2xxx_cm_set_apll54_disable_autoidle(void) -{ - _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, - OMAP24XX_AUTO_54M_MASK); -} - -void omap2xxx_cm_set_apll54_auto_low_power_stop(void) -{ - _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, - OMAP24XX_AUTO_54M_MASK); -} - -void omap2xxx_cm_set_apll96_disable_autoidle(void) -{ - _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP, - OMAP24XX_AUTO_96M_MASK); -} - -void omap2xxx_cm_set_apll96_auto_low_power_stop(void) -{ - _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE, - OMAP24XX_AUTO_96M_MASK); -} - -/* Enable an APLL if off */ -static int _omap2xxx_apll_enable(u8 enable_bit, u8 status_bit) -{ - u32 v, m; - - m = EN_APLL_LOCKED << enable_bit; - - v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN); - if (v & m) - return 0; /* apll already enabled */ - - v |= m; - omap2_cm_write_mod_reg(v, PLL_MOD, CM_CLKEN); - - omap2xxx_cm_wait_module_ready(0, PLL_MOD, 1, status_bit); - - /* - * REVISIT: Should we return an error code if - * omap2xxx_cm_wait_module_ready() fails? - */ - return 0; -} - -/* Stop APLL */ -static void _omap2xxx_apll_disable(u8 enable_bit) -{ - u32 v; - - v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN); - v &= ~(EN_APLL_LOCKED << enable_bit); - omap2_cm_write_mod_reg(v, PLL_MOD, CM_CLKEN); -} - -/* Enable an APLL if off */ -int omap2xxx_cm_apll54_enable(void) -{ - return _omap2xxx_apll_enable(OMAP24XX_EN_54M_PLL_SHIFT, - OMAP24XX_ST_54M_APLL_SHIFT); -} - -/* Enable an APLL if off */ -int omap2xxx_cm_apll96_enable(void) -{ - return _omap2xxx_apll_enable(OMAP24XX_EN_96M_PLL_SHIFT, - OMAP24XX_ST_96M_APLL_SHIFT); -} - -/* Stop APLL */ -void omap2xxx_cm_apll54_disable(void) -{ - _omap2xxx_apll_disable(OMAP24XX_EN_54M_PLL_SHIFT); -} - -/* Stop APLL */ -void omap2xxx_cm_apll96_disable(void) -{ - _omap2xxx_apll_disable(OMAP24XX_EN_96M_PLL_SHIFT); -} - /** * omap2xxx_cm_split_idlest_reg - split CM_IDLEST reg addr into its components * @idlest_reg: CM_IDLEST* virtual address @@ -242,8 +145,8 @@ static int omap2xxx_cm_split_idlest_reg(struct clk_omap_reg *idlest_reg, * (@prcm_mod, @idlest_id, @idlest_shift) is clocked. Return 0 upon * success or -EBUSY if the module doesn't enable in time. */ -int omap2xxx_cm_wait_module_ready(u8 part, s16 prcm_mod, u16 idlest_id, - u8 idlest_shift) +static int omap2xxx_cm_wait_module_ready(u8 part, s16 prcm_mod, u16 idlest_id, + u8 idlest_shift) { int ena = 0, i = 0; u8 cm_idlest_reg; |