diff options
author | 2015-04-29 17:50:03 +0300 | |
---|---|---|
committer | 2015-05-09 16:42:27 +0300 | |
commit | bd763482c82ea24aacb51e0ba92b24074143bc86 (patch) | |
tree | e1fcab6dfb5cd40d281bb61bf268a4e83a81851a /drivers/net/wireless/ti/wlcore | |
parent | wireless: fix typos in mwifiex and rtlwifi (diff) | |
download | linux-dev-bd763482c82ea24aacb51e0ba92b24074143bc86.tar.xz linux-dev-bd763482c82ea24aacb51e0ba92b24074143bc86.zip |
wl18xx: wlan_irq: support platform dependent interrupt types
* Interrupt request need to happen when the wilink chip is powered on and
driving the wlan_irq line. This avoids spurious interrupt issues that
are a result of different external pulls configuration on different
platforms
* Allow working with wl18xx level-low and falling edge irqs by configuring
wl18xx to invert the device interrupt
Signed-off-by: Eyal Reizer <eyalr@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 0be807951afe..c39a07b16591 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -5966,10 +5966,6 @@ static int wl12xx_get_hw_info(struct wl1271 *wl) { int ret; - ret = wl12xx_set_power_on(wl); - if (ret < 0) - return ret; - ret = wlcore_read_reg(wl, REG_CHIP_ID_B, &wl->chip.id); if (ret < 0) goto out; @@ -5985,7 +5981,6 @@ static int wl12xx_get_hw_info(struct wl1271 *wl) ret = wl->ops->get_mac(wl); out: - wl1271_power_off(wl); return ret; } @@ -6432,10 +6427,22 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) else wl->irq_flags |= IRQF_ONESHOT; + ret = wl12xx_set_power_on(wl); + if (ret < 0) + goto out_free_nvs; + + ret = wl12xx_get_hw_info(wl); + if (ret < 0) { + wl1271_error("couldn't get hw info"); + wl1271_power_off(wl); + goto out_free_nvs; + } + ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq, wl->irq_flags, pdev->name, wl); if (ret < 0) { - wl1271_error("request_irq() failed: %d", ret); + wl1271_error("interrupt configuration failed"); + wl1271_power_off(wl); goto out_free_nvs; } @@ -6449,12 +6456,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) } #endif disable_irq(wl->irq); - - ret = wl12xx_get_hw_info(wl); - if (ret < 0) { - wl1271_error("couldn't get hw info"); - goto out_irq; - } + wl1271_power_off(wl); ret = wl->ops->identify_chip(wl); if (ret < 0) |