Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184621
b: refs/heads/master
c: b099474
h: refs/heads/master
i:
  184619: f73c9f6
v: v3
  • Loading branch information
Abhijit Pagare authored and Paul Walmsley committed Jan 27, 2010
1 parent bc59f07 commit 9ffee5e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84c0c39aec31a09571fc08a752a2f4da0fe9fcf2
refs/heads/master: b099474aa4e7fbaf5dc3b5858bc83dee2f94c60f
44 changes: 25 additions & 19 deletions trunk/arch/arm/mach-omap2/clockdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,29 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
*/
static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable)
{
u32 v;
u32 bits, v;

if (cpu_is_omap24xx()) {
if (enable)
v = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
else
v = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
} else if (cpu_is_omap34xx()) {
if (enable)
v = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
else
v = OMAP34XX_CLKSTCTRL_DISABLE_AUTO;
bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO;
} else {
BUG();
}

cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
v << __ffs(clkdm->clktrctrl_mask),
clkdm->pwrdm.ptr->prcm_offs, OMAP2_CM_CLKSTCTRL);
bits = bits << __ffs(clkdm->clktrctrl_mask);

v = __raw_readl(clkdm->clkstctrl_reg);
v &= ~(clkdm->clktrctrl_mask);
v |= bits;
__raw_writel(v, clkdm->clkstctrl_reg);

}

static struct clockdomain *_clkdm_lookup(const char *name)
Expand Down Expand Up @@ -381,7 +385,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
if (!clkdm)
return -EINVAL;

v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, OMAP2_CM_CLKSTCTRL);
v = __raw_readl(clkdm->clkstctrl_reg);
v &= clkdm->clktrctrl_mask;
v >>= __ffs(clkdm->clktrctrl_mask);

Expand Down Expand Up @@ -417,12 +421,13 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)

} else if (cpu_is_omap34xx()) {

u32 v = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
__ffs(clkdm->clktrctrl_mask));

cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
clkdm->pwrdm.ptr->prcm_offs,
OMAP2_CM_CLKSTCTRL);
u32 v = __raw_readl(clkdm->clkstctrl_reg);
v &= ~(clkdm->clktrctrl_mask);
v |= bits;
__raw_writel(v, clkdm->clkstctrl_reg);

} else {
BUG();
Expand Down Expand Up @@ -460,12 +465,13 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)

} else if (cpu_is_omap34xx()) {

u32 v = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
__ffs(clkdm->clktrctrl_mask));

cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
clkdm->pwrdm.ptr->prcm_offs,
OMAP2_CM_CLKSTCTRL);
u32 v = __raw_readl(clkdm->clkstctrl_reg);
v &= ~(clkdm->clktrctrl_mask);
v |= bits;
__raw_writel(v, clkdm->clkstctrl_reg);

} else {
BUG();
Expand Down Expand Up @@ -561,7 +567,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
* downstream clocks for debugging purposes?
*/

if (!clkdm || !clk || !clkdm->clktrctrl_mask)
if (!clkdm || !clk || !clkdm->clkstctrl_reg)
return -EINVAL;

if (atomic_inc_return(&clkdm->usecount) > 1)
Expand Down Expand Up @@ -612,7 +618,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
* downstream clocks for debugging purposes?
*/

if (!clkdm || !clk || !clkdm->clktrctrl_mask)
if (!clkdm || !clk || !clkdm->clkstctrl_reg)
return -EINVAL;

#ifdef DEBUG
Expand Down

0 comments on commit 9ffee5e

Please sign in to comment.