Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212524
b: refs/heads/master
c: 7990147
h: refs/heads/master
v: v3
  • Loading branch information
Uwe Kleine-König authored and Sascha Hauer committed Oct 1, 2010
1 parent 08cd793 commit ddc500f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: 9f0c11ee67d9a5ab76c27d2f9dbdd9ee85fbce10
refs/heads/master: 79901478e0a2854c4becbb2e77f176bd7fa37caa
30 changes: 16 additions & 14 deletions trunk/arch/arm/mach-mx5/clock-mx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,36 @@ static struct clk usboh3_clk;

#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */

static int _clk_ccgr_enable(struct clk *clk)
static void _clk_ccgr_setclk(struct clk *clk, unsigned mode)
{
u32 reg;
u32 reg = __raw_readl(clk->enable_reg);

reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift);
reg |= mode << clk->enable_shift;

reg = __raw_readl(clk->enable_reg);
reg |= MXC_CCM_CCGRx_MOD_ON << clk->enable_shift;
__raw_writel(reg, clk->enable_reg);
}

static int _clk_ccgr_enable(struct clk *clk)
{
_clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_ON);
return 0;
}

static void _clk_ccgr_disable(struct clk *clk)
{
u32 reg;
reg = __raw_readl(clk->enable_reg);
reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift);
__raw_writel(reg, clk->enable_reg);
_clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_OFF);
}

static int _clk_ccgr_enable_inrun(struct clk *clk)
{
_clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_IDLE);
return 0;
}

static void _clk_ccgr_disable_inwait(struct clk *clk)
{
u32 reg;

reg = __raw_readl(clk->enable_reg);
reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift);
reg |= MXC_CCM_CCGRx_MOD_IDLE << clk->enable_shift;
__raw_writel(reg, clk->enable_reg);
_clk_ccgr_setclk(clk, MXC_CCM_CCGRx_MOD_IDLE);
}

/*
Expand Down

0 comments on commit ddc500f

Please sign in to comment.