Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313157
b: refs/heads/master
c: a0a30b6
h: refs/heads/master
i:
  313155: 37ce92b
v: v3
  • Loading branch information
Roland Stigge committed Jul 1, 2012
1 parent a8d1f65 commit c5d2eb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 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: b0d9ef0e2df67685ffc74b1bafa648261ede30c0
refs/heads/master: a0a30b6a69275c54542130a8391e0fda30a4553b
10 changes: 3 additions & 7 deletions trunk/arch/arm/mach-lpc32xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,24 +871,20 @@ static unsigned long mmc_round_rate(struct clk *clk, unsigned long rate)

static int mmc_set_rate(struct clk *clk, unsigned long rate)
{
u32 oldclk, tmp;
u32 tmp;
unsigned long prate, div, crate = mmc_round_rate(clk, rate);

prate = clk->parent->get_rate(clk->parent);

div = prate / crate;

/* The MMC clock must be on when accessing an MMC register */
oldclk = __raw_readl(LPC32XX_CLKPWR_MS_CTRL);
__raw_writel(oldclk | LPC32XX_CLKPWR_MSCARD_SDCARD_EN,
LPC32XX_CLKPWR_MS_CTRL);
tmp = __raw_readl(LPC32XX_CLKPWR_MS_CTRL) &
~LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(0xf);
tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div);
tmp |= LPC32XX_CLKPWR_MSCARD_SDCARD_DIV(div) |
LPC32XX_CLKPWR_MSCARD_SDCARD_EN;
__raw_writel(tmp, LPC32XX_CLKPWR_MS_CTRL);

__raw_writel(oldclk, LPC32XX_CLKPWR_MS_CTRL);

return 0;
}

Expand Down

0 comments on commit c5d2eb9

Please sign in to comment.