Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72952
b: refs/heads/master
c: d8cb70d
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Oct 31, 2007
1 parent c94266c commit eecfba2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 5984a2fc7e7c9ab118e78ae9799e98fc4ade40f9
refs/heads/master: d8cb70d10a2d4e6b083b89044a68d860d0bf1eec
11 changes: 9 additions & 2 deletions trunk/drivers/mmc/host/pxamci.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define DRIVER_NAME "pxa2xx-mci"

#define NR_SG 1
#define CLKRT_OFF (~0)

struct pxamci_host {
struct mmc_host *mmc;
Expand Down Expand Up @@ -371,6 +372,9 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
unsigned long rate = host->clkrate;
unsigned int clk = rate / ios->clock;

if (host->clkrt == CLKRT_OFF)
clk_enable(host->clk);

/*
* clk might result in a lower divisor than we
* desire. check for that condition and adjust
Expand All @@ -379,14 +383,16 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (rate / clk > ios->clock)
clk <<= 1;
host->clkrt = fls(clk) - 1;
clk_enable(host->clk);

/*
* we write clkrt on the next command
*/
} else {
pxamci_stop_clock(host);
clk_disable(host->clk);
if (host->clkrt != CLKRT_OFF) {
host->clkrt = CLKRT_OFF;
clk_disable(host->clk);
}
}

if (host->power_mode != ios->power_mode) {
Expand Down Expand Up @@ -498,6 +504,7 @@ static int pxamci_probe(struct platform_device *pdev)
host->mmc = mmc;
host->dma = -1;
host->pdata = pdev->dev.platform_data;
host->clkrt = CLKRT_OFF;

host->clk = clk_get(&pdev->dev, "MMCCLK");
if (IS_ERR(host->clk)) {
Expand Down

0 comments on commit eecfba2

Please sign in to comment.