aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:09:58 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:58 +0000
commit4687c8c75b6ae4fb71c3821d116bcbc9379886ec (patch)
tree96350d574ef5d2649bac2aac4d825f42a8223cca /drivers/mfd
parent7238eb667b1b4622e37e4a2b40caf9c49312c6bf (diff)
fix-glamo-mci-ensure-more-than-74-clocks-after-power.patch
We are meant to run SD_CLK a little while after power-on for the SD Card, but with the no idle clock changes we didn't take care about it. This makes us sleep a little bit before disabling clock if we just powered up the SD Card. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/glamo/glamo-mci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index 505be5f89b6..0d829557439 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -684,6 +684,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
struct glamo_mci_host *host = mmc_priv(mmc);
int n = 0;
int div;
+ int powering = 0;
/* Set power */
switch(ios->power_mode) {
@@ -699,6 +700,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
glamo_engine_enable(glamo_mci_def_pdata.pglamo,
GLAMO_ENGINE_MMC);
glamo_mci_reset(host);
+ powering = 1;
break;
case MMC_POWER_OFF:
@@ -716,6 +718,12 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->real_rate = __glamo_mci_set_card_clock(host, ios->clock, &div);
host->clk_div = div;
+ /* after power-up, we are meant to give it >= 74 clocks so it can
+ * initialize itself. Doubt any modern cards need it but anyway...
+ */
+ if (powering)
+ msleep(1);
+
if (!sd_idleclk)
/* stop the clock to card, because we are idle until transfer */
__glamo_mci_fix_card_div(host, -1);