summaryrefslogtreecommitdiffstats
path: root/drivers/mci/atmel_mci.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-25 16:17:40 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-25 19:52:14 +0100
commit7bd476801a0c75ca655b1e2a1dba4039aadce4d4 (patch)
tree1627652aec28bd905bab490b725e2739ad985eb3 /drivers/mci/atmel_mci.c
parent0a982835544c99d7d2405d2ace9b4cb5914af52f (diff)
downloadbarebox-7bd476801a0c75ca655b1e2a1dba4039aadce4d4.tar.gz
barebox-7bd476801a0c75ca655b1e2a1dba4039aadce4d4.tar.xz
atmel_mci: fix host init
disable interrupt and reset the IP at the probe set timout at the host init Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/atmel_mci.c')
-rw-r--r--drivers/mci/atmel_mci.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 72d92dc8ae..d5fdd1df81 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -60,13 +60,6 @@ struct atmel_mci {
| ATMCI_OVRE \
| ATMCI_UNRE)
-static void atmci_ip_reset(struct atmel_mci *host)
-{
- atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST | ATMCI_CR_MCIDIS);
- atmci_writel(host, ATMCI_DTOR, 0x7f);
- atmci_writel(host, ATMCI_IDR, ~0UL);
-}
-
static void atmci_set_clk_rate(struct atmel_mci *host,
unsigned int clock_min)
{
@@ -360,7 +353,8 @@ static int atmci_reset(struct mci_host *mci, struct device_d *mci_dev)
return -ENODEV;
clk_enable(host->clk);
- atmci_ip_reset(host);
+ atmci_writel(host, ATMCI_DTOR, 0x7f);
+ clk_disable(host->clk);
return 0;
}
@@ -519,7 +513,11 @@ static int atmci_probe(struct device_d *hw_dev)
return PTR_ERR(host->clk);
}
+ clk_enable(host->clk);
+ atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
+ atmci_writel(host, ATMCI_IDR, ~0UL);
host->bus_hz = clk_get_rate(host->clk);
+ clk_disable(host->clk);
host->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;