This patch enable up/down of wlan wl1271 with ifconfig up/down on 
kernel-mid-2.6.35.3-31.1.

Regards
---------------------------------------------------------------------------------------------

>From d5890470e1783398b45e618147685ff928f737f4 Mon Sep 17 00:00:00 2001
From: Jonathan DE CESCO <[email protected]>
Date: Mon, 29 Nov 2010 15:45:36 +0100
Subject: [PATCH] sdhci: add regulator power up/down handling

- add mmc_regulator_set_ocr in sdhci_set_power.
- rework spin_locks in sdhci_set_ios.
- remove regulator_enable in sdhci_try_get_regulator because this function is 
called by mmc_regulator_set_ocr.

Signed-off-by: Sebastien Busson <[email protected]>
---
 drivers/mmc/host/sdhci.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7b9a3b3..3b1ae3b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1104,6 +1104,9 @@ static void sdhci_set_power(struct sdhci_host *host, 
unsigned short power)
        u8 pwr = 0;
 
        if (power != (unsigned short)-1) {
+               if (host->vmmc)
+                       mmc_regulator_set_ocr(host->mmc, host->vmmc
+                               , host->mmc->ios.vdd);
                switch (1 << power) {
                case MMC_VDD_165_195:
                        pwr = SDHCI_POWER_180;
@@ -1119,6 +1122,9 @@ static void sdhci_set_power(struct sdhci_host *host, 
unsigned short power)
                default:
                        BUG();
                }
+       } else {
+               if (host->vmmc)
+                       mmc_regulator_set_ocr(host->mmc, host->vmmc, 0);
        }
 
        if (host->pwr == pwr)
@@ -1228,11 +1234,13 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct 
mmc_ios *ios)
 
        sdhci_set_clock(host, ios->clock);
 
+       spin_unlock_irqrestore(&host->lock, flags);
        if (ios->power_mode == MMC_POWER_OFF)
                sdhci_set_power(host, -1);
        else
                sdhci_set_power(host, ios->vdd);
 
+       spin_lock_irqsave(&host->lock, flags);
        if (host->ops->platform_send_init_74_clocks)
                host->ops->platform_send_init_74_clocks(host, ios->power_mode);
 
@@ -1796,7 +1804,6 @@ void sdhci_try_get_regulator(struct sdhci_host *host)
                        if (!host->vmmc) {
                                host->vmmc = vmmc;
                                spin_unlock_irqrestore(&host->lock, flags);
-                               regulator_enable(host->vmmc);
                                mmc_detect_change(host->mmc, 0);
                        } else {
                          /* race! we got the regulator twice */
-- 
1.7.2.3

--------------------------------------------------
Sébastien Busson
System Integration Engineer
CELAD on behalf of UMG - MIPE - WSIV


Intel France
134 av Eisenhower
BP 72329
31023 Toulouse Cedex 1
France



---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Attachment: 0001-sdhci-add-regulator-power-up-down-handling.patch
Description: 0001-sdhci-add-regulator-power-up-down-handling.patch

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to