File tree Expand file tree Collapse file tree 4 files changed +25
-8
lines changed
drivers/net/wireless/wl1251 Expand file tree Collapse file tree 4 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,14 @@ void wl1251_disable_interrupts(struct wl1251 *wl)
52
52
wl -> if_ops -> disable_irq (wl );
53
53
}
54
54
55
- static void wl1251_power_off (struct wl1251 * wl )
55
+ static int wl1251_power_off (struct wl1251 * wl )
56
56
{
57
- wl -> set_power ( false);
57
+ return wl -> if_ops -> power ( wl , false);
58
58
}
59
59
60
- static void wl1251_power_on (struct wl1251 * wl )
60
+ static int wl1251_power_on (struct wl1251 * wl )
61
61
{
62
- wl -> set_power ( true);
62
+ return wl -> if_ops -> power ( wl , true);
63
63
}
64
64
65
65
static int wl1251_fetch_firmware (struct wl1251 * wl )
@@ -152,9 +152,12 @@ static void wl1251_fw_wakeup(struct wl1251 *wl)
152
152
153
153
static int wl1251_chip_wakeup (struct wl1251 * wl )
154
154
{
155
- int ret = 0 ;
155
+ int ret ;
156
+
157
+ ret = wl1251_power_on (wl );
158
+ if (ret < 0 )
159
+ return ret ;
156
160
157
- wl1251_power_on (wl );
158
161
msleep (WL1251_POWER_ON_SLEEP );
159
162
wl -> if_ops -> reset (wl );
160
163
Original file line number Diff line number Diff line change @@ -171,8 +171,12 @@ static void wl1251_disable_line_irq(struct wl1251 *wl)
171
171
return disable_irq (wl -> irq );
172
172
}
173
173
174
- static void wl1251_sdio_set_power (bool enable )
174
+ static int wl1251_sdio_set_power (struct wl1251 * wl , bool enable )
175
175
{
176
+ if (wl -> set_power )
177
+ wl -> set_power (enable );
178
+
179
+ return 0 ;
176
180
}
177
181
178
182
static struct wl1251_if_operations wl1251_sdio_ops = {
@@ -181,6 +185,7 @@ static struct wl1251_if_operations wl1251_sdio_ops = {
181
185
.write_elp = wl1251_sdio_write_elp ,
182
186
.read_elp = wl1251_sdio_read_elp ,
183
187
.reset = wl1251_sdio_reset ,
188
+ .power = wl1251_sdio_set_power ,
184
189
};
185
190
186
191
static int wl1251_platform_probe (struct platform_device * pdev )
@@ -239,7 +244,6 @@ static int wl1251_sdio_probe(struct sdio_func *func,
239
244
wl_sdio -> func = func ;
240
245
wl -> if_priv = wl_sdio ;
241
246
wl -> if_ops = & wl1251_sdio_ops ;
242
- wl -> set_power = wl1251_sdio_set_power ;
243
247
244
248
if (wl12xx_board_data != NULL ) {
245
249
wl -> set_power = wl12xx_board_data -> set_power ;
Original file line number Diff line number Diff line change @@ -215,12 +215,21 @@ static void wl1251_spi_disable_irq(struct wl1251 *wl)
215
215
return disable_irq (wl -> irq );
216
216
}
217
217
218
+ static int wl1251_spi_set_power (struct wl1251 * wl , bool enable )
219
+ {
220
+ if (wl -> set_power )
221
+ wl -> set_power (enable );
222
+
223
+ return 0 ;
224
+ }
225
+
218
226
static const struct wl1251_if_operations wl1251_spi_ops = {
219
227
.read = wl1251_spi_read ,
220
228
.write = wl1251_spi_write ,
221
229
.reset = wl1251_spi_reset_wake ,
222
230
.enable_irq = wl1251_spi_enable_irq ,
223
231
.disable_irq = wl1251_spi_disable_irq ,
232
+ .power = wl1251_spi_set_power ,
224
233
};
225
234
226
235
static int __devinit wl1251_spi_probe (struct spi_device * spi )
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ struct wl1251_if_operations {
256
256
void (* write )(struct wl1251 * wl , int addr , void * buf , size_t len );
257
257
void (* read_elp )(struct wl1251 * wl , int addr , u32 * val );
258
258
void (* write_elp )(struct wl1251 * wl , int addr , u32 val );
259
+ int (* power )(struct wl1251 * wl , bool enable );
259
260
void (* reset )(struct wl1251 * wl );
260
261
void (* enable_irq )(struct wl1251 * wl );
261
262
void (* disable_irq )(struct wl1251 * wl );
You can’t perform that action at this time.
0 commit comments