aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c2
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c1
-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
-rw-r--r--include/linux/wl12xx.h5
7 files changed, 23 insertions, 21 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 6b5a97da9fe3..916589ca8d44 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1385,8 +1385,8 @@ static const short da850_wl12xx_pins[] __initconst = {
1385 1385
1386static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = { 1386static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
1387 .irq = -1, 1387 .irq = -1,
1388 .irq_trigger = IRQ_TYPE_EDGE_RISING,
1388 .board_ref_clock = WL12XX_REFCLOCK_38, 1389 .board_ref_clock = WL12XX_REFCLOCK_38,
1389 .platform_quirks = WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
1390}; 1390};
1391 1391
1392static __init int da850_wl12xx_init(void) 1392static __init int da850_wl12xx_init(void)
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index e642b079e9f3..e86fb0d55c59 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -48,6 +48,7 @@ static void __init __used legacy_init_wl12xx(unsigned ref_clock,
48 wl12xx.board_ref_clock = ref_clock; 48 wl12xx.board_ref_clock = ref_clock;
49 wl12xx.board_tcxo_clock = tcxo_clock; 49 wl12xx.board_tcxo_clock = tcxo_clock;
50 wl12xx.irq = gpio_to_irq(gpio); 50 wl12xx.irq = gpio_to_irq(gpio);
51 wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
51 52
52 res = wl12xx_set_platform_data(&wl12xx); 53 res = wl12xx_set_platform_data(&wl12xx);
53 if (res) { 54 if (res) {
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
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a9c723be1acf..3876b67dbcbc 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -57,15 +57,12 @@ struct wl1251_platform_data {
57 57
58struct wl12xx_platform_data { 58struct wl12xx_platform_data {
59 int irq; 59 int irq;
60 u32 irq_trigger;
60 int board_ref_clock; 61 int board_ref_clock;
61 int board_tcxo_clock; 62 int board_tcxo_clock;
62 unsigned long platform_quirks;
63 bool pwr_in_suspend; 63 bool pwr_in_suspend;
64}; 64};
65 65
66/* Platform does not support level trigger interrupts */
67#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
68
69#ifdef CONFIG_WILINK_PLATFORM_DATA 66#ifdef CONFIG_WILINK_PLATFORM_DATA
70 67
71int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); 68int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);