diff options
author | Eliad Peller <eliad@wizery.com> | 2011-06-06 05:21:55 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-06-27 06:35:53 -0400 |
commit | 6bb043321569ac356c790a8d3bd759742e1f9352 (patch) | |
tree | e02ff4f1e09d70a78cecbb1136408c0a3fde5272 | |
parent | 8a7cf3febbb2b7c1ade717ddb3065de67c5983c5 (diff) |
wl12xx_sdio: enable wowlan only if enable_irq_wake() succeeded
Some platforms don't support the wake_irq, so disable wowlan
in this case, and avoid the "Unbalanced IRQ wake disable"
warning on disable_irq_wake().
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/sdio.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 1 |
2 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c index 25215199049f..4dc4573b6861 100644 --- a/drivers/net/wireless/wl12xx/sdio.c +++ b/drivers/net/wireless/wl12xx/sdio.c | |||
@@ -272,17 +272,19 @@ static int __devinit wl1271_probe(struct sdio_func *func, | |||
272 | goto out_free; | 272 | goto out_free; |
273 | } | 273 | } |
274 | 274 | ||
275 | enable_irq_wake(wl->irq); | 275 | ret = enable_irq_wake(wl->irq); |
276 | device_init_wakeup(wl1271_sdio_wl_to_dev(wl), 1); | 276 | if (!ret) { |
277 | wl->irq_wake_enabled = true; | ||
278 | device_init_wakeup(wl1271_sdio_wl_to_dev(wl), 1); | ||
277 | 279 | ||
278 | disable_irq(wl->irq); | 280 | /* if sdio can keep power while host is suspended, enable wow */ |
279 | 281 | mmcflags = sdio_get_host_pm_caps(func); | |
280 | /* if sdio can keep power while host is suspended, enable wow */ | 282 | wl1271_debug(DEBUG_SDIO, "sdio PM caps = 0x%x", mmcflags); |
281 | mmcflags = sdio_get_host_pm_caps(func); | ||
282 | wl1271_debug(DEBUG_SDIO, "sdio PM caps = 0x%x", mmcflags); | ||
283 | 283 | ||
284 | if (mmcflags & MMC_PM_KEEP_POWER) | 284 | if (mmcflags & MMC_PM_KEEP_POWER) |
285 | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY; | 285 | hw->wiphy->wowlan.flags = WIPHY_WOWLAN_ANY; |
286 | } | ||
287 | disable_irq(wl->irq); | ||
286 | 288 | ||
287 | ret = wl1271_init_ieee80211(wl); | 289 | ret = wl1271_init_ieee80211(wl); |
288 | if (ret) | 290 | if (ret) |
@@ -316,8 +318,10 @@ static void __devexit wl1271_remove(struct sdio_func *func) | |||
316 | pm_runtime_get_noresume(&func->dev); | 318 | pm_runtime_get_noresume(&func->dev); |
317 | 319 | ||
318 | wl1271_unregister_hw(wl); | 320 | wl1271_unregister_hw(wl); |
319 | device_init_wakeup(wl1271_sdio_wl_to_dev(wl), 0); | 321 | if (wl->irq_wake_enabled) { |
320 | disable_irq_wake(wl->irq); | 322 | device_init_wakeup(wl1271_sdio_wl_to_dev(wl), 0); |
323 | disable_irq_wake(wl->irq); | ||
324 | } | ||
321 | free_irq(wl->irq, wl); | 325 | free_irq(wl->irq, wl); |
322 | wl1271_free_hw(wl); | 326 | wl1271_free_hw(wl); |
323 | } | 327 | } |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index 8d6c8f258413..145a14c22583 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -580,6 +580,7 @@ struct wl1271 { | |||
580 | * (currently, only "ANY" trigger is supported) | 580 | * (currently, only "ANY" trigger is supported) |
581 | */ | 581 | */ |
582 | bool wow_enabled; | 582 | bool wow_enabled; |
583 | bool irq_wake_enabled; | ||
583 | 584 | ||
584 | /* | 585 | /* |
585 | * AP-mode - links indexed by HLID. The global and broadcast links | 586 | * AP-mode - links indexed by HLID. The global and broadcast links |