aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorLuciano Coelho <luca@coelho.fi>2015-03-18 12:38:25 -0400
committerTony Lindgren <tony@atomide.com>2015-03-19 17:20:50 -0400
commit6f921fab5844941f7605b7f1a265f5fc7fe969a7 (patch)
tree0a9c9e42ff1ea15780aa9bea90361c0afd769c6a /drivers/net/wireless
parent06e5801b8cb3fc057d88cb4dc03c0b64b2744cda (diff)
wlcore: set irq_trigger in board files instead of hiding behind a quirk
The platform_quirk element in the platform data was used to change the way the IRQ is triggered. When set, the EDGE_IRQ quirk would change the irqflags used and treat edge trigger differently from the rest. Instead of hiding this irq flag setting behind the quirk, have the board files set the irq_trigger explicitly. This will allow us to use standard irq DT definitions later on. Signed-off-by: Luciano Coelho <luca@coelho.fi> [Eliad - rebase, add irq_trigger field and pass it, update board file changes] Signed-off-by: Eliad Peller <eliad@wizery.com> Tested-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wlcore/debugfs.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c27
-rw-r--r--drivers/net/wireless/ti/wlcore/sdio.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h5
4 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index 68f3bf229b5a..eb43f94a1597 100644
--- a/drivers/net/wireless/ti/wlcore/debugfs.c
+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
@@ -502,7 +502,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
502 DRIVER_STATE_PRINT_HEX(irq); 502 DRIVER_STATE_PRINT_HEX(irq);
503 /* TODO: ref_clock and tcxo_clock were moved to wl12xx priv */ 503 /* TODO: ref_clock and tcxo_clock were moved to wl12xx priv */
504 DRIVER_STATE_PRINT_HEX(hw_pg_ver); 504 DRIVER_STATE_PRINT_HEX(hw_pg_ver);
505 DRIVER_STATE_PRINT_HEX(platform_quirks); 505 DRIVER_STATE_PRINT_HEX(irq_flags);
506 DRIVER_STATE_PRINT_HEX(chip.id); 506 DRIVER_STATE_PRINT_HEX(chip.id);
507 DRIVER_STATE_PRINT_STR(chip.fw_ver_str); 507 DRIVER_STATE_PRINT_STR(chip.fw_ver_str);
508 DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str); 508 DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 1e136993580f..67518f692cfc 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -27,6 +27,7 @@
27#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
28#include <linux/wl12xx.h> 28#include <linux/wl12xx.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/irq.h>
30 31
31#include "wlcore.h" 32#include "wlcore.h"
32#include "debug.h" 33#include "debug.h"
@@ -538,7 +539,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
538 * In case edge triggered interrupt must be used, we cannot iterate 539 * In case edge triggered interrupt must be used, we cannot iterate
539 * more than once without introducing race conditions with the hardirq. 540 * more than once without introducing race conditions with the hardirq.
540 */ 541 */
541 if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) 542 if (wl->irq_flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))
542 loopcount = 1; 543 loopcount = 1;
543 544
544 wl1271_debug(DEBUG_IRQ, "IRQ work"); 545 wl1271_debug(DEBUG_IRQ, "IRQ work");
@@ -6249,7 +6250,6 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
6249 wl->ap_ps_map = 0; 6250 wl->ap_ps_map = 0;
6250 wl->ap_fw_ps_map = 0; 6251 wl->ap_fw_ps_map = 0;
6251 wl->quirks = 0; 6252 wl->quirks = 0;
6252 wl->platform_quirks = 0;
6253 wl->system_hlid = WL12XX_SYSTEM_HLID; 6253 wl->system_hlid = WL12XX_SYSTEM_HLID;
6254 wl->active_sta_count = 0; 6254 wl->active_sta_count = 0;
6255 wl->active_link_count = 0; 6255 wl->active_link_count = 0;
@@ -6391,7 +6391,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6391 struct platform_device *pdev = wl->pdev; 6391 struct platform_device *pdev = wl->pdev;
6392 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev); 6392 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
6393 struct wl12xx_platform_data *pdata = pdev_data->pdata; 6393 struct wl12xx_platform_data *pdata = pdev_data->pdata;
6394 unsigned long irqflags; 6394 struct resource *res;
6395
6395 int ret; 6396 int ret;
6396 irq_handler_t hardirq_fn = NULL; 6397 irq_handler_t hardirq_fn = NULL;
6397 6398
@@ -6418,19 +6419,23 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6418 /* adjust some runtime configuration parameters */ 6419 /* adjust some runtime configuration parameters */
6419 wlcore_adjust_conf(wl); 6420 wlcore_adjust_conf(wl);
6420 6421
6421 wl->irq = platform_get_irq(pdev, 0); 6422 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
6422 wl->platform_quirks = pdata->platform_quirks; 6423 if (!res) {
6424 wl1271_error("Could not get IRQ resource");
6425 goto out_free_nvs;
6426 }
6427
6428 wl->irq = res->start;
6429 wl->irq_flags = res->flags & IRQF_TRIGGER_MASK;
6423 wl->if_ops = pdev_data->if_ops; 6430 wl->if_ops = pdev_data->if_ops;
6424 6431
6425 if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) { 6432 if (wl->irq_flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))
6426 irqflags = IRQF_TRIGGER_RISING;
6427 hardirq_fn = wlcore_hardirq; 6433 hardirq_fn = wlcore_hardirq;
6428 } else { 6434 else
6429 irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT; 6435 wl->irq_flags |= IRQF_ONESHOT;
6430 }
6431 6436
6432 ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq, 6437 ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
6433 irqflags, pdev->name, wl); 6438 wl->irq_flags, pdev->name, wl);
6434 if (ret < 0) { 6439 if (ret < 0) {
6435 wl1271_error("request_irq() failed: %d", ret); 6440 wl1271_error("request_irq() failed: %d", ret);
6436 goto out_free_nvs; 6441 goto out_free_nvs;
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index d3dd7bfdf3f1..2bce00afea1f 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -287,7 +287,7 @@ static int wl1271_probe(struct sdio_func *func,
287 memset(res, 0x00, sizeof(res)); 287 memset(res, 0x00, sizeof(res));
288 288
289 res[0].start = pdev_data.pdata->irq; 289 res[0].start = pdev_data.pdata->irq;
290 res[0].flags = IORESOURCE_IRQ; 290 res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
291 res[0].name = "irq"; 291 res[0].name = "irq";
292 292
293 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res)); 293 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index d599c869e6e8..7f363fa566a3 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -197,6 +197,8 @@ struct wl1271 {
197 197
198 int irq; 198 int irq;
199 199
200 int irq_flags;
201
200 spinlock_t wl_lock; 202 spinlock_t wl_lock;
201 203
202 enum wlcore_state state; 204 enum wlcore_state state;
@@ -404,9 +406,6 @@ struct wl1271 {
404 /* Quirks of specific hardware revisions */ 406 /* Quirks of specific hardware revisions */
405 unsigned int quirks; 407 unsigned int quirks;
406 408
407 /* Platform limitations */
408 unsigned int platform_quirks;
409
410 /* number of currently active RX BA sessions */ 409 /* number of currently active RX BA sessions */
411 int ba_rx_session_count; 410 int ba_rx_session_count;
412 411