2013-11-27 12:40:07 +00:00
|
|
|
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 flags during initialization. This will be more
|
|
|
|
meaningful than driver-specific quirks when we switch to DT.
|
|
|
|
|
|
|
|
Additionally, fix missing gpio_request() calls in the boarding files
|
|
|
|
(so that setting the flags actually works).
|
|
|
|
|
|
|
|
Cc: Tony Lindgren <tony@atomide.com>
|
|
|
|
Cc: Sekhar Nori <nsekhar@ti.com>
|
|
|
|
Signed-off-by: Luciano Coelho <coelho@ti.com>
|
|
|
|
Reviewed-by: Felipe Balbi <balbi@ti.com>
|
|
|
|
Acked-by: Sekhar Nori <nsekhar@ti.com>
|
|
|
|
|
|
|
|
--- a/drivers/net/wireless/ti/wlcore/debugfs.c
|
|
|
|
+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
|
2013-12-08 14:48:25 +00:00
|
|
|
@@ -502,7 +502,7 @@ static ssize_t driver_state_read(struct
|
2013-11-27 12:40:07 +00:00
|
|
|
DRIVER_STATE_PRINT_HEX(irq);
|
|
|
|
/* TODO: ref_clock and tcxo_clock were moved to wl12xx priv */
|
|
|
|
DRIVER_STATE_PRINT_HEX(hw_pg_ver);
|
|
|
|
- DRIVER_STATE_PRINT_HEX(platform_quirks);
|
|
|
|
+ DRIVER_STATE_PRINT_HEX(irq_flags);
|
|
|
|
DRIVER_STATE_PRINT_HEX(chip.id);
|
|
|
|
DRIVER_STATE_PRINT_STR(chip.fw_ver_str);
|
|
|
|
DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str);
|
|
|
|
--- a/drivers/net/wireless/ti/wlcore/main.c
|
|
|
|
+++ b/drivers/net/wireless/ti/wlcore/main.c
|
|
|
|
@@ -27,6 +27,7 @@
|
|
|
|
#include <linux/vmalloc.h>
|
|
|
|
#include <linux/wl12xx.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
+#include <linux/irq.h>
|
|
|
|
|
|
|
|
#include "wlcore.h"
|
|
|
|
#include "debug.h"
|
|
|
|
@@ -528,7 +529,7 @@ static int wlcore_irq_locked(struct wl12
|
|
|
|
* In case edge triggered interrupt must be used, we cannot iterate
|
|
|
|
* more than once without introducing race conditions with the hardirq.
|
|
|
|
*/
|
|
|
|
- if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
|
|
|
|
+ if (wl->irq_flags & IRQF_TRIGGER_RISING)
|
|
|
|
loopcount = 1;
|
|
|
|
|
|
|
|
wl1271_debug(DEBUG_IRQ, "IRQ work");
|
2014-01-30 15:55:59 +00:00
|
|
|
@@ -5934,7 +5935,6 @@ struct ieee80211_hw *wlcore_alloc_hw(siz
|
2013-11-27 12:40:07 +00:00
|
|
|
wl->ap_ps_map = 0;
|
|
|
|
wl->ap_fw_ps_map = 0;
|
|
|
|
wl->quirks = 0;
|
|
|
|
- wl->platform_quirks = 0;
|
|
|
|
wl->system_hlid = WL12XX_SYSTEM_HLID;
|
|
|
|
wl->active_sta_count = 0;
|
|
|
|
wl->active_link_count = 0;
|
2014-01-30 15:55:59 +00:00
|
|
|
@@ -6075,7 +6075,7 @@ static void wlcore_nvs_cb(const struct f
|
2013-11-27 12:40:07 +00:00
|
|
|
struct platform_device *pdev = wl->pdev;
|
|
|
|
struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
|
|
|
|
struct wl12xx_platform_data *pdata = pdev_data->pdata;
|
|
|
|
- unsigned long irqflags;
|
|
|
|
+
|
|
|
|
int ret;
|
|
|
|
irq_handler_t hardirq_fn = NULL;
|
|
|
|
|
2014-01-30 15:55:59 +00:00
|
|
|
@@ -6103,29 +6103,19 @@ static void wlcore_nvs_cb(const struct f
|
2013-11-27 12:40:07 +00:00
|
|
|
wlcore_adjust_conf(wl);
|
|
|
|
|
|
|
|
wl->irq = platform_get_irq(pdev, 0);
|
|
|
|
- wl->platform_quirks = pdata->platform_quirks;
|
|
|
|
wl->if_ops = pdev_data->if_ops;
|
|
|
|
|
2014-01-30 15:55:59 +00:00
|
|
|
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
|
|
|
|
- irqflags = IRQF_TRIGGER_RISING;
|
|
|
|
+ wl->irq_flags = irq_get_trigger_type(wl->irq) | IRQF_ONESHOT;
|
|
|
|
hardirq_fn = wlcore_hardirq;
|
|
|
|
-#else
|
2013-11-27 12:40:07 +00:00
|
|
|
- if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
|
|
|
|
- irqflags = IRQF_TRIGGER_RISING;
|
|
|
|
- hardirq_fn = wlcore_hardirq;
|
|
|
|
- } else {
|
|
|
|
- irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
|
|
|
|
- }
|
2014-01-30 15:55:59 +00:00
|
|
|
-#endif
|
2013-11-27 12:40:07 +00:00
|
|
|
|
2014-01-30 15:55:59 +00:00
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
|
|
|
|
ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq,
|
|
|
|
hardirq_fn, wlcore_irq,
|
|
|
|
- irqflags,
|
|
|
|
+ wl->irqflags,
|
|
|
|
pdev->name, wl);
|
|
|
|
#else
|
2013-11-27 12:40:07 +00:00
|
|
|
ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
|
|
|
|
- irqflags, pdev->name, wl);
|
2014-02-06 18:29:44 +00:00
|
|
|
+ wl->irq_flags, pdev->name, wl);
|
2014-01-30 15:55:59 +00:00
|
|
|
#endif
|
2013-11-27 12:40:07 +00:00
|
|
|
if (ret < 0) {
|
|
|
|
wl1271_error("request_irq() failed: %d", ret);
|
|
|
|
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
|
|
|
|
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
|
2014-01-30 15:55:59 +00:00
|
|
|
@@ -188,6 +188,8 @@ struct wl1271 {
|
2013-11-27 12:40:07 +00:00
|
|
|
|
|
|
|
int irq;
|
|
|
|
|
|
|
|
+ int irq_flags;
|
|
|
|
+
|
|
|
|
spinlock_t wl_lock;
|
|
|
|
|
|
|
|
enum wlcore_state state;
|
2014-01-30 15:55:59 +00:00
|
|
|
@@ -395,9 +397,6 @@ struct wl1271 {
|
2013-11-27 12:40:07 +00:00
|
|
|
/* Quirks of specific hardware revisions */
|
|
|
|
unsigned int quirks;
|
|
|
|
|
|
|
|
- /* Platform limitations */
|
|
|
|
- unsigned int platform_quirks;
|
|
|
|
-
|
|
|
|
/* number of currently active RX BA sessions */
|
|
|
|
int ba_rx_session_count;
|
|
|
|
|