Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214635
b: refs/heads/master
c: 49063a0
h: refs/heads/master
i:
  214633: f1dbd9c
  214631: dec6605
v: v3
  • Loading branch information
Ohad Ben-Cohen authored and John W. Linville committed Sep 14, 2010
1 parent db013f7 commit a063520
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d7e1e6b1b8ed456e7678130ad17086a5f5b3286
refs/heads/master: 49063a0d0b65e40ece846a744cb10cbdf295515d
43 changes: 35 additions & 8 deletions trunk/drivers/net/wireless/wl12xx/wl1271_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
int ret;
struct sdio_func *func = wl_to_func(wl);

sdio_claim_host(func);

if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
((u8 *)buf)[0] = sdio_f0_readb(func, addr, &ret);
wl1271_debug(DEBUG_SDIO, "sdio read 52 addr 0x%x, byte 0x%02x",
Expand All @@ -122,9 +124,10 @@ static void wl1271_sdio_raw_read(struct wl1271 *wl, int addr, void *buf,
wl1271_dump_ascii(DEBUG_SDIO, "data: ", buf, len);
}

sdio_release_host(func);

if (ret)
wl1271_error("sdio read failed (%d)", ret);

}

static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
Expand All @@ -133,6 +136,8 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
int ret;
struct sdio_func *func = wl_to_func(wl);

sdio_claim_host(func);

if (unlikely(addr == HW_ACCESS_ELP_CTRL_REG_ADDR)) {
sdio_f0_writeb(func, ((u8 *)buf)[0], addr, &ret);
wl1271_debug(DEBUG_SDIO, "sdio write 52 addr 0x%x, byte 0x%02x",
Expand All @@ -147,9 +152,33 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
else
ret = sdio_memcpy_toio(func, addr, buf, len);
}

sdio_release_host(func);

if (ret)
wl1271_error("sdio write failed (%d)", ret);
}

static int wl1271_sdio_power_on(struct wl1271 *wl)
{
struct sdio_func *func = wl_to_func(wl);

sdio_claim_host(func);
sdio_enable_func(func);
sdio_release_host(func);

return 0;
}

static int wl1271_sdio_power_off(struct wl1271 *wl)
{
struct sdio_func *func = wl_to_func(wl);

sdio_claim_host(func);
sdio_disable_func(func);
sdio_release_host(func);

return 0;
}

static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
Expand All @@ -160,13 +189,11 @@ static void wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
* keep host claimed while wlan is in use to keep wl1271
* alive.
*/
if (enable) {
sdio_claim_host(func);
sdio_enable_func(func);
} else {
sdio_disable_func(func);
sdio_release_host(func);
}
if (enable)
return wl1271_sdio_power_on(wl);
else
return wl1271_sdio_power_off(wl);

}

static struct wl1271_if_operations sdio_ops = {
Expand Down

0 comments on commit a063520

Please sign in to comment.