diff options
author | Shahar Levi <shahar_levi@ti.com> | 2011-09-12 10:00:37 +0300 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-09-23 14:11:31 +0300 |
commit | d3b104ae22a761dbec8410e6e66ac048c9ff9b5f (patch) | |
tree | fef3c96d8c375d184d6a830c0a38d7ddd977beec /drivers/net/wireless/wl12xx/sdio_test.c | |
parent | 6cd9d21a0c1e2648c07c32c66bb25795ad3208aa (diff) | |
download | blackbird-op-linux-d3b104ae22a761dbec8410e6e66ac048c9ff9b5f.tar.gz blackbird-op-linux-d3b104ae22a761dbec8410e6e66ac048c9ff9b5f.zip |
wl12xx: fix sdio_test module functionality
Due to some changes in PM in recent kernels, the sdio_test module has
been broken for a while. This patch fixes the code that powers the
card on and off.
Also made some small indentation fixes in the Makefile.
[Rephrased commit log and removed the change in the FW name, since
it's done in another patch. -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/sdio_test.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/sdio_test.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c index c3610492852e..f25d5d9212e7 100644 --- a/drivers/net/wireless/wl12xx/sdio_test.c +++ b/drivers/net/wireless/wl12xx/sdio_test.c @@ -30,6 +30,7 @@ #include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_ids.h> #include <linux/mmc/card.h> +#include <linux/mmc/host.h> #include <linux/gpio.h> #include <linux/wl12xx.h> #include <linux/kthread.h> @@ -142,14 +143,23 @@ static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable) ret = pm_runtime_get_sync(&func->dev); if (ret < 0) goto out; + + /* Runtime PM might be disabled, power up the card manually */ + ret = mmc_power_restore_host(func->card->host); + if (ret < 0) + goto out; + sdio_claim_host(func); sdio_enable_func(func); - sdio_release_host(func); } else { - sdio_claim_host(func); sdio_disable_func(func); sdio_release_host(func); + /* Runtime PM might be disabled, power off the card manually */ + ret = mmc_power_save_host(func->card->host); + if (ret < 0) + goto out; + /* Power down the card */ ret = pm_runtime_put_sync(&func->dev); } @@ -433,7 +443,6 @@ static int __devinit wl1271_probe(struct sdio_func *func, sdio_set_drvdata(func, wl_test); - /* power up the device */ ret = wl1271_chip_wakeup(wl); if (ret) { |