procd: update to latest version, fixes a format string bug in processing init script...
[openwrt/staging/wigyori.git] / target / linux / omap / patches-3.13 / 901-wlcore-set-irq_flags-in-the-board-files.patch
1 The platform_quirk element in the platform data was used to change the
2 way the IRQ is triggered. When set, the EDGE_IRQ quirk would change
3 the irqflags used and treat edge trigger differently from the rest.
4
5 Instead of hiding this irq flag setting behind the quirk, have the
6 board files set the flags during initialization. This will be more
7 meaningful than driver-specific quirks when we switch to DT.
8
9 Additionally, fix missing gpio_request() calls in the boarding files
10 (so that setting the flags actually works).
11
12 Cc: Tony Lindgren <tony@atomide.com>
13 Cc: Sekhar Nori <nsekhar@ti.com>
14 Signed-off-by: Luciano Coelho <coelho@ti.com>
15 Reviewed-by: Felipe Balbi <balbi@ti.com>
16 Acked-by: Sekhar Nori <nsekhar@ti.com>
17
18 ---
19 arch/arm/mach-davinci/board-da850-evm.c | 8 +++++++-
20 arch/arm/mach-omap2/board-omap3evm.c | 19 ++++++++++++++++++
21 arch/arm/mach-omap2/board-zoom-peripherals.c | 30 +++++++++++++++++++++++++---
22 drivers/net/wireless/ti/wlcore/debugfs.c | 2 +-
23 drivers/net/wireless/ti/wlcore/main.c | 17 ++++++++--------
24 drivers/net/wireless/ti/wlcore/wlcore.h | 5 ++---
25 include/linux/wl12xx.h | 4 ----
26 7 files changed, 64 insertions(+), 21 deletions(-)
27
28 --- a/drivers/net/wireless/ti/wlcore/main.c
29 +++ b/drivers/net/wireless/ti/wlcore/main.c
30 @@ -27,6 +27,7 @@
31 #include <linux/vmalloc.h>
32 #include <linux/wl12xx.h>
33 #include <linux/interrupt.h>
34 +#include <linux/irq.h>
35
36 #include "wlcore.h"
37 #include "debug.h"
38 @@ -529,7 +530,7 @@ static int wlcore_irq_locked(struct wl12
39 * In case edge triggered interrupt must be used, we cannot iterate
40 * more than once without introducing race conditions with the hardirq.
41 */
42 - if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
43 + if (wl->irq_flags & IRQF_TRIGGER_RISING)
44 loopcount = 1;
45
46 wl1271_debug(DEBUG_IRQ, "IRQ work");
47 @@ -5893,7 +5894,6 @@ struct ieee80211_hw *wlcore_alloc_hw(siz
48 wl->ap_ps_map = 0;
49 wl->ap_fw_ps_map = 0;
50 wl->quirks = 0;
51 - wl->platform_quirks = 0;
52 wl->system_hlid = WL12XX_SYSTEM_HLID;
53 wl->active_sta_count = 0;
54 wl->active_link_count = 0;
55 @@ -6034,7 +6034,7 @@ static void wlcore_nvs_cb(const struct f
56 struct platform_device *pdev = wl->pdev;
57 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
58 struct wl12xx_platform_data *pdata = pdev_data->pdata;
59 - unsigned long irqflags;
60 +
61 int ret;
62 irq_handler_t hardirq_fn = NULL;
63
64 @@ -6062,18 +6062,17 @@ static void wlcore_nvs_cb(const struct f
65 wlcore_adjust_conf(wl);
66
67 wl->irq = platform_get_irq(pdev, 0);
68 - wl->platform_quirks = pdata->platform_quirks;
69 wl->if_ops = pdev_data->if_ops;
70
71 - if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
72 - irqflags = IRQF_TRIGGER_RISING;
73 - hardirq_fn = wlcore_hardirq;
74 - } else {
75 - irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
76 - }
77 + wl->irq_flags = irq_get_trigger_type(wl->irq);
78 +
79 + hardirq_fn = wlcore_hardirq;
80 +
81 + /* Since we don't use the primary handler, we must set ONESHOT */
82 + wl->irq_flags |= IRQF_ONESHOT;
83
84 ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
85 - irqflags, pdev->name, wl);
86 + wl->irq_flags, pdev->name, wl);
87 if (ret < 0) {
88 wl1271_error("request_irq() failed: %d", ret);
89 goto out_free_nvs;
90 --- a/drivers/net/wireless/ti/wlcore/wlcore.h
91 +++ b/drivers/net/wireless/ti/wlcore/wlcore.h
92 @@ -186,6 +186,8 @@ struct wl1271 {
93
94 int irq;
95
96 + int irq_flags;
97 +
98 spinlock_t wl_lock;
99
100 enum wlcore_state state;
101 @@ -393,9 +395,6 @@ struct wl1271 {
102 /* Quirks of specific hardware revisions */
103 unsigned int quirks;
104
105 - /* Platform limitations */
106 - unsigned int platform_quirks;
107 -
108 /* number of currently active RX BA sessions */
109 int ba_rx_session_count;
110
111 --- a/include/linux/wl12xx.h
112 +++ b/include/linux/wl12xx.h
113 @@ -59,13 +59,9 @@ struct wl12xx_platform_data {
114 int irq;
115 int board_ref_clock;
116 int board_tcxo_clock;
117 - unsigned long platform_quirks;
118 bool pwr_in_suspend;
119 };
120
121 -/* Platform does not support level trigger interrupts */
122 -#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
123 -
124 #ifdef CONFIG_WILINK_PLATFORM_DATA
125
126 int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);