[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-87-gdb6f0a4
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2014-01-31 10:27:40
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via db6f0a47e10f3d8f10da8a427c12b34bf7f8aecb (commit)
via dd8ed28de506489893be40674f9d1a3816ab68a9 (commit)
via 7c559555eceb1a0c2cacf908f4f0002d2792cefa (commit)
via bad2426f451acdf6e8083f9e5f0233a0d4b455c6 (commit)
via a20fa73d8a8be2a0ed3d188d50748c20498d42ae (commit)
via a98794720669e52c5ece5e8105db6bd17fc70395 (commit)
from 47b63799c7ca33a85bbc8cbfef7f21cd32be971a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit db6f0a47e10f3d8f10da8a427c12b34bf7f8aecb
Author: Sébastien Szymanski <ss...@us...>
Date: Fri Jan 31 11:22:51 2014 +0100
[LINUX] 3.13: apf6: add wifi to device tree.
commit dd8ed28de506489893be40674f9d1a3816ab68a9
Author: Sébastien Szymanski <ss...@us...>
Date: Fri Jan 31 11:11:33 2014 +0100
[BUILDROOT] apf6: enable CONFIG_NL80211_TESTMODE and CONFIG_CFG80211_WEXT by
default.
commit 7c559555eceb1a0c2cacf908f4f0002d2792cefa
Author: Sébastien Szymanski <ss...@us...>
Date: Fri Jan 31 11:07:17 2014 +0100
[LINUX] 3.13: apf6: add device tree support to wl12xx drivers. These
patches are from Luciano Coelho [1].
[1] http://marc.info/?l=linux-wireless&m=137518992525285&w=3
commit bad2426f451acdf6e8083f9e5f0233a0d4b455c6
Author: Sébastien Szymanski <ss...@us...>
Date: Fri Jan 31 10:33:26 2014 +0100
[LINUX] 3.13: apf6: split device trees and add apf6dl device tree.
commit a20fa73d8a8be2a0ed3d188d50748c20498d42ae
Author: Sébastien Szymanski <ss...@us...>
Date: Thu Jan 30 14:22:05 2014 +0100
[BUILDROOT] apf6: add wireless drivers to default linux config file.
commit a98794720669e52c5ece5e8105db6bd17fc70395
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Jan 29 15:28:59 2014 +0100
[LINUX] 3.13: apf6q: add HCILL protocol support.
-----------------------------------------------------------------------
Summary of changes:
.../device/armadeus/apf6q/apf6q-linux-3.13.config | 8 +-
...madeus-add-apf6q-and-apf6dl-device-trees.patch} | 107 ++++++++--
...6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch | 116 +++++++++++
...-remove-pwr_in_suspend-from-platform-data.patch | 92 +++++++++
...-instead-of-enumerations-for-pdata-clocks.patch | 208 ++++++++++++++++++++
...al-device-tree-support-to-the-sdio-module.patch | 143 ++++++++++++++
...-8-wlcore-sdio-add-wilink-clock-providers.patch | 75 +++++++
...8-wlcore-sdio-get-clocks-from-device-tree.patch | 115 +++++++++++
...heck-if-we-got-correct-clock-data-from-DT.patch | 124 ++++++++++++
...cumentation-dt-bindings-TI-WiLink-modules.patch | 105 ++++++++++
10 files changed, 1072 insertions(+), 21 deletions(-)
rename patches/linux/3.13/{0450-armadeus-add-apf6q-devicetree.patch => 0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch} (68%)
create mode 100644 patches/linux/3.13/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
create mode 100644 patches/linux/3.13/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
create mode 100644 patches/linux/3.13/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
create mode 100644 patches/linux/3.13/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
create mode 100644 patches/linux/3.13/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
create mode 100644 patches/linux/3.13/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
create mode 100644 patches/linux/3.13/0495-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
create mode 100644 patches/linux/3.13/0496-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
diff --git a/buildroot/target/device/armadeus/apf6q/apf6q-linux-3.13.config b/buildroot/target/device/armadeus/apf6q/apf6q-linux-3.13.config
index 0f82522..5fbf6b1 100644
--- a/buildroot/target/device/armadeus/apf6q/apf6q-linux-3.13.config
+++ b/buildroot/target/device/armadeus/apf6q/apf6q-linux-3.13.config
@@ -71,7 +71,10 @@ CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_CFG80211=y
+CONFIG_NL80211_TESTMODE=y
+CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
@@ -127,7 +130,10 @@ CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
-CONFIG_BRCMFMAC=m
+# CONFIG_RTL_CARDS is not set
+CONFIG_WL_TI=y
+CONFIG_WL12XX=m
+CONFIG_WLCORE_SDIO=m
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
diff --git a/patches/linux/3.13/0450-armadeus-add-apf6q-devicetree.patch b/patches/linux/3.13/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
similarity index 68%
rename from patches/linux/3.13/0450-armadeus-add-apf6q-devicetree.patch
rename to patches/linux/3.13/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
index 28db349..97b773f 100644
--- a/patches/linux/3.13/0450-armadeus-add-apf6q-devicetree.patch
+++ b/patches/linux/3.13/0450-armadeus-add-apf6q-and-apf6dl-device-trees.patch
@@ -2,7 +2,11 @@ Index: linux-3.13/arch/arm/boot/dts/Makefile
===================================================================
--- linux-3.13.orig/arch/arm/boot/dts/Makefile
+++ linux-3.13/arch/arm/boot/dts/Makefile
-@@ -139,6 +139,7 @@ dtb-$(CONFIG_ARCH_MXC) += \
+@@ -136,9 +136,11 @@ dtb-$(CONFIG_ARCH_MXC) += \
+ imx53-mba53.dtb \
+ imx53-qsb.dtb \
+ imx53-smd.dtb \
++ imx6dl-apf6dev.dtb \
imx6dl-sabreauto.dtb \
imx6dl-sabresd.dtb \
imx6dl-wandboard.dtb \
@@ -10,11 +14,11 @@ Index: linux-3.13/arch/arm/boot/dts/Makefile
imx6q-arm2.dtb \
imx6q-phytec-pbab01.dtb \
imx6q-sabreauto.dtb \
-Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6.dtsi
+Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
===================================================================
--- /dev/null
-+++ linux-3.13/arch/arm/boot/dts/imx6q-apf6.dtsi
-@@ -0,0 +1,66 @@
++++ linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
+@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014 Armadeus Systems
+ *
@@ -26,17 +30,61 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6.dtsi
+ *
+ */
+
++/dts-v1/;
+#include "imx6q.dtsi"
++#include "imx6qdl-apf6.dtsi"
++#include "imx6qdl-apf6dev.dtsi"
+
+/ {
-+ model = "Armadeus APF6 i.MX6 Quad Board";
-+ compatible = "armadeus,imx6q-apf6", "fsl,imx6q";
++ model = "Armadeus APF6Dev i.MX6 Quad / Dual Board";
++ compatible = "armadeus,imx6q-apf6dev", "armadeus,imx6q-apf6", "fsl,imx6q";
+
+ memory {
+ reg = <0x10000000 0x80000000>;
+ };
+};
+
++&sata {
++ status = "okay";
++};
+Index: linux-3.13/arch/arm/boot/dts/imx6qdl-apf6.dtsi
+===================================================================
+--- /dev/null
++++ linux-3.13/arch/arm/boot/dts/imx6qdl-apf6.dtsi
+@@ -0,0 +1,76 @@
++/*
++ * Copyright 2014 Armadeus Systems
++ *
++ * Author: Armadeus Systems <su...@ar...>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++/ {
++ wlan {
++ compatible = "ti,wilink6";
++ interrupt-parent = <&gpio2>;
++ interrupts = <10 0x4>; /* gpio line 43, high level triggered */
++ clocks = <&refclock>, <&tcxoclock>;
++ clock-names = "refclock", "tcxoclock";
++
++ refclock: refclock {
++ compatible = "ti,wilink-clock";
++ #clock-cells = <0>;
++ clock-frequency = <38400000>;
++ };
++
++ tcxoclock: tcxoclock {
++ compatible = "ti,wilink-clock";
++ #clock-cells = <0>;
++ clock-frequency = <38400000>;
++ };
++ };
++};
++
+&iomuxc {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hog>;
@@ -44,8 +92,7 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6.dtsi
+ hog {
+ pinctrl_hog: hoggrp {
+ fsl,pins = <
-+ MX6QDL_PAD_SD4_DAT0__GPIO2_IO08 0x80000000 /* WL_EN */
-+ MX6QDL_PAD_SD4_DAT3__GPIO2_IO11 0x80000000 /* BT_EN */
++ MX6QDL_PAD_SD4_DAT2__GPIO2_IO10 0x80000000 /* WL_IRQ */
+ >;
+ };
+
@@ -81,11 +128,11 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6.dtsi
+ //non-removable;
+ status = "okay";
+};
-Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
+Index: linux-3.13/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
===================================================================
--- /dev/null
-+++ linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
-@@ -0,0 +1,171 @@
++++ linux-3.13/arch/arm/boot/dts/imx6qdl-apf6dev.dtsi
+@@ -0,0 +1,162 @@
+/*
+ * Copyright 2014 Armadeus Systems
+ *
@@ -96,13 +143,8 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
+ * published by the Free Software Foundation.
+ *
+ */
-+/dts-v1/;
-+#include "imx6q-apf6.dtsi"
+
+/ {
-+ model = "Armadeus APF6Dev i.MX6 Quad Board";
-+ compatible = "armadeus,imx6q-apf6dev", "armadeus,imx6q-apf6", "fsl,imx6q";
-+
+ regulators {
+ compatible = "simple-bus";
+
@@ -145,10 +187,6 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
+ };
+};
+
-+&sata {
-+ status = "okay";
-+};
-+
+&hdmi {
+ ddc = <&i2c1>;
+ status = "okay";
@@ -257,3 +295,32 @@ Index: linux-3.13/arch/arm/boot/dts/imx6q-apf6dev.dts
+ cd-gpios = <&gpio1 2 0>;
+ status = "okay";
+};
+Index: linux-3.13/arch/arm/boot/dts/imx6dl-apf6dev.dts
+===================================================================
+--- /dev/null
++++ linux-3.13/arch/arm/boot/dts/imx6dl-apf6dev.dts
+@@ -0,0 +1,24 @@
++/*
++ * Copyright 2014 Armadeus Systems
++ *
++ * Author: Armadeus Systems <su...@ar...>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++/dts-v1/;
++#include "imx6dl.dtsi"
++#include "imx6qdl-apf6.dtsi"
++#include "imx6qdl-apf6dev.dtsi"
++
++/ {
++ model = "Armadeus APF6Dev i.MX6 Dual Light Board";
++ compatible = "armadeus,imx6dl-apf6dev", "armadeus,imx6dl-apf6", "fsl,imx6dl";
++
++ memory {
++ reg = <0x10000000 0x40000000>;
++ };
++};
diff --git a/patches/linux/3.13/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch b/patches/linux/3.13/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
new file mode 100644
index 0000000..c4ddb08
--- /dev/null
+++ b/patches/linux/3.13/0490-imx6qdl-wlcore_remove_quirk_to_hide_irq_flag.patch
@@ -0,0 +1,116 @@
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/debugfs.c
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/debugfs.c
++++ linux-3.13/drivers/net/wireless/ti/wlcore/debugfs.c
+@@ -502,7 +502,7 @@ static ssize_t driver_state_read(struct
+ 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);
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/main.c
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/main.c
++++ linux-3.13/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"
+@@ -529,7 +530,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");
+@@ -5893,7 +5894,6 @@ struct ieee80211_hw *wlcore_alloc_hw(siz
+ 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;
+@@ -6034,7 +6034,7 @@ static void wlcore_nvs_cb(const struct f
+ 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;
+
+@@ -6062,18 +6062,15 @@ static void wlcore_nvs_cb(const struct f
+ wlcore_adjust_conf(wl);
+
+ wl->irq = platform_get_irq(pdev, 0);
+- wl->platform_quirks = pdata->platform_quirks;
+ wl->if_ops = pdev_data->if_ops;
+
+- if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
+- irqflags = IRQF_TRIGGER_RISING;
+- hardirq_fn = wlcore_hardirq;
+- } else {
+- irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
+- }
++ hardirq_fn = wlcore_hardirq;
++
++ wl->irq_flags = irq_get_trigger_type(wl->irq);
++ 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;
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/wlcore.h
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/wlcore.h
++++ linux-3.13/drivers/net/wireless/ti/wlcore/wlcore.h
+@@ -186,6 +186,8 @@ struct wl1271 {
+
+ int irq;
+
++ int irq_flags;
++
+ spinlock_t wl_lock;
+
+ enum wlcore_state state;
+@@ -393,9 +395,6 @@ struct wl1271 {
+ /* 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;
+
+Index: linux-3.13/include/linux/wl12xx.h
+===================================================================
+--- linux-3.13.orig/include/linux/wl12xx.h
++++ linux-3.13/include/linux/wl12xx.h
+@@ -55,13 +55,9 @@ struct wl12xx_platform_data {
+ bool use_eeprom;
+ int board_ref_clock;
+ int board_tcxo_clock;
+- unsigned long platform_quirks;
+ bool pwr_in_suspend;
+ };
+
+-/* Platform does not support level trigger interrupts */
+-#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
+-
+ #ifdef CONFIG_WILINK_PLATFORM_DATA
+
+ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
diff --git a/patches/linux/3.13/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch b/patches/linux/3.13/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
new file mode 100644
index 0000000..340e8e4
--- /dev/null
+++ b/patches/linux/3.13/0491-v4-3-8-wlcore-remove-pwr_in_suspend-from-platform-data.patch
@@ -0,0 +1,92 @@
+From patchwork Tue Jul 30 13:04:31 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,3/8] wlcore: remove pwr_in_suspend from platform data
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835678
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:31 +0300
+
+The pwr_in_suspend flag depends on the MMC settings which can be
+retrieved from the SDIO subsystem, so it doesn't need to be part of
+the platform data structure. Move it to the platform device data that
+is passed from SDIO to wlcore.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+drivers/net/wireless/ti/wlcore/main.c | 3 +--
+ drivers/net/wireless/ti/wlcore/sdio.c | 2 +-
+ drivers/net/wireless/ti/wlcore/wlcore_i.h | 1 +
+ include/linux/wl12xx.h | 1 -
+ 4 files changed, 3 insertions(+), 4 deletions(-)
+
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/main.c
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/main.c
++++ linux-3.13/drivers/net/wireless/ti/wlcore/main.c
+@@ -6033,7 +6033,6 @@ static void wlcore_nvs_cb(const struct f
+ 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;
+
+ int ret;
+ irq_handler_t hardirq_fn = NULL;
+@@ -6081,7 +6080,7 @@ static void wlcore_nvs_cb(const struct f
+ 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
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/sdio.c
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/sdio.c
++++ linux-3.13/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -260,7 +260,7 @@ static int wl1271_probe(struct sdio_func
+ dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
+
+ if (mmcflags & MMC_PM_KEEP_POWER)
+- pdev_data->pdata->pwr_in_suspend = true;
++ pdev_data->pwr_in_suspend = true;
+
+ sdio_set_drvdata(func, glue);
+
+Index: linux-3.13/drivers/net/wireless/ti/wlcore/wlcore_i.h
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wlcore/wlcore_i.h
++++ linux-3.13/drivers/net/wireless/ti/wlcore/wlcore_i.h
+@@ -209,6 +209,7 @@ struct wl1271_if_operations {
+ struct wlcore_platdev_data {
+ struct wl12xx_platform_data *pdata;
+ struct wl1271_if_operations *if_ops;
++ bool pwr_in_suspend;
+ };
+
+ #define MAX_NUM_KEYS 14
+Index: linux-3.13/include/linux/wl12xx.h
+===================================================================
+--- linux-3.13.orig/include/linux/wl12xx.h
++++ linux-3.13/include/linux/wl12xx.h
+@@ -55,7 +55,6 @@ struct wl12xx_platform_data {
+ bool use_eeprom;
+ int board_ref_clock;
+ int board_tcxo_clock;
+- bool pwr_in_suspend;
+ };
+
+ #ifdef CONFIG_WILINK_PLATFORM_DATA
diff --git a/patches/linux/3.13/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch b/patches/linux/3.13/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
new file mode 100644
index 0000000..a5ea16a
--- /dev/null
+++ b/patches/linux/3.13/0492-v4-4-8-wl12xx-use-frequency-instead-of-enumerations-for-pdata-clocks.patch
@@ -0,0 +1,208 @@
+From patchwork Tue Jul 30 13:04:32 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,
+ 4/8] wl12xx: use frequency instead of enumerations for pdata clocks
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835657
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:32 +0300
+
+Instead of defining an enumeration with the FW specific values for the
+different clock rates, use the actual frequency instead. Also add a
+boolean to specify whether the clock is XTAL or not.
+
+Change all board files to reflect this.
+
+Additionally, this reverts commit 26f45c (ARM: OMAP2+: Legacy support
+for wl12xx when booted with devicetree), since this is not be needed
+anymore, now that DT support for WiLink is implemented.
+
+Cc: Tony Lindgren <to...@at...>
+Cc: Sekhar Nori <ns...@ti...>
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+arch/arm/mach-davinci/board-da850-evm.c | 3 +-
+ arch/arm/mach-omap2/board-omap3evm.c | 3 +-
+ arch/arm/mach-omap2/board-zoom-peripherals.c | 3 +-
+ arch/arm/mach-omap2/devices.c | 39 -------------------
+ drivers/net/wireless/ti/wl12xx/main.c | 58 +++++++++++++++++++++++++++-
+ drivers/net/wireless/ti/wl12xx/wl12xx.h | 28 ++++++++++++++
+ include/linux/wl12xx.h | 27 ++-----------
+ 7 files changed, 93 insertions(+), 68 deletions(-)
+
+Index: linux-3.13/drivers/net/wireless/ti/wl12xx/main.c
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wl12xx/main.c
++++ linux-3.13/drivers/net/wireless/ti/wl12xx/main.c
+@@ -1711,6 +1711,43 @@ static struct ieee80211_sta_ht_cap wl12x
+ },
+ };
+
++static const struct wl12xx_clock wl12xx_refclock_table[] = {
++ { 19200000, false, WL12XX_REFCLOCK_19 },
++ { 26000000, false, WL12XX_REFCLOCK_26 },
++ { 26000000, true, WL12XX_REFCLOCK_26_XTAL },
++ { 38400000, false, WL12XX_REFCLOCK_38 },
++ { 38400000, true, WL12XX_REFCLOCK_38_XTAL },
++ { 52000000, false, WL12XX_REFCLOCK_52 },
++ { 0, false, 0 }
++};
++
++static const struct wl12xx_clock wl12xx_tcxoclock_table[] = {
++ { 16368000, true, WL12XX_TCXOCLOCK_16_368 },
++ { 16800000, true, WL12XX_TCXOCLOCK_16_8 },
++ { 19200000, true, WL12XX_TCXOCLOCK_19_2 },
++ { 26000000, true, WL12XX_TCXOCLOCK_26 },
++ { 32736000, true, WL12XX_TCXOCLOCK_32_736 },
++ { 33600000, true, WL12XX_TCXOCLOCK_33_6 },
++ { 38400000, true, WL12XX_TCXOCLOCK_38_4 },
++ { 52000000, true, WL12XX_TCXOCLOCK_52 },
++ { 0, false, 0 }
++};
++
++static int wl12xx_get_clock_idx(const struct wl12xx_clock *table,
++ u32 freq, bool xtal)
++{
++ int i = 0;
++
++ while(table[i].freq != 0) {
++ if ((table[i].freq == freq) &&
++ (table[i].xtal == xtal))
++ return table[i].hw_idx;
++ i++;
++ };
++
++ return -EINVAL;
++}
++
+ static int wl12xx_setup(struct wl1271 *wl)
+ {
+ struct wl12xx_priv *priv = wl->priv;
+@@ -1732,7 +1769,16 @@ static int wl12xx_setup(struct wl1271 *w
+ wl12xx_conf_init(wl);
+
+ if (!fref_param) {
+- priv->ref_clock = pdata->board_ref_clock;
++ priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
++ pdata->ref_clock_freq,
++ pdata->ref_clock_xtal);
++ if (priv->ref_clock < 0) {
++ wl1271_error("Invalid ref_clock frequency (%d Hz, %s)",
++ pdata->ref_clock_freq,
++ pdata->ref_clock_xtal ? "XTAL" : "not XTAL");
++
++ return priv->ref_clock;
++ }
+ } else {
+ if (!strcmp(fref_param, "19.2"))
+ priv->ref_clock = WL12XX_REFCLOCK_19;
+@@ -1751,7 +1797,15 @@ static int wl12xx_setup(struct wl1271 *w
+ }
+
+ if (!tcxo_param) {
+- priv->tcxo_clock = pdata->board_tcxo_clock;
++ priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
++ pdata->tcxo_clock_freq,
++ true);
++ if (priv->tcxo_clock < 0) {
++ wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
++ pdata->tcxo_clock_freq);
++
++ return priv->tcxo_clock;
++ }
+ } else {
+ if (!strcmp(tcxo_param, "19.2"))
+ priv->tcxo_clock = WL12XX_TCXOCLOCK_19_2;
+Index: linux-3.13/drivers/net/wireless/ti/wl12xx/wl12xx.h
+===================================================================
+--- linux-3.13.orig/drivers/net/wireless/ti/wl12xx/wl12xx.h
++++ linux-3.13/drivers/net/wireless/ti/wl12xx/wl12xx.h
+@@ -79,4 +79,32 @@ struct wl12xx_priv {
+ struct wl127x_rx_mem_pool_addr *rx_mem_addr;
+ };
+
++/* Reference clock values */
++enum {
++ WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
++ WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
++ WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
++ WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
++ WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
++ WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
++};
++
++/* TCXO clock values */
++enum {
++ WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
++ WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
++ WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
++ WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
++ WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
++ WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
++ WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
++ WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
++};
++
++struct wl12xx_clock {
++ u32 freq;
++ bool xtal;
++ u8 hw_idx;
++};
++
+ #endif /* __WL12XX_PRIV_H__ */
+Index: linux-3.13/include/linux/wl12xx.h
+===================================================================
+--- linux-3.13.orig/include/linux/wl12xx.h
++++ linux-3.13/include/linux/wl12xx.h
+@@ -26,35 +26,14 @@
+
+ #include <linux/err.h>
+
+-/* Reference clock values */
+-enum {
+- WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
+- WL12XX_REFCLOCK_26 = 1, /* 26 MHz */
+- WL12XX_REFCLOCK_38 = 2, /* 38.4 MHz */
+- WL12XX_REFCLOCK_52 = 3, /* 52 MHz */
+- WL12XX_REFCLOCK_38_XTAL = 4, /* 38.4 MHz, XTAL */
+- WL12XX_REFCLOCK_26_XTAL = 5, /* 26 MHz, XTAL */
+-};
+-
+-/* TCXO clock values */
+-enum {
+- WL12XX_TCXOCLOCK_19_2 = 0, /* 19.2MHz */
+- WL12XX_TCXOCLOCK_26 = 1, /* 26 MHz */
+- WL12XX_TCXOCLOCK_38_4 = 2, /* 38.4MHz */
+- WL12XX_TCXOCLOCK_52 = 3, /* 52 MHz */
+- WL12XX_TCXOCLOCK_16_368 = 4, /* 16.368 MHz */
+- WL12XX_TCXOCLOCK_32_736 = 5, /* 32.736 MHz */
+- WL12XX_TCXOCLOCK_16_8 = 6, /* 16.8 MHz */
+- WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
+-};
+-
+ struct wl12xx_platform_data {
+ void (*set_power)(bool enable);
+ /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
+ int irq;
+ bool use_eeprom;
+- int board_ref_clock;
+- int board_tcxo_clock;
++ int ref_clock_freq; /* in Hertz */
++ bool ref_clock_xtal; /* specify whether the clock is XTAL or not */
++ int tcxo_clock_freq; /* in Hertz, tcxo is always XTAL */
+ };
+
+ #ifdef CONFIG_WILINK_PLATFORM_DATA
diff --git a/patches/linux/3.13/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch b/patches/linux/3.13/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
new file mode 100644
index 0000000..f2f3b79
--- /dev/null
+++ b/patches/linux/3.13/0493-v4-5-8-wlcore-add-initial-device-tree-support-to-the-sdio-module.patch
@@ -0,0 +1,143 @@
+From patchwork Tue Jul 30 13:04:33 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,5/8] wlcore: add initial device tree support to the sdio module
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835682
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:33 +0300
+
+If platform data is not available, try to get the required information
+from the device tree. Register an OF match table and parse the
+appropriate device tree nodes.
+
+Parse interrupt property only, for now.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+drivers/net/wireless/ti/wlcore/sdio.c | 69 ++++++++++++++++++++++++++++++++---
+ 1 file changed, 63 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
+index 4c7e8ac..9370d7e 100644
+--- a/drivers/net/wireless/ti/wlcore/sdio.c
++++ b/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -30,7 +30,7 @@
+ #include <linux/mmc/sdio_ids.h>
+ #include <linux/mmc/card.h>
+ #include <linux/mmc/host.h>
+-#include <linux/gpio.h>
++#include <linux/of_irq.h>
+ #include <linux/wl12xx.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/printk.h>
+@@ -214,6 +214,43 @@ static struct wl1271_if_operations sdio_ops = {
+ .set_block_size = wl1271_sdio_set_block_size,
+ };
+
++static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
++{
++ struct wl12xx_platform_data *pdata;
++ struct device_node *np = dev->of_node;
++
++ if (!np) {
++ np = of_find_matching_node(NULL, dev->driver->of_match_table);
++ if (!np) {
++ dev_notice(dev, "device tree node not available\n");
++ pdata = ERR_PTR(-ENODEV);
++ goto out;
++ }
++ }
++
++ pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
++ if (!pdata) {
++ dev_err(dev, "can't allocate platform data\n");
++ pdata = ERR_PTR(-ENODEV);
++ goto out;
++ }
++
++ pdata->irq = irq_of_parse_and_map(np, 0);
++ if (pdata->irq < 0) {
++ dev_err(dev, "can't get interrupt gpio from the device tree\n");
++ goto out_free;
++ }
++
++ goto out;
++
++out_free:
++ kfree(pdata);
++ pdata = ERR_PTR(-ENODEV);
++
++out:
++ return pdata;
++}
++
+ static int wl1271_probe(struct sdio_func *func,
+ const struct sdio_device_id *id)
+ {
+@@ -248,11 +285,22 @@ static int wl1271_probe(struct sdio_func *func,
+ /* Use block mode for transferring over one block size of data */
+ func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
+
++ /* The pdata allocated here is freed when the device is freed,
++ * so we don't need an additional out label to free it in case
++ * of error further on.
++ */
++
++ /* Try to get legacy platform data from the board file */
+ pdev_data->pdata = wl12xx_get_platform_data();
+ if (IS_ERR(pdev_data->pdata)) {
+- ret = PTR_ERR(pdev_data->pdata);
+- dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
+- goto out_free_glue;
++ dev_info(&func->dev,
++ "legacy platform data not found, trying device tree\n");
++
++ pdev_data->pdata = wlcore_get_pdata_from_of(&func->dev);
++ if (IS_ERR(pdev_data->pdata)) {
++ dev_err(&func->dev, "can't get platform data\n");
++ goto out_free_glue;
++ }
+ }
+
+ /* if sdio can keep power while host is suspended, enable wow */
+@@ -386,16 +434,25 @@ static const struct dev_pm_ops wl1271_sdio_pm_ops = {
+ };
+ #endif
+
++static const struct of_device_id wlcore_sdio_of_match_table[] = {
++ { .compatible = "ti,wilink6" },
++ { .compatible = "ti,wilink7" },
++ { .compatible = "ti,wilink8" },
++ { }
++};
++MODULE_DEVICE_TABLE(of, wlcore_sdio_of_match_table);
++
+ static struct sdio_driver wl1271_sdio_driver = {
+ .name = "wl1271_sdio",
+ .id_table = wl1271_devices,
+ .probe = wl1271_probe,
+ .remove = wl1271_remove,
+-#ifdef CONFIG_PM
+ .drv = {
++#ifdef CONFIG_PM
+ .pm = &wl1271_sdio_pm_ops,
+- },
+ #endif
++ .of_match_table = of_match_ptr(wlcore_sdio_of_match_table),
++ },
+ };
+
+ static int __init wl1271_init(void)
diff --git a/patches/linux/3.13/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch b/patches/linux/3.13/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
new file mode 100644
index 0000000..cb6bf97
--- /dev/null
+++ b/patches/linux/3.13/0494-v4-6-8-wlcore-sdio-add-wilink-clock-providers.patch
@@ -0,0 +1,75 @@
+From patchwork Tue Jul 30 13:04:34 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,6/8] wlcore: sdio: add wilink clock providers
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835651
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:34 +0300
+
+Add refclock and tcxoclock as clock providers in WiLink. These clocks
+are not accesible outside the WiLink module, but they are registered
+in the clock framework anyway. Only the WiLink chip consumes these
+clocks.
+
+In theory, the WiLink chip could be connected to external clocks
+instead of using these internal clocks, so make the clock consumer
+code generic enough. If external clocks are used, then the internal
+clock device tree nodes are not necessary, but the external ones must
+be specified.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+drivers/net/wireless/ti/wlcore/sdio.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
+index 9370d7e..980bf3d 100644
+--- a/drivers/net/wireless/ti/wlcore/sdio.c
++++ b/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -34,6 +34,7 @@
+ #include <linux/wl12xx.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/printk.h>
++#include <linux/clk-provider.h>
+
+ #include "wlcore.h"
+ #include "wl12xx_80211.h"
+@@ -214,10 +215,15 @@ static struct wl1271_if_operations sdio_ops = {
+ .set_block_size = wl1271_sdio_set_block_size,
+ };
+
++static const struct of_device_id wlcore_sdio_of_clk_match_table[] = {
++ { .compatible = "ti,wilink-clock" },
++};
++
+ static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
+ {
+ struct wl12xx_platform_data *pdata;
+ struct device_node *np = dev->of_node;
++ struct device_node *clock_node;
+
+ if (!np) {
+ np = of_find_matching_node(NULL, dev->driver->of_match_table);
+@@ -241,6 +247,9 @@ static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
+ goto out_free;
+ }
+
++ for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
++ of_fixed_clk_setup(clock_node);
++
+ goto out;
+
+ out_free:
diff --git a/patches/linux/3.13/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch b/patches/linux/3.13/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
new file mode 100644
index 0000000..5ab8759
--- /dev/null
+++ b/patches/linux/3.13/0495-v4-7-8-wlcore-sdio-get-clocks-from-device-tree.patch
@@ -0,0 +1,115 @@
+From patchwork Tue Jul 30 13:04:35 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,7/8] wlcore: sdio: get clocks from device tree
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835643
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:35 +0300
+
+Read the clock nodes from the device tree and use them to set the
+frequency for the refclock and the tcxo clock.
+
+Also, call sdio_set_drvdata() earlier, so the glue is already set in
+the driver data when we call wlcore_get_pdata_from_of() and we don't
+need to pass it as a parameter.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+drivers/net/wireless/ti/wlcore/sdio.c | 36 +++++++++++++++++++++++++++++++++--
+ 1 file changed, 34 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
+index 980bf3d..60fce49 100644
+--- a/drivers/net/wireless/ti/wlcore/sdio.c
++++ b/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -53,6 +53,7 @@ static bool dump = false;
+ struct wl12xx_sdio_glue {
+ struct device *dev;
+ struct platform_device *core;
++ struct clk *refclock, *tcxoclock;
+ };
+
+ static const struct sdio_device_id wl1271_devices[] = {
+@@ -224,6 +225,7 @@ static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
+ struct wl12xx_platform_data *pdata;
+ struct device_node *np = dev->of_node;
+ struct device_node *clock_node;
++ struct wl12xx_sdio_glue *glue = sdio_get_drvdata(dev_to_sdio_func(dev));
+
+ if (!np) {
+ np = of_find_matching_node(NULL, dev->driver->of_match_table);
+@@ -250,6 +252,26 @@ static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
+ for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
+ of_fixed_clk_setup(clock_node);
+
++ /* TODO: make sure we have this when needed (ie. for WL6 and WL7) */
++ glue->refclock = of_clk_get_by_name(np, "refclock");
++ if (IS_ERR(glue->refclock)) {
++ dev_err(dev, "couldn't find refclock on the device tree\n");
++ glue->refclock = NULL;
++ } else {
++ clk_prepare_enable(glue->refclock);
++ pdata->ref_clock_freq = clk_get_rate(glue->refclock);
++ }
++
++ /* TODO: make sure we have this when needed (ie. for WL7) */
++ glue->tcxoclock = of_clk_get_by_name(np, "tcxoclock");
++ if (IS_ERR(glue->tcxoclock)) {
++ dev_err(dev, "couldn't find tcxoclock on the device tree\n");
++ glue->tcxoclock = NULL;
++ } else {
++ clk_prepare_enable(glue->tcxoclock);
++ pdata->ref_clock_freq = clk_get_rate(glue->tcxoclock);
++ }
++
+ goto out;
+
+ out_free:
+@@ -294,6 +316,8 @@ static int wl1271_probe(struct sdio_func *func,
+ /* Use block mode for transferring over one block size of data */
+ func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
+
++ sdio_set_drvdata(func, glue);
++
+ /* The pdata allocated here is freed when the device is freed,
+ * so we don't need an additional out label to free it in case
+ * of error further on.
+@@ -319,8 +343,6 @@ static int wl1271_probe(struct sdio_func *func,
+ if (mmcflags & MMC_PM_KEEP_POWER)
+ pdev_data->pwr_in_suspend = true;
+
+- sdio_set_drvdata(func, glue);
+-
+ /* Tell PM core that we don't need the card to be powered now */
+ pm_runtime_put_noidle(&func->dev);
+
+@@ -387,6 +409,16 @@ static void wl1271_remove(struct sdio_func *func)
+ {
+ struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
+
++ if (glue->refclock) {
++ clk_disable_unprepare(glue->refclock);
++ clk_put(glue->refclock);
++ }
++
++ if (glue->tcxoclock) {
++ clk_disable_unprepare(glue->tcxoclock);
++ clk_put(glue->tcxoclock);
++ }
++
+ /* Undo decrement done above in wl1271_probe */
+ pm_runtime_get_noresume(&func->dev);
+
diff --git a/patches/linux/3.13/0495-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch b/patches/linux/3.13/0495-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
new file mode 100644
index 0000000..7dce7cd
--- /dev/null
+++ b/patches/linux/3.13/0495-v4-8-8-wlcore-wl12xx-check-if-we-got-correct-clock-data-from-DT.patch
@@ -0,0 +1,124 @@
+From patchwork Tue Jul 30 13:04:36 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v4,8/8] wlcore/wl12xx: check if we got correct clock data from DT
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835647
+Message-Id: <137...@ti...>
+To: <lin...@vg...>, <to...@at...>,
+ <ns...@ti...>
+Cc: <co...@ti...>, <lu...@co...>, <mtu...@li...>,
+ <mar...@ar...>, <ba...@ti...>, <gra...@li...>,
+ <rob...@ca...>, <dev...@li...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <nm...@ti...>,
+ <mar...@gm...>
+Date: Tue, 30 Jul 2013 16:04:36 +0300
+
+The fref and the tcxo clocks settings are optional in some platforms.
+WiLink8 doesn't need either, so we don't check the values. WiLink 6
+only needs the fref clock, so we check that it is valid or return with
+an error. WiLink7 needs both clocks, if either is not available we
+return with an error.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Felipe Balbi <ba...@ti...>
+
+---
+drivers/net/wireless/ti/wl12xx/main.c | 20 +++++++++++++++++---
+ drivers/net/wireless/ti/wlcore/sdio.c | 4 ----
+ 2 files changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
+index a6c2a14..60d2ff4 100644
+--- a/drivers/net/wireless/ti/wl12xx/main.c
++++ b/drivers/net/wireless/ti/wl12xx/main.c
+@@ -927,6 +927,11 @@ static int wl128x_boot_clk(struct wl1271 *wl, int *selected_clock)
+ u16 sys_clk_cfg;
+ int ret;
+
++ if ((priv->ref_clock < 0) || (priv->tcxo_clock < 0)) {
++ wl1271_error("Missing fref and/or tcxo clock settings\n");
++ return -EINVAL;
++ }
++
+ /* For XTAL-only modes, FREF will be used after switching from TCXO */
+ if (priv->ref_clock == WL12XX_REFCLOCK_26_XTAL ||
+ priv->ref_clock == WL12XX_REFCLOCK_38_XTAL) {
+@@ -976,6 +981,11 @@ static int wl127x_boot_clk(struct wl1271 *wl)
+ u32 clk;
+ int ret;
+
++ if (priv->ref_clock < 0) {
++ wl1271_error("Missing fref clock settings\n");
++ return -EINVAL;
++ }
++
+ if (WL127X_PG_GET_MAJOR(wl->hw_pg_ver) < 3)
+ wl->quirks |= WLCORE_QUIRK_END_OF_TRANSACTION;
+
+@@ -1758,7 +1768,7 @@ static int wl12xx_setup(struct wl1271 *wl)
+ wlcore_set_ht_cap(wl, IEEE80211_BAND_5GHZ, &wl12xx_ht_cap);
+ wl12xx_conf_init(wl);
+
+- if (!fref_param) {
++ if (!fref_param && (pdata->ref_clock_freq > 0)) {
+ priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
+ pdata->ref_clock_freq,
+ pdata->ref_clock_xtal);
+@@ -1769,6 +1779,8 @@ static int wl12xx_setup(struct wl1271 *wl)
+
+ return priv->ref_clock;
+ }
++ } else if (!fref_param) {
++ priv->ref_clock = -EINVAL;
+ } else {
+ if (!strcmp(fref_param, "19.2"))
+ priv->ref_clock = WL12XX_REFCLOCK_19;
+@@ -1786,7 +1798,7 @@ static int wl12xx_setup(struct wl1271 *wl)
+ wl1271_error("Invalid fref parameter %s", fref_param);
+ }
+
+- if (!tcxo_param) {
++ if (!fref_param && (pdata->tcxo_clock_freq > 0)) {
+ priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
+ pdata->tcxo_clock_freq,
+ true);
+@@ -1796,7 +1808,9 @@ static int wl12xx_setup(struct wl1271 *wl)
+
+ return priv->tcxo_clock;
+ }
+- } else {
++ } else if (!fref_param) {
++ priv->tcxo_clock = -EINVAL;
++ }else {
+ if (!strcmp(tcxo_param, "19.2"))
+ priv->tcxo_clock = WL12XX_TCXOCLOCK_19_2;
+ else if (!strcmp(tcxo_param, "26"))
+diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
+index 60fce49..c76eb66 100644
+--- a/drivers/net/wireless/ti/wlcore/sdio.c
++++ b/drivers/net/wireless/ti/wlcore/sdio.c
+@@ -252,20 +252,16 @@ static struct wl12xx_platform_data *wlcore_get_pdata_from_of(struct device *dev)
+ for_each_matching_node(clock_node, wlcore_sdio_of_clk_match_table)
+ of_fixed_clk_setup(clock_node);
+
+- /* TODO: make sure we have this when needed (ie. for WL6 and WL7) */
+ glue->refclock = of_clk_get_by_name(np, "refclock");
+ if (IS_ERR(glue->refclock)) {
+- dev_err(dev, "couldn't find refclock on the device tree\n");
+ glue->refclock = NULL;
+ } else {
+ clk_prepare_enable(glue->refclock);
+ pdata->ref_clock_freq = clk_get_rate(glue->refclock);
+ }
+
+- /* TODO: make sure we have this when needed (ie. for WL7) */
+ glue->tcxoclock = of_clk_get_by_name(np, "tcxoclock");
+ if (IS_ERR(glue->tcxoclock)) {
+- dev_err(dev, "couldn't find tcxoclock on the device tree\n");
+ glue->tcxoclock = NULL;
+ } else {
+ clk_prepare_enable(glue->tcxoclock);
diff --git a/patches/linux/3.13/0496-v3-Documentation-dt-bindings-TI-WiLink-modules.patch b/patches/linux/3.13/0496-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
new file mode 100644
index 0000000..8bd3e21
--- /dev/null
+++ b/patches/linux/3.13/0496-v3-Documentation-dt-bindings-TI-WiLink-modules.patch
@@ -0,0 +1,105 @@
+From patchwork Tue Jul 30 20:21:08 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v3] Documentation: dt: bindings: TI WiLink modules
+From: Luciano Coelho <co...@ti...>
+X-Patchwork-Id: 2835916
+Message-Id: <137...@ti...>
+To: <dev...@vg...>, <lin...@vg...>
+Cc: <mtu...@li...>, <mar...@ar...>, <ba...@ti...>,
+ <gra...@li...>, <rob...@ca...>,
+ <lin...@vg...>, <lin...@vg...>,
+ <lin...@vg...>,
+ <lin...@li...>, <to...@at...>,
+ <nm...@ti...>, <lau...@id...>
+Date: Tue, 30 Jul 2013 23:21:08 +0300
+
+Add device tree bindings documentation for the TI WiLink modules.
+Currently only the WLAN part of the WiLink6, WiLink7 and WiLink8
+modules is supported.
+
+Signed-off-by: Luciano Coelho <co...@ti...>
+Reviewed-by: Laurent Pinchart <lau...@id...>
+
+---
+In v3, use IRQ_TYPE_LEVEL_HIGH in the example, as suggested by Laurent.
+
+ .../devicetree/bindings/net/wireless/ti-wilink.txt | 68 ++++++++++++++++++++++
+ 1 file changed, 68 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/net/wireless/ti-wilink.txt
+
+diff --git a/Documentation/devicetree/bindings/net/wireless/ti-wilink.txt b/Documentation/devicetree/bindings/net/wireless/ti-wilink.txt
+new file mode 100644
+index 0000000..aafebb1
+--- /dev/null
++++ b/Documentation/devicetree/bindings/net/wireless/ti-wilink.txt
+@@ -0,0 +1,68 @@
++TI WiLink Wireless Modules Device Tree Bindings
++===============================================
++
++The WiLink modules provide wireless connectivity, such as WLAN,
++Bluetooth, FM and NFC.
++
++There are several different modules available, which can be grouped by
++their generation: WiLink6, WiLink7 and WiLink8. WiLink4 is not
++currently supported with device tree.
++
++Currently, only the WLAN portion of the modules is supported with
++device tree.
++
++Required properties:
++--------------------
++
++- compatible: should be "ti,wilink6", "ti,wilink7" or "ti,wilink8"
++- interrupt-parent: the interrupt controller
++- interrupts: out-of-band WLAN interrupt
++ See the interrupt controller's bindings documentation for
++ detailed definition.
++
++Optional properties:
++--------------------
++
++- clocks: list of clocks needed by the chip as follows:
++
++ refclock: the internal WLAN reference clock frequency (required for
++ WiLink6 and WiLink7; not used for WiLink8).
++
++ tcxoclock: the internal WLAN TCXO clock frequency (required for
++ WiLink7 not used for WiLink6 and WiLink8).
++
++ The clocks must be defined and named accordingly. For example:
++
++ clocks = <&refclock>
++ clock-names = "refclock";
++
++ refclock: refclock {
++ compatible = "ti,wilink-clock";
++ #clock-cells = <0>;
++ clock-frequency = <38400000>;
++ };
++
++ Some modules that contain the WiLink chip provide clocks in the
++ module itself. In this case, we define a "ti,wilink-clock" as shown
++ above. But any other clock could in theory be used, so the proper
++ clock definition should be used.
++
++
++Example:
++--------
++
++Example definition that can be used in OMAP4 Panda:
++
++wlan {
++ compatible = "ti,wilink6";
++ interrupt-parent = <&gpio2>;
++ interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio line 53 */
++ clocks = <&refclock>;
++ clock-names = "refclock";
++
++ refclock: refclock {
++ compatible = "ti,wilink-clock";
++ #clock-cells = <0>;
++ clock-frequency = <38400000>;
++ };
++};
hooks/post-receive
--
armadeus
|