[ar71xx] preliminary support for the Ubiquiti RouterStation Pro
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1247-fix-glamo-mci-ensure-more-than-74-clocks-after-power.patch
1 From 8533927964761f4e2078ccd8607b90f5acc60b93 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Thu, 24 Jul 2008 00:04:54 +0100
4 Subject: [PATCH] fix-glamo-mci-ensure-more-than-74-clocks-after-power.patch
5
6 We are meant to run SD_CLK a little while after power-on for the SD
7 Card, but with the no idle clock changes we didn't take care about it.
8
9 This makes us sleep a little bit before disabling clock if we just
10 powered up the SD Card.
11
12 Signed-off-by: Andy Green <andy@openmoko.com>
13 ---
14 drivers/mfd/glamo/glamo-mci.c | 8 ++++++++
15 1 files changed, 8 insertions(+), 0 deletions(-)
16
17 diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
18 index 264a6bc..c2351e2 100644
19 --- a/drivers/mfd/glamo/glamo-mci.c
20 +++ b/drivers/mfd/glamo/glamo-mci.c
21 @@ -684,6 +684,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
22 struct glamo_mci_host *host = mmc_priv(mmc);
23 int n = 0;
24 int div;
25 + int powering = 0;
26
27 /* Set power */
28 switch(ios->power_mode) {
29 @@ -699,6 +700,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
30 glamo_engine_enable(glamo_mci_def_pdata.pglamo,
31 GLAMO_ENGINE_MMC);
32 glamo_mci_reset(host);
33 + powering = 1;
34 break;
35
36 case MMC_POWER_OFF:
37 @@ -716,6 +718,12 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
38 host->real_rate = __glamo_mci_set_card_clock(host, ios->clock, &div);
39 host->clk_div = div;
40
41 + /* after power-up, we are meant to give it >= 74 clocks so it can
42 + * initialize itself. Doubt any modern cards need it but anyway...
43 + */
44 + if (powering)
45 + msleep(1);
46 +
47 if (!sd_idleclk)
48 /* stop the clock to card, because we are idle until transfer */
49 __glamo_mci_fix_card_div(host, -1);
50 --
51 1.5.6.5
52
This page took 0.048745 seconds and 5 git commands to generate.