Merge tag 'mac80211-next-for-davem-2015-05-06' of git://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / drivers / net / wireless / ti / wlcore / main.c
index 257b9d5..7fe50f8 100644 (file)
@@ -25,8 +25,8 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/vmalloc.h>
-#include <linux/wl12xx.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include "wlcore.h"
 #include "debug.h"
@@ -538,7 +538,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
         * 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 | IRQF_TRIGGER_FALLING))
                loopcount = 1;
 
        wl1271_debug(DEBUG_IRQ, "IRQ work");
@@ -6249,7 +6249,6 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
        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;
@@ -6390,8 +6389,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
        struct wl1271 *wl = context;
        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;
+       struct resource *res;
+
        int ret;
        irq_handler_t hardirq_fn = NULL;
 
@@ -6418,19 +6417,23 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
        /* adjust some runtime configuration parameters */
        wlcore_adjust_conf(wl);
 
-       wl->irq = platform_get_irq(pdev, 0);
-       wl->platform_quirks = pdata->platform_quirks;
+       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+       if (!res) {
+               wl1271_error("Could not get IRQ resource");
+               goto out_free_nvs;
+       }
+
+       wl->irq = res->start;
+       wl->irq_flags = res->flags & IRQF_TRIGGER_MASK;
        wl->if_ops = pdev_data->if_ops;
 
-       if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
-               irqflags = IRQF_TRIGGER_RISING;
+       if (wl->irq_flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))
                hardirq_fn = wlcore_hardirq;
-       } else {
-               irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
-       }
+       else
+               wl->irq_flags |= IRQF_ONESHOT;
 
        ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
-                                  irqflags, pdev->name, wl);
+                                  wl->irq_flags, pdev->name, wl);
        if (ret < 0) {
                wl1271_error("request_irq() failed: %d", ret);
                goto out_free_nvs;
@@ -6441,7 +6444,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
        if (!ret) {
                wl->irq_wake_enabled = true;
                device_init_wakeup(wl->dev, 1);
-               if (pdata->pwr_in_suspend)
+               if (pdev_data->pwr_in_suspend)
                        wl->hw->wiphy->wowlan = &wlcore_wowlan_support;
        }
 #endif