summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2012-04-16 21:47:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-04-17 22:02:54 +0200
commitb0bab98abdb1070e8466919d1ef2006972c8ea3f (patch)
treebb878838a9cb83e2945a12f0acb0200ebf6645c1 /drivers
parent50b992bf3da8a6b9145c394dac327d2fdc077a17 (diff)
downloadbarebox-b0bab98abdb1070e8466919d1ef2006972c8ea3f.tar.gz
barebox-b0bab98abdb1070e8466919d1ef2006972c8ea3f.tar.xz
mci: pxamci change clocks handling
Fix clock handling accordingly to PXA manual : - enable the MMC controller clock once and for all - only disable the MMC bus clock when changing the MMCLK by adjusting the clock ratio, else let the controller and SD card shut down the clock as the see fit. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mci/pxamci.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mci/pxamci.c b/drivers/mci/pxamci.c
index ee2f08c407..2d49187c36 100644
--- a/drivers/mci/pxamci.c
+++ b/drivers/mci/pxamci.c
@@ -190,7 +190,6 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mci_cmd *cmd,
mmc_writel(cmd->cmdidx, MMC_CMD);
mmc_writel(cmd->cmdarg >> 16, MMC_ARGH);
mmc_writel(cmd->cmdarg & 0xffff, MMC_ARGL);
- mmc_writel(host->clkrt, MMC_CLKRT);
pxamci_start_clock(host);
mmc_writel(cmdat, MMC_CMDAT);
}
@@ -260,8 +259,6 @@ static int pxamci_request(struct mci_host *mci, struct mci_cmd *cmd,
unsigned int cmdat;
int ret;
- pxamci_stop_clock(host);
-
cmdat = host->cmdat;
host->cmdat &= ~CMDAT_INIT;
@@ -311,8 +308,9 @@ static void pxamci_set_ios(struct mci_host *mci, struct mci_ios *ios)
host->cmdat |= CMDAT_INIT;
- clk_enable();
pxamci_set_power(host, 1);
+ pxamci_stop_clock(host);
+ mmc_writel(host->clkrt, MMC_CLKRT);
}
static int pxamci_init(struct mci_host *mci, struct device_d *dev)
@@ -329,6 +327,7 @@ static int pxamci_probe(struct device_d *dev)
struct pxamci_host *host;
int gpio_power = -1;
+ clk_enable();
host = xzalloc(sizeof(*host));
host->base = dev_request_mem_region(dev, 0);