aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>2010-03-18 06:26:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-23 16:50:19 -0400
commit93f56be146a7be4d3243fc64d9b6313d96eaa62b (patch)
treece410167a6c3f90f3ebdfc4e852d5623224357df /drivers/net/wireless
parentbecd551cac0d6868819083c59fc32d1072ba1804 (diff)
wl1271: Changed SDIO MMC host claiming
Changed driver to keep MMC host claimed while wlan interface is up. This keeps MMC stack from powering the SDIO device down. Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_sdio.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio.c b/drivers/net/wireless/wl12xx/wl1271_sdio.c
index d43e0d41d439..d9183b64e723 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio.c
+++ b/drivers/net/wireless/wl12xx/wl1271_sdio.c
@@ -107,7 +107,6 @@ static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
107 int ret; 107 int ret;
108 struct sdio_func *func = wl_to_func(wl); 108 struct sdio_func *func = wl_to_func(wl);
109 109
110 sdio_claim_host(func);
111 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 110 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
112 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret); 111 ((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
113 wl1271_debug(DEBUG_SPI, "sdio read 52 addr 0x%x, byte 0x%02x", 112 wl1271_debug(DEBUG_SPI, "sdio read 52 addr 0x%x, byte 0x%02x",
@@ -126,7 +125,6 @@ static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
126 if (ret) 125 if (ret)
127 wl1271_error("sdio read failed (%d)", ret); 126 wl1271_error("sdio read failed (%d)", ret);
128 127
129 sdio_release_host(func);
130} 128}
131 129
132static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf, 130static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
@@ -135,7 +133,6 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
135 int ret; 133 int ret;
136 struct sdio_func *func = wl_to_func(wl); 134 struct sdio_func *func = wl_to_func(wl);
137 135
138 sdio_claim_host(func);
139 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) { 136 if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
140 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret); 137 sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
141 wl1271_debug(DEBUG_SPI, "sdio write 52 addr 0x%x, byte 0x%02x", 138 wl1271_debug(DEBUG_SPI, "sdio write 52 addr 0x%x, byte 0x%02x",
@@ -153,11 +150,19 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
153 if (ret) 150 if (ret)
154 wl1271_error("sdio write failed (%d)", ret); 151 wl1271_error("sdio write failed (%d)", ret);
155 152
156 sdio_release_host(func);
157} 153}
158 154
159static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable) 155static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
160{ 156{
157 struct sdio_func *func = wl_to_func(wl);
158
159 if (enable) {
160 sdio_claim_host(func);
161 sdio_enable_func(func);
162 } else {
163 sdio_disable_func(func);
164 sdio_release_host(func);
165 }
161} 166}
162 167
163static struct wl1271_if_operations sdio_ops = { 168static struct wl1271_if_operations sdio_ops = {
@@ -219,22 +224,12 @@ static int __devinit wl1271_probe(struct sdio_func *func,
219 if (ret) 224 if (ret)
220 goto out_irq; 225 goto out_irq;
221 226
222 sdio_claim_host(func);
223 sdio_set_drvdata(func, wl); 227 sdio_set_drvdata(func, wl);
224 228
225 ret = sdio_enable_func(func);
226 if (ret)
227 goto out_release;
228
229 sdio_release_host(func);
230
231 wl1271_notice("initialized"); 229 wl1271_notice("initialized");
232 230
233 return 0; 231 return 0;
234 232
235 out_release:
236 sdio_release_host(func);
237
238 out_irq: 233 out_irq:
239 free_irq(wl->irq, wl); 234 free_irq(wl->irq, wl);
240 235
@@ -251,10 +246,6 @@ static void __devexit wl1271_remove(struct sdio_func *func)
251 246
252 ieee80211_unregister_hw(wl->hw); 247 ieee80211_unregister_hw(wl->hw);
253 248
254 sdio_claim_host(func);
255 sdio_disable_func(func);
256 sdio_release_host(func);
257
258 free_irq(wl->irq, wl); 249 free_irq(wl->irq, wl);
259 250
260 kfree(wl->target_mem_map); 251 kfree(wl->target_mem_map);