Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224339
b: refs/heads/master
c: cb7bbc7
h: refs/heads/master
i:
  224337: 508bc5c
  224335: 7d434b0
v: v3
  • Loading branch information
Grazvydas Ignotas authored and John W. Linville committed Nov 15, 2010
1 parent 53d314d commit 3ee2531
Show file tree
Hide file tree
Showing 5 changed files with 26 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: f81c1f48384d398dbe8f6c5b10377c7158086791
refs/heads/master: cb7bbc7a5535ab2333915b83391e1d846a0914df
15 changes: 9 additions & 6 deletions trunk/drivers/net/wireless/wl1251/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ void wl1251_disable_interrupts(struct wl1251 *wl)
wl->if_ops->disable_irq(wl);
}

static void wl1251_power_off(struct wl1251 *wl)
static int wl1251_power_off(struct wl1251 *wl)
{
wl->set_power(false);
return wl->if_ops->power(wl, false);
}

static void wl1251_power_on(struct wl1251 *wl)
static int wl1251_power_on(struct wl1251 *wl)
{
wl->set_power(true);
return wl->if_ops->power(wl, true);
}

static int wl1251_fetch_firmware(struct wl1251 *wl)
Expand Down Expand Up @@ -152,9 +152,12 @@ static void wl1251_fw_wakeup(struct wl1251 *wl)

static int wl1251_chip_wakeup(struct wl1251 *wl)
{
int ret = 0;
int ret;

ret = wl1251_power_on(wl);
if (ret < 0)
return ret;

wl1251_power_on(wl);
msleep(WL1251_POWER_ON_SLEEP);
wl->if_ops->reset(wl);

Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/net/wireless/wl1251/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ static void wl1251_disable_line_irq(struct wl1251 *wl)
return disable_irq(wl->irq);
}

static void wl1251_sdio_set_power(bool enable)
static int wl1251_sdio_set_power(struct wl1251 *wl, bool enable)
{
if (wl->set_power)
wl->set_power(enable);

return 0;
}

static struct wl1251_if_operations wl1251_sdio_ops = {
Expand All @@ -181,6 +185,7 @@ static struct wl1251_if_operations wl1251_sdio_ops = {
.write_elp = wl1251_sdio_write_elp,
.read_elp = wl1251_sdio_read_elp,
.reset = wl1251_sdio_reset,
.power = wl1251_sdio_set_power,
};

static int wl1251_platform_probe(struct platform_device *pdev)
Expand Down Expand Up @@ -239,7 +244,6 @@ static int wl1251_sdio_probe(struct sdio_func *func,
wl_sdio->func = func;
wl->if_priv = wl_sdio;
wl->if_ops = &wl1251_sdio_ops;
wl->set_power = wl1251_sdio_set_power;

if (wl12xx_board_data != NULL) {
wl->set_power = wl12xx_board_data->set_power;
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/wl1251/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,21 @@ static void wl1251_spi_disable_irq(struct wl1251 *wl)
return disable_irq(wl->irq);
}

static int wl1251_spi_set_power(struct wl1251 *wl, bool enable)
{
if (wl->set_power)
wl->set_power(enable);

return 0;
}

static const struct wl1251_if_operations wl1251_spi_ops = {
.read = wl1251_spi_read,
.write = wl1251_spi_write,
.reset = wl1251_spi_reset_wake,
.enable_irq = wl1251_spi_enable_irq,
.disable_irq = wl1251_spi_disable_irq,
.power = wl1251_spi_set_power,
};

static int __devinit wl1251_spi_probe(struct spi_device *spi)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/wl1251/wl1251.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ struct wl1251_if_operations {
void (*write)(struct wl1251 *wl, int addr, void *buf, size_t len);
void (*read_elp)(struct wl1251 *wl, int addr, u32 *val);
void (*write_elp)(struct wl1251 *wl, int addr, u32 val);
int (*power)(struct wl1251 *wl, bool enable);
void (*reset)(struct wl1251 *wl);
void (*enable_irq)(struct wl1251 *wl);
void (*disable_irq)(struct wl1251 *wl);
Expand Down

0 comments on commit 3ee2531

Please sign in to comment.