All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 16:38 ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Add device-tree support to the wlcore (wl12xx/wl18xx)
driver.

Update the current users to use the bindings instead
of pdata-quirks.

Finally, remove the deprecated wl12xx_platform_data
struct (along with the da850 board file code that
still uses it)

v7:
* rebase (v4.0-rc4)
* fix wlcore_spi compilation (remove platform data)
* additional minor changes in driver code

v6:
* Add Luca's patches to pass irq_trigger/freq
* Support wl12xx as well
* Update all relevant platforms

Eliad Peller (4):
  dt: bindings: add TI's wilink wireless device
  wlcore: add device-tree support
  ARM: dts: add wl12xx/wl18xx bindings
  wlcore: remove wl12xx_platform_data

Luciano Coelho (2):
  wlcore: set irq_trigger in board files instead of hiding behind a
    quirk
  wl12xx: use frequency instead of enumerations for pdata clocks

 .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
 arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
 arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
 arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
 arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
 arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
 arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
 arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
 arch/arm/mach-davinci/Kconfig                      |  11 --
 arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
 arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
 drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
 drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
 drivers/net/wireless/ti/wlcore/boot.c              |   1 -
 drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
 drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
 drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
 include/linux/wl12xx.h                             |  49 ---------
 25 files changed, 311 insertions(+), 312 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 16:38 ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Add device-tree support to the wlcore (wl12xx/wl18xx)
driver.

Update the current users to use the bindings instead
of pdata-quirks.

Finally, remove the deprecated wl12xx_platform_data
struct (along with the da850 board file code that
still uses it)

v7:
* rebase (v4.0-rc4)
* fix wlcore_spi compilation (remove platform data)
* additional minor changes in driver code

v6:
* Add Luca's patches to pass irq_trigger/freq
* Support wl12xx as well
* Update all relevant platforms

Eliad Peller (4):
  dt: bindings: add TI's wilink wireless device
  wlcore: add device-tree support
  ARM: dts: add wl12xx/wl18xx bindings
  wlcore: remove wl12xx_platform_data

Luciano Coelho (2):
  wlcore: set irq_trigger in board files instead of hiding behind a
    quirk
  wl12xx: use frequency instead of enumerations for pdata clocks

 .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
 arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
 arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
 arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
 arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
 arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
 arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
 arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
 arch/arm/mach-davinci/Kconfig                      |  11 --
 arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
 arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
 drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
 drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
 drivers/net/wireless/ti/wlcore/boot.c              |   1 -
 drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
 drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
 drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
 include/linux/wl12xx.h                             |  49 ---------
 25 files changed, 311 insertions(+), 312 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 16:38 ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Add device-tree support to the wlcore (wl12xx/wl18xx)
driver.

Update the current users to use the bindings instead
of pdata-quirks.

Finally, remove the deprecated wl12xx_platform_data
struct (along with the da850 board file code that
still uses it)

v7:
* rebase (v4.0-rc4)
* fix wlcore_spi compilation (remove platform data)
* additional minor changes in driver code

v6:
* Add Luca's patches to pass irq_trigger/freq
* Support wl12xx as well
* Update all relevant platforms

Eliad Peller (4):
  dt: bindings: add TI's wilink wireless device
  wlcore: add device-tree support
  ARM: dts: add wl12xx/wl18xx bindings
  wlcore: remove wl12xx_platform_data

Luciano Coelho (2):
  wlcore: set irq_trigger in board files instead of hiding behind a
    quirk
  wl12xx: use frequency instead of enumerations for pdata clocks

 .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
 arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
 arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
 arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
 arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
 arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
 arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
 arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
 arch/arm/mach-davinci/Kconfig                      |  11 --
 arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
 arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
 drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
 drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
 drivers/net/wireless/ti/wlcore/boot.c              |   1 -
 drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
 drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
 drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
 drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
 include/linux/wl12xx.h                             |  49 ---------
 25 files changed, 311 insertions(+), 312 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 1/6] wlcore: set irq_trigger in board files instead of hiding behind a quirk
  2015-03-18 16:38 ` Eliad Peller
  (?)
@ 2015-03-18 16:38   ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

From: Luciano Coelho <luca@coelho.fi>

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 irq_trigger explicitly.

This will allow us to use standard irq DT definitions
later on.

Signed-off-by: Luciano Coelho <luca@coelho.fi>
[Eliad - rebase, add irq_trigger field and pass it,
update board file changes]
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 arch/arm/mach-davinci/board-da850-evm.c  |  2 +-
 arch/arm/mach-omap2/pdata-quirks.c       |  1 +
 drivers/net/wireless/ti/wlcore/debugfs.c |  2 +-
 drivers/net/wireless/ti/wlcore/main.c    | 27 ++++++++++++++++-----------
 drivers/net/wireless/ti/wlcore/sdio.c    |  2 +-
 drivers/net/wireless/ti/wlcore/wlcore.h  |  5 ++---
 include/linux/wl12xx.h                   |  5 +----
 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 6b5a97d..916589c 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 = {
 
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
+	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
 	.board_ref_clock	= WL12XX_REFCLOCK_38,
-	.platform_quirks	= WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
 };
 
 static __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 e642b07..e86fb0d 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,
 	wl12xx.board_ref_clock = ref_clock;
 	wl12xx.board_tcxo_clock = tcxo_clock;
 	wl12xx.irq = gpio_to_irq(gpio);
+	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
 	res = wl12xx_set_platform_data(&wl12xx);
 	if (res) {
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index 68f3bf2..eb43f94 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,
 	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);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 1e13699..67518f6 100644
--- 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"
@@ -538,7 +539,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 +6250,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;
@@ -6391,7 +6391,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *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 +6419,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;
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index d3dd7bf..2bce00a 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,
 	memset(res, 0x00, sizeof(res));
 
 	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ;
+	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
 	res[0].name = "irq";
 
 	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 d599c86..7f363fa 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -197,6 +197,8 @@ struct wl1271 {
 
 	int irq;
 
+	int irq_flags;
+
 	spinlock_t wl_lock;
 
 	enum wlcore_state state;
@@ -404,9 +406,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;
 
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a9c723b..3876b67 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -57,15 +57,12 @@ struct wl1251_platform_data {
 
 struct wl12xx_platform_data {
 	int irq;
+	u32 irq_trigger;
 	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);
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 1/6] wlcore: set irq_trigger in board files instead of hiding behind a quirk
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

From: Luciano Coelho <luca@coelho.fi>

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 irq_trigger explicitly.

This will allow us to use standard irq DT definitions
later on.

Signed-off-by: Luciano Coelho <luca@coelho.fi>
[Eliad - rebase, add irq_trigger field and pass it,
update board file changes]
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 arch/arm/mach-davinci/board-da850-evm.c  |  2 +-
 arch/arm/mach-omap2/pdata-quirks.c       |  1 +
 drivers/net/wireless/ti/wlcore/debugfs.c |  2 +-
 drivers/net/wireless/ti/wlcore/main.c    | 27 ++++++++++++++++-----------
 drivers/net/wireless/ti/wlcore/sdio.c    |  2 +-
 drivers/net/wireless/ti/wlcore/wlcore.h  |  5 ++---
 include/linux/wl12xx.h                   |  5 +----
 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 6b5a97d..916589c 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 = {
 
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
+	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
 	.board_ref_clock	= WL12XX_REFCLOCK_38,
-	.platform_quirks	= WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
 };
 
 static __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 e642b07..e86fb0d 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,
 	wl12xx.board_ref_clock = ref_clock;
 	wl12xx.board_tcxo_clock = tcxo_clock;
 	wl12xx.irq = gpio_to_irq(gpio);
+	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
 	res = wl12xx_set_platform_data(&wl12xx);
 	if (res) {
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index 68f3bf2..eb43f94 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,
 	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);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 1e13699..67518f6 100644
--- 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"
@@ -538,7 +539,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 +6250,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;
@@ -6391,7 +6391,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *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 +6419,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;
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index d3dd7bf..2bce00a 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,
 	memset(res, 0x00, sizeof(res));
 
 	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ;
+	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
 	res[0].name = "irq";
 
 	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 d599c86..7f363fa 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -197,6 +197,8 @@ struct wl1271 {
 
 	int irq;
 
+	int irq_flags;
+
 	spinlock_t wl_lock;
 
 	enum wlcore_state state;
@@ -404,9 +406,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;
 
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a9c723b..3876b67 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -57,15 +57,12 @@ struct wl1251_platform_data {
 
 struct wl12xx_platform_data {
 	int irq;
+	u32 irq_trigger;
 	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);
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 1/6] wlcore: set irq_trigger in board files instead of hiding behind a quirk
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luciano Coelho <luca@coelho.fi>

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 irq_trigger explicitly.

This will allow us to use standard irq DT definitions
later on.

Signed-off-by: Luciano Coelho <luca@coelho.fi>
[Eliad - rebase, add irq_trigger field and pass it,
update board file changes]
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 arch/arm/mach-davinci/board-da850-evm.c  |  2 +-
 arch/arm/mach-omap2/pdata-quirks.c       |  1 +
 drivers/net/wireless/ti/wlcore/debugfs.c |  2 +-
 drivers/net/wireless/ti/wlcore/main.c    | 27 ++++++++++++++++-----------
 drivers/net/wireless/ti/wlcore/sdio.c    |  2 +-
 drivers/net/wireless/ti/wlcore/wlcore.h  |  5 ++---
 include/linux/wl12xx.h                   |  5 +----
 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 6b5a97d..916589c 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 = {
 
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
+	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
 	.board_ref_clock	= WL12XX_REFCLOCK_38,
-	.platform_quirks	= WL12XX_PLATFORM_QUIRK_EDGE_IRQ,
 };
 
 static __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 e642b07..e86fb0d 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,
 	wl12xx.board_ref_clock = ref_clock;
 	wl12xx.board_tcxo_clock = tcxo_clock;
 	wl12xx.irq = gpio_to_irq(gpio);
+	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
 	res = wl12xx_set_platform_data(&wl12xx);
 	if (res) {
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index 68f3bf2..eb43f94 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,
 	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);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 1e13699..67518f6 100644
--- 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"
@@ -538,7 +539,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 +6250,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;
@@ -6391,7 +6391,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *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 +6419,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;
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index d3dd7bf..2bce00a 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,
 	memset(res, 0x00, sizeof(res));
 
 	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ;
+	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
 	res[0].name = "irq";
 
 	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 d599c86..7f363fa 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -197,6 +197,8 @@ struct wl1271 {
 
 	int irq;
 
+	int irq_flags;
+
 	spinlock_t wl_lock;
 
 	enum wlcore_state state;
@@ -404,9 +406,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;
 
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a9c723b..3876b67 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -57,15 +57,12 @@ struct wl1251_platform_data {
 
 struct wl12xx_platform_data {
 	int irq;
+	u32 irq_trigger;
 	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);
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 2/6] wl12xx: use frequency instead of enumerations for pdata clocks
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

From: Luciano Coelho <luca@coelho.fi>

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.

Signed-off-by: Luciano Coelho <luca@coelho.fi>
[Eliad - small fixes, update board file changes]
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v7: rebase

 arch/arm/mach-davinci/board-da850-evm.c |  3 +-
 arch/arm/mach-omap2/pdata-quirks.c      | 29 ++++++++--------
 drivers/net/wireless/ti/wl12xx/main.c   | 60 ++++++++++++++++++++++++++++++---
 drivers/net/wireless/ti/wl12xx/wl12xx.h | 28 +++++++++++++++
 include/linux/wl12xx.h                  | 27 ++-------------
 5 files changed, 103 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 916589c..853b941 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1386,7 +1386,8 @@ static const short da850_wl12xx_pins[] __initconst = {
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
 	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.board_ref_clock	= WL12XX_REFCLOCK_38,
+	.ref_clock_freq		= 38400000,
+	.ref_clock_xtal		= false,
 };
 
 static __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 e86fb0d..cebdf8d 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -39,14 +39,14 @@ static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
 static struct wl12xx_platform_data wl12xx __initdata;
 
-static void __init __used legacy_init_wl12xx(unsigned ref_clock,
-					     unsigned tcxo_clock,
+static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
+					     u32 tcxo_clock_freq,
 					     int gpio)
 {
 	int res;
 
-	wl12xx.board_ref_clock = ref_clock;
-	wl12xx.board_tcxo_clock = tcxo_clock;
+	wl12xx.ref_clock_freq = ref_clock_freq;
+	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
 	wl12xx.irq = gpio_to_irq(gpio);
 	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
@@ -57,8 +57,8 @@ static void __init __used legacy_init_wl12xx(unsigned ref_clock,
 	}
 }
 #else
-static inline void legacy_init_wl12xx(unsigned ref_clock,
-				      unsigned tcxo_clock,
+static inline void legacy_init_wl12xx(u32 ref_clock_freq,
+				      u32 tcxo_clock_freq,
 				      int gpio)
 {
 }
@@ -130,7 +130,7 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -175,12 +175,12 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
+	legacy_init_wl12xx(38400000, 0, 149);
 }
 
 static void __init omap3_zoom_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
+	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +247,7 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
+	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -292,18 +292,17 @@ static void __init omap3_tao3530_legacy_init(void)
 #ifdef CONFIG_ARCH_OMAP4
 static void __init omap4_sdp_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26,
-			   WL12XX_TCXOCLOCK_26, 53);
+	legacy_init_wl12xx(26000000, 26000000, 53);
 }
 
 static void __init omap4_panda_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
+	legacy_init_wl12xx(38400000, 0, 53);
 }
 
 static void __init var_som_om44_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 41);
+	legacy_init_wl12xx(38400000, 0, 41);
 }
 #endif
 
@@ -318,7 +317,7 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 #ifdef CONFIG_SOC_AM33XX
 static void __init am335x_evmsk_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
+	legacy_init_wl12xx(38400000, 0, 31);
 }
 #endif
 
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 144d1f8..b3f751f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1770,6 +1770,40 @@ wl12xx_iface_combinations[] = {
 	},
 };
 
+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;
+
+	for (i = 0; table[i].freq != 0; i++)
+		if ((table[i].freq == freq) && (table[i].xtal == xtal))
+			return table[i].hw_idx;
+
+	return -EINVAL;
+}
+
 static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
@@ -1799,7 +1833,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 	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;
@@ -1817,9 +1861,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param) {
-		priv->tcxo_clock = pdata->board_tcxo_clock;
-	} else {
+	if (!tcxo_param && pdata->tcxo_clock_freq) {
+		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 (tcxo_param) {
 		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/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h
index 75c9265..5952e99a 100644
--- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
@@ -82,6 +82,34 @@ 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;
+};
+
 struct wl12xx_fw_packet_counters {
 	/* Cumulative counter of released packets per AC */
 	u8 tx_released_pkts[NUM_TX_QUEUES];
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 3876b67..eea1e6d 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -26,28 +26,6 @@
 
 #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 wl1251_platform_data {
 	int power_gpio;
 	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
@@ -58,8 +36,9 @@ struct wl1251_platform_data {
 struct wl12xx_platform_data {
 	int irq;
 	u32 irq_trigger;
-	int board_ref_clock;
-	int board_tcxo_clock;
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
 	bool pwr_in_suspend;
 };
 
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 2/6] wl12xx: use frequency instead of enumerations for pdata clocks
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

From: Luciano Coelho <luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org>

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.

Signed-off-by: Luciano Coelho <luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org>
[Eliad - small fixes, update board file changes]
Signed-off-by: Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
---
v7: rebase

 arch/arm/mach-davinci/board-da850-evm.c |  3 +-
 arch/arm/mach-omap2/pdata-quirks.c      | 29 ++++++++--------
 drivers/net/wireless/ti/wl12xx/main.c   | 60 ++++++++++++++++++++++++++++++---
 drivers/net/wireless/ti/wl12xx/wl12xx.h | 28 +++++++++++++++
 include/linux/wl12xx.h                  | 27 ++-------------
 5 files changed, 103 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 916589c..853b941 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1386,7 +1386,8 @@ static const short da850_wl12xx_pins[] __initconst = {
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
 	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.board_ref_clock	= WL12XX_REFCLOCK_38,
+	.ref_clock_freq		= 38400000,
+	.ref_clock_xtal		= false,
 };
 
 static __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 e86fb0d..cebdf8d 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -39,14 +39,14 @@ static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
 static struct wl12xx_platform_data wl12xx __initdata;
 
-static void __init __used legacy_init_wl12xx(unsigned ref_clock,
-					     unsigned tcxo_clock,
+static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
+					     u32 tcxo_clock_freq,
 					     int gpio)
 {
 	int res;
 
-	wl12xx.board_ref_clock = ref_clock;
-	wl12xx.board_tcxo_clock = tcxo_clock;
+	wl12xx.ref_clock_freq = ref_clock_freq;
+	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
 	wl12xx.irq = gpio_to_irq(gpio);
 	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
@@ -57,8 +57,8 @@ static void __init __used legacy_init_wl12xx(unsigned ref_clock,
 	}
 }
 #else
-static inline void legacy_init_wl12xx(unsigned ref_clock,
-				      unsigned tcxo_clock,
+static inline void legacy_init_wl12xx(u32 ref_clock_freq,
+				      u32 tcxo_clock_freq,
 				      int gpio)
 {
 }
@@ -130,7 +130,7 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -175,12 +175,12 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
+	legacy_init_wl12xx(38400000, 0, 149);
 }
 
 static void __init omap3_zoom_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
+	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +247,7 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
+	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -292,18 +292,17 @@ static void __init omap3_tao3530_legacy_init(void)
 #ifdef CONFIG_ARCH_OMAP4
 static void __init omap4_sdp_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26,
-			   WL12XX_TCXOCLOCK_26, 53);
+	legacy_init_wl12xx(26000000, 26000000, 53);
 }
 
 static void __init omap4_panda_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
+	legacy_init_wl12xx(38400000, 0, 53);
 }
 
 static void __init var_som_om44_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 41);
+	legacy_init_wl12xx(38400000, 0, 41);
 }
 #endif
 
@@ -318,7 +317,7 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 #ifdef CONFIG_SOC_AM33XX
 static void __init am335x_evmsk_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
+	legacy_init_wl12xx(38400000, 0, 31);
 }
 #endif
 
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 144d1f8..b3f751f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1770,6 +1770,40 @@ wl12xx_iface_combinations[] = {
 	},
 };
 
+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;
+
+	for (i = 0; table[i].freq != 0; i++)
+		if ((table[i].freq == freq) && (table[i].xtal == xtal))
+			return table[i].hw_idx;
+
+	return -EINVAL;
+}
+
 static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
@@ -1799,7 +1833,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 	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;
@@ -1817,9 +1861,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param) {
-		priv->tcxo_clock = pdata->board_tcxo_clock;
-	} else {
+	if (!tcxo_param && pdata->tcxo_clock_freq) {
+		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 (tcxo_param) {
 		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/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h
index 75c9265..5952e99a 100644
--- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
@@ -82,6 +82,34 @@ 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;
+};
+
 struct wl12xx_fw_packet_counters {
 	/* Cumulative counter of released packets per AC */
 	u8 tx_released_pkts[NUM_TX_QUEUES];
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 3876b67..eea1e6d 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -26,28 +26,6 @@
 
 #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 wl1251_platform_data {
 	int power_gpio;
 	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
@@ -58,8 +36,9 @@ struct wl1251_platform_data {
 struct wl12xx_platform_data {
 	int irq;
 	u32 irq_trigger;
-	int board_ref_clock;
-	int board_tcxo_clock;
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
 	bool pwr_in_suspend;
 };
 
-- 
1.8.5.2.229.g4448466.dirty

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 2/6] wl12xx: use frequency instead of enumerations for pdata clocks
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luciano Coelho <luca@coelho.fi>

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.

Signed-off-by: Luciano Coelho <luca@coelho.fi>
[Eliad - small fixes, update board file changes]
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v7: rebase

 arch/arm/mach-davinci/board-da850-evm.c |  3 +-
 arch/arm/mach-omap2/pdata-quirks.c      | 29 ++++++++--------
 drivers/net/wireless/ti/wl12xx/main.c   | 60 ++++++++++++++++++++++++++++++---
 drivers/net/wireless/ti/wl12xx/wl12xx.h | 28 +++++++++++++++
 include/linux/wl12xx.h                  | 27 ++-------------
 5 files changed, 103 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 916589c..853b941 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1386,7 +1386,8 @@ static const short da850_wl12xx_pins[] __initconst = {
 static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
 	.irq			= -1,
 	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.board_ref_clock	= WL12XX_REFCLOCK_38,
+	.ref_clock_freq		= 38400000,
+	.ref_clock_xtal		= false,
 };
 
 static __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 e86fb0d..cebdf8d 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -39,14 +39,14 @@ static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
 static struct wl12xx_platform_data wl12xx __initdata;
 
-static void __init __used legacy_init_wl12xx(unsigned ref_clock,
-					     unsigned tcxo_clock,
+static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
+					     u32 tcxo_clock_freq,
 					     int gpio)
 {
 	int res;
 
-	wl12xx.board_ref_clock = ref_clock;
-	wl12xx.board_tcxo_clock = tcxo_clock;
+	wl12xx.ref_clock_freq = ref_clock_freq;
+	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
 	wl12xx.irq = gpio_to_irq(gpio);
 	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
 
@@ -57,8 +57,8 @@ static void __init __used legacy_init_wl12xx(unsigned ref_clock,
 	}
 }
 #else
-static inline void legacy_init_wl12xx(unsigned ref_clock,
-				      unsigned tcxo_clock,
+static inline void legacy_init_wl12xx(u32 ref_clock_freq,
+				      u32 tcxo_clock_freq,
 				      int gpio)
 {
 }
@@ -130,7 +130,7 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
+	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -175,12 +175,12 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
+	legacy_init_wl12xx(38400000, 0, 149);
 }
 
 static void __init omap3_zoom_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
+	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +247,7 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
+	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -292,18 +292,17 @@ static void __init omap3_tao3530_legacy_init(void)
 #ifdef CONFIG_ARCH_OMAP4
 static void __init omap4_sdp_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_26,
-			   WL12XX_TCXOCLOCK_26, 53);
+	legacy_init_wl12xx(26000000, 26000000, 53);
 }
 
 static void __init omap4_panda_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
+	legacy_init_wl12xx(38400000, 0, 53);
 }
 
 static void __init var_som_om44_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 41);
+	legacy_init_wl12xx(38400000, 0, 41);
 }
 #endif
 
@@ -318,7 +317,7 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 #ifdef CONFIG_SOC_AM33XX
 static void __init am335x_evmsk_legacy_init(void)
 {
-	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
+	legacy_init_wl12xx(38400000, 0, 31);
 }
 #endif
 
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 144d1f8..b3f751f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1770,6 +1770,40 @@ wl12xx_iface_combinations[] = {
 	},
 };
 
+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;
+
+	for (i = 0; table[i].freq != 0; i++)
+		if ((table[i].freq == freq) && (table[i].xtal == xtal))
+			return table[i].hw_idx;
+
+	return -EINVAL;
+}
+
 static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
@@ -1799,7 +1833,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 	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;
@@ -1817,9 +1861,17 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param) {
-		priv->tcxo_clock = pdata->board_tcxo_clock;
-	} else {
+	if (!tcxo_param && pdata->tcxo_clock_freq) {
+		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 (tcxo_param) {
 		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/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h
index 75c9265..5952e99a 100644
--- a/drivers/net/wireless/ti/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h
@@ -82,6 +82,34 @@ 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;
+};
+
 struct wl12xx_fw_packet_counters {
 	/* Cumulative counter of released packets per AC */
 	u8 tx_released_pkts[NUM_TX_QUEUES];
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 3876b67..eea1e6d 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -26,28 +26,6 @@
 
 #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 wl1251_platform_data {
 	int power_gpio;
 	/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
@@ -58,8 +36,9 @@ struct wl1251_platform_data {
 struct wl12xx_platform_data {
 	int irq;
 	u32 irq_trigger;
-	int board_ref_clock;
-	int board_tcxo_clock;
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
 	bool pwr_in_suspend;
 };
 
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 3/6] dt: bindings: add TI's wilink wireless device
  2015-03-18 16:38 ` Eliad Peller
  (?)
@ 2015-03-18 16:38   ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Add device tree binding documentation for TI's wilink
(wl12xx and wl18xx) wlan chip.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 .../devicetree/bindings/net/wireless/ti,wlcore.txt | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
new file mode 100644
index 0000000..2a3d90d
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
@@ -0,0 +1,47 @@
+TI Wilink 6/7/8 (wl12xx/wl18xx) SDIO devices
+
+This node provides properties for controlling the wilink wireless device. The
+node is expected to be specified as a child node to the SDIO controller that
+connects the device to the system.
+
+Required properties:
+ - compatible: should be one of the following:
+    * "ti,wl1271"
+    * "ti,wl1273"
+    * "ti,wl1281"
+    * "ti,wl1283"
+    * "ti,wl1801"
+    * "ti,wl1805"
+    * "ti,wl1807"
+    * "ti,wl1831"
+    * "ti,wl1835"
+    * "ti,wl1837"
+ - interrupts : specifies attributes for the out-of-band interrupt.
+
+Optional properties:
+ - interrupt-parent : the phandle for the interrupt controller to which the
+	device interrupts are connected.
+ - ref-clock-frequency : ref clock frequency in Hz
+ - tcxo-clock-frequency : tcxo clock frequency in Hz
+
+Note: the *-clock-frequency properties assume internal clocks. In case of external
+clock, new bindings (for parsing the clock nodes) have to be added.
+
+Example:
+
+&mmc3 {
+	status = "okay";
+	vmmc-supply = <&wlan_en_reg>;
+	bus-width = <4>;
+	cap-power-off-card;
+	keep-power-in-suspend;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 3/6] dt: bindings: add TI's wilink wireless device
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Add device tree binding documentation for TI's wilink
(wl12xx and wl18xx) wlan chip.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 .../devicetree/bindings/net/wireless/ti,wlcore.txt | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
new file mode 100644
index 0000000..2a3d90d
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
@@ -0,0 +1,47 @@
+TI Wilink 6/7/8 (wl12xx/wl18xx) SDIO devices
+
+This node provides properties for controlling the wilink wireless device. The
+node is expected to be specified as a child node to the SDIO controller that
+connects the device to the system.
+
+Required properties:
+ - compatible: should be one of the following:
+    * "ti,wl1271"
+    * "ti,wl1273"
+    * "ti,wl1281"
+    * "ti,wl1283"
+    * "ti,wl1801"
+    * "ti,wl1805"
+    * "ti,wl1807"
+    * "ti,wl1831"
+    * "ti,wl1835"
+    * "ti,wl1837"
+ - interrupts : specifies attributes for the out-of-band interrupt.
+
+Optional properties:
+ - interrupt-parent : the phandle for the interrupt controller to which the
+	device interrupts are connected.
+ - ref-clock-frequency : ref clock frequency in Hz
+ - tcxo-clock-frequency : tcxo clock frequency in Hz
+
+Note: the *-clock-frequency properties assume internal clocks. In case of external
+clock, new bindings (for parsing the clock nodes) have to be added.
+
+Example:
+
+&mmc3 {
+	status = "okay";
+	vmmc-supply = <&wlan_en_reg>;
+	bus-width = <4>;
+	cap-power-off-card;
+	keep-power-in-suspend;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 3/6] dt: bindings: add TI's wilink wireless device
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Add device tree binding documentation for TI's wilink
(wl12xx and wl18xx) wlan chip.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 .../devicetree/bindings/net/wireless/ti,wlcore.txt | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
new file mode 100644
index 0000000..2a3d90d
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
@@ -0,0 +1,47 @@
+TI Wilink 6/7/8 (wl12xx/wl18xx) SDIO devices
+
+This node provides properties for controlling the wilink wireless device. The
+node is expected to be specified as a child node to the SDIO controller that
+connects the device to the system.
+
+Required properties:
+ - compatible: should be one of the following:
+    * "ti,wl1271"
+    * "ti,wl1273"
+    * "ti,wl1281"
+    * "ti,wl1283"
+    * "ti,wl1801"
+    * "ti,wl1805"
+    * "ti,wl1807"
+    * "ti,wl1831"
+    * "ti,wl1835"
+    * "ti,wl1837"
+ - interrupts : specifies attributes for the out-of-band interrupt.
+
+Optional properties:
+ - interrupt-parent : the phandle for the interrupt controller to which the
+	device interrupts are connected.
+ - ref-clock-frequency : ref clock frequency in Hz
+ - tcxo-clock-frequency : tcxo clock frequency in Hz
+
+Note: the *-clock-frequency properties assume internal clocks. In case of external
+clock, new bindings (for parsing the clock nodes) have to be added.
+
+Example:
+
+&mmc3 {
+	status = "okay";
+	vmmc-supply = <&wlan_en_reg>;
+	bus-width = <4>;
+	cap-power-off-card;
+	keep-power-in-suspend;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 4/6] wlcore: add device-tree support
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Ido Yariv

When running with device-tree, we no longer have a board file
that can set up the platform data for wlcore.
Allow this data to be passed from DT.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Tested-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 93 ++++++++++++++++++++++++++++++++---
 1 file changed, 87 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 2bce00a..b55dc0e 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -34,6 +34,8 @@
 #include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include "wlcore.h"
 #include "wl12xx_80211.h"
@@ -214,6 +216,82 @@ static struct wl1271_if_operations sdio_ops = {
 	.set_block_size = wl1271_sdio_set_block_size,
 };
 
+#ifdef CONFIG_OF
+static const struct of_device_id wlcore_sdio_of_match_table[] = {
+	{ .compatible = "ti,wl1271" },
+	{ .compatible = "ti,wl1273" },
+	{ .compatible = "ti,wl1281" },
+	{ .compatible = "ti,wl1283" },
+	{ .compatible = "ti,wl1801" },
+	{ .compatible = "ti,wl1805" },
+	{ .compatible = "ti,wl1807" },
+	{ .compatible = "ti,wl1831" },
+	{ .compatible = "ti,wl1835" },
+	{ .compatible = "ti,wl1837" },
+	{ }
+};
+
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	struct device_node *np = dev->of_node;
+	struct wl12xx_platform_data *pdata;
+
+	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
+		return NULL;
+
+	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		return NULL;
+
+	pdata->irq = irq_of_parse_and_map(np, 0);
+	if (!pdata->irq) {
+		dev_err(dev, "No irq in platform data\n");
+		kfree(pdata);
+		return NULL;
+	}
+
+	pdata->irq_trigger =
+		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
+
+	/* optional clock frequency params */
+	of_property_read_u32(np, "ref-clock-frequency",
+			     &pdata->ref_clock_freq);
+	of_property_read_u32(np, "tcxo-clock-frequency",
+			     &pdata->tcxo_clock_freq);
+
+	return pdata;
+}
+#else
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	return NULL;
+}
+#endif
+
+static struct wl12xx_platform_data *
+wlcore_get_platform_data(struct device *dev)
+{
+	struct wl12xx_platform_data *pdata;
+
+	/* first, look for DT data */
+	pdata = wlcore_probe_of(dev);
+	if (pdata)
+		return pdata;
+
+	/* if not found - fallback to static platform data */
+	pdata = wl12xx_get_platform_data();
+	if (!IS_ERR(pdata))
+		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
+
+	dev_err(dev, "No platform data set\n");
+	return NULL;
+}
+
+static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
+{
+	kfree(pdata);
+}
+
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -245,12 +323,9 @@ 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;
 
-	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);
+	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
+	if (!pdev_data.pdata)
 		goto out_free_glue;
-	}
 
 	/* if sdio can keep power while host is suspended, enable wow */
 	mmcflags = sdio_get_host_pm_caps(func);
@@ -279,7 +354,7 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_glue;
+		goto out_free_pdata;
 	}
 
 	glue->core->dev.parent = &func->dev;
@@ -313,6 +388,9 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
+out_free_pdata:
+	wlcore_del_platform_data(pdev_data.pdata);
+
 out_free_glue:
 	kfree(glue);
 
@@ -323,11 +401,14 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
+	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
+	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
+	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 4/6] wlcore: add device-tree support
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Ido Yariv

When running with device-tree, we no longer have a board file
that can set up the platform data for wlcore.
Allow this data to be passed from DT.

Signed-off-by: Ido Yariv <ido-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Tested-by: Sébastien Szymanski <sebastien.szymanski-d2DlULPkwbNWk0Htik3J/w@public.gmane.org>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 93 ++++++++++++++++++++++++++++++++---
 1 file changed, 87 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 2bce00a..b55dc0e 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -34,6 +34,8 @@
 #include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include "wlcore.h"
 #include "wl12xx_80211.h"
@@ -214,6 +216,82 @@ static struct wl1271_if_operations sdio_ops = {
 	.set_block_size = wl1271_sdio_set_block_size,
 };
 
+#ifdef CONFIG_OF
+static const struct of_device_id wlcore_sdio_of_match_table[] = {
+	{ .compatible = "ti,wl1271" },
+	{ .compatible = "ti,wl1273" },
+	{ .compatible = "ti,wl1281" },
+	{ .compatible = "ti,wl1283" },
+	{ .compatible = "ti,wl1801" },
+	{ .compatible = "ti,wl1805" },
+	{ .compatible = "ti,wl1807" },
+	{ .compatible = "ti,wl1831" },
+	{ .compatible = "ti,wl1835" },
+	{ .compatible = "ti,wl1837" },
+	{ }
+};
+
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	struct device_node *np = dev->of_node;
+	struct wl12xx_platform_data *pdata;
+
+	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
+		return NULL;
+
+	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		return NULL;
+
+	pdata->irq = irq_of_parse_and_map(np, 0);
+	if (!pdata->irq) {
+		dev_err(dev, "No irq in platform data\n");
+		kfree(pdata);
+		return NULL;
+	}
+
+	pdata->irq_trigger =
+		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
+
+	/* optional clock frequency params */
+	of_property_read_u32(np, "ref-clock-frequency",
+			     &pdata->ref_clock_freq);
+	of_property_read_u32(np, "tcxo-clock-frequency",
+			     &pdata->tcxo_clock_freq);
+
+	return pdata;
+}
+#else
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	return NULL;
+}
+#endif
+
+static struct wl12xx_platform_data *
+wlcore_get_platform_data(struct device *dev)
+{
+	struct wl12xx_platform_data *pdata;
+
+	/* first, look for DT data */
+	pdata = wlcore_probe_of(dev);
+	if (pdata)
+		return pdata;
+
+	/* if not found - fallback to static platform data */
+	pdata = wl12xx_get_platform_data();
+	if (!IS_ERR(pdata))
+		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
+
+	dev_err(dev, "No platform data set\n");
+	return NULL;
+}
+
+static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
+{
+	kfree(pdata);
+}
+
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -245,12 +323,9 @@ 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;
 
-	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);
+	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
+	if (!pdev_data.pdata)
 		goto out_free_glue;
-	}
 
 	/* if sdio can keep power while host is suspended, enable wow */
 	mmcflags = sdio_get_host_pm_caps(func);
@@ -279,7 +354,7 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_glue;
+		goto out_free_pdata;
 	}
 
 	glue->core->dev.parent = &func->dev;
@@ -313,6 +388,9 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
+out_free_pdata:
+	wlcore_del_platform_data(pdev_data.pdata);
+
 out_free_glue:
 	kfree(glue);
 
@@ -323,11 +401,14 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
+	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
+	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
+	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
-- 
1.8.5.2.229.g4448466.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 4/6] wlcore: add device-tree support
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

When running with device-tree, we no longer have a board file
that can set up the platform data for wlcore.
Allow this data to be passed from DT.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Tested-by: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 93 ++++++++++++++++++++++++++++++++---
 1 file changed, 87 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 2bce00a..b55dc0e 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -34,6 +34,8 @@
 #include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include "wlcore.h"
 #include "wl12xx_80211.h"
@@ -214,6 +216,82 @@ static struct wl1271_if_operations sdio_ops = {
 	.set_block_size = wl1271_sdio_set_block_size,
 };
 
+#ifdef CONFIG_OF
+static const struct of_device_id wlcore_sdio_of_match_table[] = {
+	{ .compatible = "ti,wl1271" },
+	{ .compatible = "ti,wl1273" },
+	{ .compatible = "ti,wl1281" },
+	{ .compatible = "ti,wl1283" },
+	{ .compatible = "ti,wl1801" },
+	{ .compatible = "ti,wl1805" },
+	{ .compatible = "ti,wl1807" },
+	{ .compatible = "ti,wl1831" },
+	{ .compatible = "ti,wl1835" },
+	{ .compatible = "ti,wl1837" },
+	{ }
+};
+
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	struct device_node *np = dev->of_node;
+	struct wl12xx_platform_data *pdata;
+
+	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
+		return NULL;
+
+	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
+	if (!pdata)
+		return NULL;
+
+	pdata->irq = irq_of_parse_and_map(np, 0);
+	if (!pdata->irq) {
+		dev_err(dev, "No irq in platform data\n");
+		kfree(pdata);
+		return NULL;
+	}
+
+	pdata->irq_trigger =
+		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
+
+	/* optional clock frequency params */
+	of_property_read_u32(np, "ref-clock-frequency",
+			     &pdata->ref_clock_freq);
+	of_property_read_u32(np, "tcxo-clock-frequency",
+			     &pdata->tcxo_clock_freq);
+
+	return pdata;
+}
+#else
+static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+{
+	return NULL;
+}
+#endif
+
+static struct wl12xx_platform_data *
+wlcore_get_platform_data(struct device *dev)
+{
+	struct wl12xx_platform_data *pdata;
+
+	/* first, look for DT data */
+	pdata = wlcore_probe_of(dev);
+	if (pdata)
+		return pdata;
+
+	/* if not found - fallback to static platform data */
+	pdata = wl12xx_get_platform_data();
+	if (!IS_ERR(pdata))
+		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
+
+	dev_err(dev, "No platform data set\n");
+	return NULL;
+}
+
+static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
+{
+	kfree(pdata);
+}
+
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -245,12 +323,9 @@ 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;
 
-	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);
+	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
+	if (!pdev_data.pdata)
 		goto out_free_glue;
-	}
 
 	/* if sdio can keep power while host is suspended, enable wow */
 	mmcflags = sdio_get_host_pm_caps(func);
@@ -279,7 +354,7 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_glue;
+		goto out_free_pdata;
 	}
 
 	glue->core->dev.parent = &func->dev;
@@ -313,6 +388,9 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
+out_free_pdata:
+	wlcore_del_platform_data(pdev_data.pdata);
+
 out_free_glue:
 	kfree(glue);
 
@@ -323,11 +401,14 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
+	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
+	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
+	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Replace all the pdata-quirks for setting wl12xx/wl18xx
platform data with proper DT definitions.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
v7: rebase

 arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
 arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
 arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
 arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
 arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
 arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
 arch/arm/boot/dts/omap4-sdp.dts                | 11 ++++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi | 10 ++++
 arch/arm/mach-omap2/pdata-quirks.c             | 74 --------------------------
 11 files changed, 100 insertions(+), 74 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index df5fee6..87fc7a3 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -15,6 +15,7 @@
 
 #include "am33xx.dtsi"
 #include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "TI AM335x EVM-SK";
@@ -647,6 +648,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; /* gpio 31 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &mcasp1 {
diff --git a/arch/arm/boot/dts/omap3-cm-t3517.dts b/arch/arm/boot/dts/omap3-cm-t3517.dts
index 0ab748c..f5b5a1d 100644
--- a/arch/arm/boot/dts/omap3-cm-t3517.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3517.dts
@@ -133,6 +133,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 145 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
index 46eadb2..2294f5b 100644
--- a/arch/arm/boot/dts/omap3-cm-t3730.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -73,6 +73,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-evm-common.dtsi b/arch/arm/boot/dts/omap3-evm-common.dtsi
index 127f3e7..346552b 100644
--- a/arch/arm/boot/dts/omap3-evm-common.dtsi
+++ b/arch/arm/boot/dts/omap3-evm-common.dtsi
@@ -106,6 +106,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 149 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &twl_gpio {
diff --git a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
index cc8bd0c..72f7cdc 100644
--- a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
+++ b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
@@ -42,4 +42,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 177 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
index 9326b28..b899e34 100644
--- a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
+++ b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
@@ -64,4 +64,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-zoom3.dts b/arch/arm/boot/dts/omap3-zoom3.dts
index 6644f51..131448d 100644
--- a/arch/arm/boot/dts/omap3-zoom3.dts
+++ b/arch/arm/boot/dts/omap3-zoom3.dts
@@ -195,6 +195,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc3_pins &mmc3_2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; /* gpio 162 */
+		ref-clock-frequency = <26000000>;
+	};
 };
 
 &uart1 {
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 1505135..1228de5 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -450,6 +450,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 3e1da43..8c36f51 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -487,6 +487,17 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1281";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <26000000>;
+		tcxo-clock-frequency = <26000000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
index cc66af4..9bceeb7 100644
--- a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
+++ b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
@@ -65,4 +65,14 @@
 	bus-width = <4>;
 	cap-power-off-card;
 	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; /* gpio 41 */
+		ref-clock-frequency = <38400000>;
+	};
 };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index cebdf8d..af11511 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <linux/ti_wilink_st.h>
-#include <linux/wl12xx.h>
 
 #include <linux/platform_data/pinctrl-single.h>
 #include <linux/platform_data/iommu-omap.h>
@@ -35,35 +34,6 @@ struct pdata_init {
 struct of_dev_auxdata omap_auxdata_lookup[];
 static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
-#if IS_ENABLED(CONFIG_WL12XX)
-
-static struct wl12xx_platform_data wl12xx __initdata;
-
-static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
-					     u32 tcxo_clock_freq,
-					     int gpio)
-{
-	int res;
-
-	wl12xx.ref_clock_freq = ref_clock_freq;
-	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
-	wl12xx.irq = gpio_to_irq(gpio);
-	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
-
-	res = wl12xx_set_platform_data(&wl12xx);
-	if (res) {
-		pr_err("error setting wl12xx data: %d\n", res);
-		return;
-	}
-}
-#else
-static inline void legacy_init_wl12xx(u32 ref_clock_freq,
-				      u32 tcxo_clock_freq,
-				      int gpio)
-{
-}
-#endif
-
 #ifdef CONFIG_MACH_NOKIA_N8X0
 static void __init omap2420_n8x0_legacy_init(void)
 {
@@ -130,7 +100,6 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -160,14 +129,12 @@ static struct platform_device btwilink_device = {
 
 static void __init omap3_igep0020_rev_f_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 177);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
 
 static void __init omap3_igep0030_rev_g_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 136);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
@@ -175,12 +142,6 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(38400000, 0, 149);
-}
-
-static void __init omap3_zoom_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +208,6 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -289,23 +249,6 @@ static void __init omap3_tao3530_legacy_init(void)
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#ifdef CONFIG_ARCH_OMAP4
-static void __init omap4_sdp_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 26000000, 53);
-}
-
-static void __init omap4_panda_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 53);
-}
-
-static void __init var_som_om44_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 41);
-}
-#endif
-
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
 static struct iommu_platform_data omap4_iommu_pdata = {
 	.reset_name = "mmu_cache",
@@ -314,13 +257,6 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 };
 #endif
 
-#ifdef CONFIG_SOC_AM33XX
-static void __init am335x_evmsk_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 31);
-}
-#endif
-
 #ifdef CONFIG_SOC_OMAP5
 static void __init omap5_uevm_legacy_init(void)
 {
@@ -421,19 +357,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
-	{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
 #endif
-#ifdef CONFIG_ARCH_OMAP4
-	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
-	{ "ti,omap4-panda", omap4_panda_legacy_init, },
-	{ "variscite,var-dvk-om44", var_som_om44_legacy_init, },
-	{ "variscite,var-stk-om44", var_som_om44_legacy_init, },
-#endif
-#ifdef CONFIG_SOC_AM33XX
-	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
-#endif
 #ifdef CONFIG_SOC_OMAP5
 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
 #endif
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

Replace all the pdata-quirks for setting wl12xx/wl18xx
platform data with proper DT definitions.

Signed-off-by: Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Acked-by: Javier Martinez Canillas <javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org>
Acked-by: Enric Balletbo i Serra <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Tested-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
v7: rebase

 arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
 arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
 arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
 arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
 arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
 arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
 arch/arm/boot/dts/omap4-sdp.dts                | 11 ++++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi | 10 ++++
 arch/arm/mach-omap2/pdata-quirks.c             | 74 --------------------------
 11 files changed, 100 insertions(+), 74 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index df5fee6..87fc7a3 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -15,6 +15,7 @@
 
 #include "am33xx.dtsi"
 #include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "TI AM335x EVM-SK";
@@ -647,6 +648,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; /* gpio 31 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &mcasp1 {
diff --git a/arch/arm/boot/dts/omap3-cm-t3517.dts b/arch/arm/boot/dts/omap3-cm-t3517.dts
index 0ab748c..f5b5a1d 100644
--- a/arch/arm/boot/dts/omap3-cm-t3517.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3517.dts
@@ -133,6 +133,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 145 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
index 46eadb2..2294f5b 100644
--- a/arch/arm/boot/dts/omap3-cm-t3730.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -73,6 +73,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-evm-common.dtsi b/arch/arm/boot/dts/omap3-evm-common.dtsi
index 127f3e7..346552b 100644
--- a/arch/arm/boot/dts/omap3-evm-common.dtsi
+++ b/arch/arm/boot/dts/omap3-evm-common.dtsi
@@ -106,6 +106,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 149 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &twl_gpio {
diff --git a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
index cc8bd0c..72f7cdc 100644
--- a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
+++ b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
@@ -42,4 +42,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 177 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
index 9326b28..b899e34 100644
--- a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
+++ b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
@@ -64,4 +64,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-zoom3.dts b/arch/arm/boot/dts/omap3-zoom3.dts
index 6644f51..131448d 100644
--- a/arch/arm/boot/dts/omap3-zoom3.dts
+++ b/arch/arm/boot/dts/omap3-zoom3.dts
@@ -195,6 +195,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc3_pins &mmc3_2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; /* gpio 162 */
+		ref-clock-frequency = <26000000>;
+	};
 };
 
 &uart1 {
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 1505135..1228de5 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -450,6 +450,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 3e1da43..8c36f51 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -487,6 +487,17 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1281";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <26000000>;
+		tcxo-clock-frequency = <26000000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
index cc66af4..9bceeb7 100644
--- a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
+++ b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
@@ -65,4 +65,14 @@
 	bus-width = <4>;
 	cap-power-off-card;
 	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore@2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; /* gpio 41 */
+		ref-clock-frequency = <38400000>;
+	};
 };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index cebdf8d..af11511 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <linux/ti_wilink_st.h>
-#include <linux/wl12xx.h>
 
 #include <linux/platform_data/pinctrl-single.h>
 #include <linux/platform_data/iommu-omap.h>
@@ -35,35 +34,6 @@ struct pdata_init {
 struct of_dev_auxdata omap_auxdata_lookup[];
 static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
-#if IS_ENABLED(CONFIG_WL12XX)
-
-static struct wl12xx_platform_data wl12xx __initdata;
-
-static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
-					     u32 tcxo_clock_freq,
-					     int gpio)
-{
-	int res;
-
-	wl12xx.ref_clock_freq = ref_clock_freq;
-	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
-	wl12xx.irq = gpio_to_irq(gpio);
-	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
-
-	res = wl12xx_set_platform_data(&wl12xx);
-	if (res) {
-		pr_err("error setting wl12xx data: %d\n", res);
-		return;
-	}
-}
-#else
-static inline void legacy_init_wl12xx(u32 ref_clock_freq,
-				      u32 tcxo_clock_freq,
-				      int gpio)
-{
-}
-#endif
-
 #ifdef CONFIG_MACH_NOKIA_N8X0
 static void __init omap2420_n8x0_legacy_init(void)
 {
@@ -130,7 +100,6 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -160,14 +129,12 @@ static struct platform_device btwilink_device = {
 
 static void __init omap3_igep0020_rev_f_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 177);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
 
 static void __init omap3_igep0030_rev_g_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 136);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
@@ -175,12 +142,6 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(38400000, 0, 149);
-}
-
-static void __init omap3_zoom_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +208,6 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -289,23 +249,6 @@ static void __init omap3_tao3530_legacy_init(void)
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#ifdef CONFIG_ARCH_OMAP4
-static void __init omap4_sdp_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 26000000, 53);
-}
-
-static void __init omap4_panda_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 53);
-}
-
-static void __init var_som_om44_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 41);
-}
-#endif
-
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
 static struct iommu_platform_data omap4_iommu_pdata = {
 	.reset_name = "mmu_cache",
@@ -314,13 +257,6 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 };
 #endif
 
-#ifdef CONFIG_SOC_AM33XX
-static void __init am335x_evmsk_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 31);
-}
-#endif
-
 #ifdef CONFIG_SOC_OMAP5
 static void __init omap5_uevm_legacy_init(void)
 {
@@ -421,19 +357,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
-	{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
 #endif
-#ifdef CONFIG_ARCH_OMAP4
-	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
-	{ "ti,omap4-panda", omap4_panda_legacy_init, },
-	{ "variscite,var-dvk-om44", var_som_om44_legacy_init, },
-	{ "variscite,var-stk-om44", var_som_om44_legacy_init, },
-#endif
-#ifdef CONFIG_SOC_AM33XX
-	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
-#endif
 #ifdef CONFIG_SOC_OMAP5
 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
 #endif
-- 
1.8.5.2.229.g4448466.dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Replace all the pdata-quirks for setting wl12xx/wl18xx
platform data with proper DT definitions.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
Tested-by: Tony Lindgren <tony@atomide.com>
---
v7: rebase

 arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
 arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
 arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
 arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
 arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
 arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
 arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
 arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
 arch/arm/boot/dts/omap4-sdp.dts                | 11 ++++
 arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi | 10 ++++
 arch/arm/mach-omap2/pdata-quirks.c             | 74 --------------------------
 11 files changed, 100 insertions(+), 74 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index df5fee6..87fc7a3 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -15,6 +15,7 @@
 
 #include "am33xx.dtsi"
 #include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "TI AM335x EVM-SK";
@@ -647,6 +648,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <31 IRQ_TYPE_LEVEL_HIGH>; /* gpio 31 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &mcasp1 {
diff --git a/arch/arm/boot/dts/omap3-cm-t3517.dts b/arch/arm/boot/dts/omap3-cm-t3517.dts
index 0ab748c..f5b5a1d 100644
--- a/arch/arm/boot/dts/omap3-cm-t3517.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3517.dts
@@ -133,6 +133,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 145 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
index 46eadb2..2294f5b 100644
--- a/arch/arm/boot/dts/omap3-cm-t3730.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -73,6 +73,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &dss {
diff --git a/arch/arm/boot/dts/omap3-evm-common.dtsi b/arch/arm/boot/dts/omap3-evm-common.dtsi
index 127f3e7..346552b 100644
--- a/arch/arm/boot/dts/omap3-evm-common.dtsi
+++ b/arch/arm/boot/dts/omap3-evm-common.dtsi
@@ -106,6 +106,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 149 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &twl_gpio {
diff --git a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
index cc8bd0c..72f7cdc 100644
--- a/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
+++ b/arch/arm/boot/dts/omap3-igep0020-rev-f.dts
@@ -42,4 +42,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; /* gpio 177 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
index 9326b28..b899e34 100644
--- a/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
+++ b/arch/arm/boot/dts/omap3-igep0030-rev-g.dts
@@ -64,4 +64,13 @@
 	vmmc-supply = <&lbep5clwmc_wlen>;
 	bus-width = <4>;
 	non-removable;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1835";
+		reg = <2>;
+		interrupt-parent = <&gpio5>;
+		interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; /* gpio 136 */
+	};
 };
diff --git a/arch/arm/boot/dts/omap3-zoom3.dts b/arch/arm/boot/dts/omap3-zoom3.dts
index 6644f51..131448d 100644
--- a/arch/arm/boot/dts/omap3-zoom3.dts
+++ b/arch/arm/boot/dts/omap3-zoom3.dts
@@ -195,6 +195,16 @@
 	cap-power-off-card;
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc3_pins &mmc3_2_pins>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio6>;
+		interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; /* gpio 162 */
+		ref-clock-frequency = <26000000>;
+	};
 };
 
 &uart1 {
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 1505135..1228de5 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -450,6 +450,16 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <38400000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 3e1da43..8c36f51 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -487,6 +487,17 @@
 	non-removable;
 	bus-width = <4>;
 	cap-power-off-card;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1281";
+		reg = <2>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <21 IRQ_TYPE_LEVEL_HIGH>; /* gpio 53 */
+		ref-clock-frequency = <26000000>;
+		tcxo-clock-frequency = <26000000>;
+	};
 };
 
 &emif1 {
diff --git a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
index cc66af4..9bceeb7 100644
--- a/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
+++ b/arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi
@@ -65,4 +65,14 @@
 	bus-width = <4>;
 	cap-power-off-card;
 	status = "okay";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	wlcore: wlcore at 2 {
+		compatible = "ti,wl1271";
+		reg = <2>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <9 IRQ_TYPE_LEVEL_HIGH>; /* gpio 41 */
+		ref-clock-frequency = <38400000>;
+	};
 };
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index cebdf8d..af11511 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/of_platform.h>
 #include <linux/ti_wilink_st.h>
-#include <linux/wl12xx.h>
 
 #include <linux/platform_data/pinctrl-single.h>
 #include <linux/platform_data/iommu-omap.h>
@@ -35,35 +34,6 @@ struct pdata_init {
 struct of_dev_auxdata omap_auxdata_lookup[];
 static struct twl4030_gpio_platform_data twl_gpio_auxdata;
 
-#if IS_ENABLED(CONFIG_WL12XX)
-
-static struct wl12xx_platform_data wl12xx __initdata;
-
-static void __init __used legacy_init_wl12xx(u32 ref_clock_freq,
-					     u32 tcxo_clock_freq,
-					     int gpio)
-{
-	int res;
-
-	wl12xx.ref_clock_freq = ref_clock_freq;
-	wl12xx.tcxo_clock_freq = tcxo_clock_freq;
-	wl12xx.irq = gpio_to_irq(gpio);
-	wl12xx.irq_trigger = IRQ_TYPE_LEVEL_HIGH;
-
-	res = wl12xx_set_platform_data(&wl12xx);
-	if (res) {
-		pr_err("error setting wl12xx data: %d\n", res);
-		return;
-	}
-}
-#else
-static inline void legacy_init_wl12xx(u32 ref_clock_freq,
-				      u32 tcxo_clock_freq,
-				      int gpio)
-{
-}
-#endif
-
 #ifdef CONFIG_MACH_NOKIA_N8X0
 static void __init omap2420_n8x0_legacy_init(void)
 {
@@ -130,7 +100,6 @@ static void __init omap3_sbc_t3730_twl_init(void)
 static void __init omap3_sbc_t3730_legacy_init(void)
 {
 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
-	legacy_init_wl12xx(38400000, 0, 136);
 }
 
 static void __init omap3_sbc_t3530_legacy_init(void)
@@ -160,14 +129,12 @@ static struct platform_device btwilink_device = {
 
 static void __init omap3_igep0020_rev_f_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 177);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
 
 static void __init omap3_igep0030_rev_g_legacy_init(void)
 {
-	legacy_init_wl12xx(0, 0, 136);
 	platform_device_register(&wl18xx_device);
 	platform_device_register(&btwilink_device);
 }
@@ -175,12 +142,6 @@ static void __init omap3_igep0030_rev_g_legacy_init(void)
 static void __init omap3_evm_legacy_init(void)
 {
 	hsmmc2_internal_input_clk();
-	legacy_init_wl12xx(38400000, 0, 149);
-}
-
-static void __init omap3_zoom_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 0, 162);
 }
 
 static void am35xx_enable_emac_int(void)
@@ -247,7 +208,6 @@ static void __init omap3_sbc_t3517_legacy_init(void)
 	am35xx_emac_reset();
 	hsmmc2_internal_input_clk();
 	omap3_sbc_t3517_wifi_init();
-	legacy_init_wl12xx(38400000, 0, 145);
 }
 
 static void __init am3517_evm_legacy_init(void)
@@ -289,23 +249,6 @@ static void __init omap3_tao3530_legacy_init(void)
 }
 #endif /* CONFIG_ARCH_OMAP3 */
 
-#ifdef CONFIG_ARCH_OMAP4
-static void __init omap4_sdp_legacy_init(void)
-{
-	legacy_init_wl12xx(26000000, 26000000, 53);
-}
-
-static void __init omap4_panda_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 53);
-}
-
-static void __init var_som_om44_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 41);
-}
-#endif
-
 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
 static struct iommu_platform_data omap4_iommu_pdata = {
 	.reset_name = "mmu_cache",
@@ -314,13 +257,6 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 };
 #endif
 
-#ifdef CONFIG_SOC_AM33XX
-static void __init am335x_evmsk_legacy_init(void)
-{
-	legacy_init_wl12xx(38400000, 0, 31);
-}
-#endif
-
 #ifdef CONFIG_SOC_OMAP5
 static void __init omap5_uevm_legacy_init(void)
 {
@@ -421,19 +357,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
-	{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
 #endif
-#ifdef CONFIG_ARCH_OMAP4
-	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
-	{ "ti,omap4-panda", omap4_panda_legacy_init, },
-	{ "variscite,var-dvk-om44", var_som_om44_legacy_init, },
-	{ "variscite,var-stk-om44", var_som_om44_legacy_init, },
-#endif
-#ifdef CONFIG_SOC_AM33XX
-	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
-#endif
 #ifdef CONFIG_SOC_OMAP5
 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
 #endif
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
  2015-03-18 16:38 ` Eliad Peller
  (?)
@ 2015-03-18 16:38   ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

Now that we have wlcore device-tree bindings in place
(for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_data struct, and move its members
into the platform device data (that is passed to wlcore)

Davinci 850 is the only platform that still set
the platform data in the legacy way (and doesn't
have DT bindings), so remove the relevant
code/Kconfig option from the board file (as suggested
by Sekhar Nori)

Since no one currently uses wlcore_spi, simply remove its
platform data support (DT bindings will have to be added
if someone actually needs it)

Signed-off-by: Luciano Coelho <luca@coelho.fi>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger from wlcore_platdev_data (they are
  being passed separately)

 arch/arm/mach-davinci/Kconfig                  |  11 ---
 arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
 drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
 drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
 drivers/net/wireless/ti/wlcore/boot.c          |   1 -
 drivers/net/wireless/ti/wlcore/main.c          |   4 +-
 drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
 drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
 include/linux/wl12xx.h                         |  25 ------
 10 files changed, 35 insertions(+), 251 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index cd30f6f..dd8f531 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -200,17 +200,6 @@ config DA850_UI_SD_VIDEO_PORT
 
 endchoice
 
-config DA850_WL12XX
-	bool "AM18x wl1271 daughter board"
-	depends on MACH_DAVINCI_DA850_EVM
-	help
-	  The wl1271 daughter card for AM18x EVMs is a combo wireless
-	  connectivity add-on card, based on the LS Research TiWi module with
-	  Texas Instruments' wl1271 solution.
-	  Say Y if you want to use a wl1271 expansion card connected to the
-	  AM18x EVM.
-
-
 config MACH_MITYOMAPL138
 	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
 	depends on ARCH_DAVINCI_DA850
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 853b941..1ed545c 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,7 +38,6 @@
 #include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/wl12xx.h>
 
 #include <mach/common.h>
 #include <mach/cp_intc.h>
@@ -60,9 +59,6 @@
 #define DA850_MMCSD_CD_PIN		GPIO_TO_PIN(4, 0)
 #define DA850_MMCSD_WP_PIN		GPIO_TO_PIN(4, 1)
 
-#define DA850_WLAN_EN			GPIO_TO_PIN(6, 9)
-#define DA850_WLAN_IRQ			GPIO_TO_PIN(6, 10)
-
 #define DA850_MII_MDIO_CLKEN_PIN	GPIO_TO_PIN(2, 6)
 
 static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
 static __init void da850_vpif_init(void) {}
 #endif
 
-#ifdef CONFIG_DA850_WL12XX
-
-static void wl12xx_set_power(int index, bool power_on)
-{
-	static bool power_state;
-
-	pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
-
-	if (power_on == power_state)
-		return;
-	power_state = power_on;
-
-	if (power_on) {
-		/* Power up sequence required for wl127x devices */
-		gpio_set_value(DA850_WLAN_EN, 1);
-		usleep_range(15000, 15000);
-		gpio_set_value(DA850_WLAN_EN, 0);
-		usleep_range(1000, 1000);
-		gpio_set_value(DA850_WLAN_EN, 1);
-		msleep(70);
-	} else {
-		gpio_set_value(DA850_WLAN_EN, 0);
-	}
-}
-
-static struct davinci_mmc_config da850_wl12xx_mmc_config = {
-	.set_power	= wl12xx_set_power,
-	.wires		= 4,
-	.max_freq	= 25000000,
-	.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
-			  MMC_CAP_POWER_OFF_CARD,
-};
-
-static const short da850_wl12xx_pins[] __initconst = {
-	DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
-	DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
-	DA850_GPIO6_9, DA850_GPIO6_10,
-	-1
-};
-
-static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
-	.irq			= -1,
-	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.ref_clock_freq		= 38400000,
-	.ref_clock_xtal		= false,
-};
-
-static __init int da850_wl12xx_init(void)
-{
-	int ret;
-
-	ret = davinci_cfg_reg_list(da850_wl12xx_pins);
-	if (ret) {
-		pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
-	if (ret) {
-		pr_err("wl12xx/mmc registration failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
-	if (ret) {
-		pr_err("Could not request wl12xx enable gpio: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
-	if (ret) {
-		pr_err("Could not request wl12xx irq gpio: %d\n", ret);
-		goto free_wlan_en;
-	}
-
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
-		goto free_wlan_irq;
-	}
-
-	return 0;
-
-free_wlan_irq:
-	gpio_free(DA850_WLAN_IRQ);
-
-free_wlan_en:
-	gpio_free(DA850_WLAN_EN);
-
-exit:
-	return ret;
-}
-
-#else /* CONFIG_DA850_WL12XX */
-
-static __init int da850_wl12xx_init(void)
-{
-	return 0;
-}
-
-#endif /* CONFIG_DA850_WL12XX */
-
 #define DA850EVM_SATA_REFCLKPN_RATE	(100 * 1000 * 1000)
 
 static __init void da850_evm_init(void)
@@ -1503,11 +1395,6 @@ static __init void da850_evm_init(void)
 		if (ret)
 			pr_warn("%s: MMCSD0 registration failed: %d\n",
 				__func__, ret);
-
-		ret = da850_wl12xx_init();
-		if (ret)
-			pr_warn("%s: WL12xx initialization failed: %d\n",
-				__func__, ret);
 	}
 
 	davinci_serial_init(da8xx_serial_device);
diff --git a/drivers/net/wireless/ti/wilink_platform_data.c b/drivers/net/wireless/ti/wilink_platform_data.c
index a92bd3e..ea0e359 100644
--- a/drivers/net/wireless/ti/wilink_platform_data.c
+++ b/drivers/net/wireless/ti/wilink_platform_data.c
@@ -23,31 +23,6 @@
 #include <linux/err.h>
 #include <linux/wl12xx.h>
 
-static struct wl12xx_platform_data *wl12xx_platform_data;
-
-int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	if (wl12xx_platform_data)
-		return -EBUSY;
-	if (!data)
-		return -EINVAL;
-
-	wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
-	if (!wl12xx_platform_data)
-		return -ENOMEM;
-
-	return 0;
-}
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	if (!wl12xx_platform_data)
-		return ERR_PTR(-ENODEV);
-
-	return wl12xx_platform_data;
-}
-EXPORT_SYMBOL(wl12xx_get_platform_data);
-
 static struct wl1251_platform_data *wl1251_platform_data;
 
 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index b3f751f..af0fe2e 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -24,8 +24,6 @@
 
 #include <linux/err.h>
 
-#include <linux/wl12xx.h>
-
 #include "../wlcore/wlcore.h"
 #include "../wlcore/debug.h"
 #include "../wlcore/io.h"
@@ -1808,7 +1806,6 @@ static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
 	struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
 	BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
@@ -1834,12 +1831,12 @@ static int wl12xx_setup(struct wl1271 *wl)
 
 	if (!fref_param) {
 		priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
-						       pdata->ref_clock_freq,
-						       pdata->ref_clock_xtal);
+						pdev_data->ref_clock_freq,
+						pdev_data->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 ?
+				     pdev_data->ref_clock_freq,
+				     pdev_data->ref_clock_xtal ?
 				     "XTAL" : "not XTAL");
 
 			return priv->ref_clock;
@@ -1861,13 +1858,13 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param && pdata->tcxo_clock_freq) {
+	if (!tcxo_param && pdev_data->tcxo_clock_freq) {
 		priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
-							pdata->tcxo_clock_freq,
-							true);
+						pdev_data->tcxo_clock_freq,
+						true);
 		if (priv->tcxo_clock < 0) {
 			wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
-				     pdata->tcxo_clock_freq);
+				     pdev_data->tcxo_clock_freq);
 
 			return priv->tcxo_clock;
 		}
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 77752b0..19b7ec7 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -22,7 +22,6 @@
  */
 
 #include <linux/slab.h>
-#include <linux/wl12xx.h>
 #include <linux/export.h>
 
 #include "debug.h"
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 67518f6..0be8079 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -25,7 +25,6 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/vmalloc.h>
-#include <linux/wl12xx.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
@@ -6390,7 +6389,6 @@ 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;
 	struct resource *res;
 
 	int ret;
@@ -6446,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
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index b55dc0e..ea7e07a 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -31,7 +31,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
 #include <linux/gpio.h>
-#include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
 #include <linux/of.h>
@@ -231,67 +230,37 @@ static const struct of_device_id wlcore_sdio_of_match_table[] = {
 	{ }
 };
 
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
 	struct device_node *np = dev->of_node;
-	struct wl12xx_platform_data *pdata;
 
 	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
-		return NULL;
+		return -ENODATA;
 
-	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
-	if (!pdata)
-		return NULL;
-
-	pdata->irq = irq_of_parse_and_map(np, 0);
-	if (!pdata->irq) {
+	*irq = irq_of_parse_and_map(np, 0);
+	if (!*irq) {
 		dev_err(dev, "No irq in platform data\n");
-		kfree(pdata);
-		return NULL;
+		kfree(pdev_data);
+		return -EINVAL;
 	}
 
-	pdata->irq_trigger =
-		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
-
 	/* optional clock frequency params */
 	of_property_read_u32(np, "ref-clock-frequency",
-			     &pdata->ref_clock_freq);
+			     &pdev_data->ref_clock_freq);
 	of_property_read_u32(np, "tcxo-clock-frequency",
-			     &pdata->tcxo_clock_freq);
+			     &pdev_data->tcxo_clock_freq);
 
-	return pdata;
+	return 0;
 }
 #else
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
-	return NULL;
+	return -ENODATA;
 }
 #endif
 
-static struct wl12xx_platform_data *
-wlcore_get_platform_data(struct device *dev)
-{
-	struct wl12xx_platform_data *pdata;
-
-	/* first, look for DT data */
-	pdata = wlcore_probe_of(dev);
-	if (pdata)
-		return pdata;
-
-	/* if not found - fallback to static platform data */
-	pdata = wl12xx_get_platform_data();
-	if (!IS_ERR(pdata))
-		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
-
-	dev_err(dev, "No platform data set\n");
-	return NULL;
-}
-
-static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
-{
-	kfree(pdata);
-}
-
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -300,6 +269,7 @@ static int wl1271_probe(struct sdio_func *func,
 	struct resource res[1];
 	mmc_pm_flag_t mmcflags;
 	int ret = -ENOMEM;
+	int irq;
 	const char *chip_family;
 
 	/* We are only able to handle the wlan function */
@@ -323,8 +293,7 @@ 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;
 
-	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
-	if (!pdev_data.pdata)
+	if (wlcore_probe_of(&func->dev, &irq, &pdev_data))
 		goto out_free_glue;
 
 	/* if sdio can keep power while host is suspended, enable wow */
@@ -332,7 +301,7 @@ static int wl1271_probe(struct sdio_func *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);
 
@@ -354,15 +323,16 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_pdata;
+		goto out_free_glue;
 	}
 
 	glue->core->dev.parent = &func->dev;
 
 	memset(res, 0x00, sizeof(res));
 
-	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
+	res[0].start = irq;
+	res[0].flags = IORESOURCE_IRQ |
+		       irqd_get_trigger_type(irq_get_irq_data(irq));
 	res[0].name = "irq";
 
 	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
@@ -388,9 +358,6 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
-out_free_pdata:
-	wlcore_del_platform_data(pdev_data.pdata);
-
 out_free_glue:
 	kfree(glue);
 
@@ -401,14 +368,11 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
-	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
-	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 69601f6..f1ac283 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -331,11 +331,7 @@ static int wl1271_probe(struct spi_device *spi)
 
 	memset(&pdev_data, 0x00, sizeof(pdev_data));
 
-	pdev_data.pdata = dev_get_platdata(&spi->dev);
-	if (!pdev_data.pdata) {
-		dev_err(&spi->dev, "no platform data\n");
-		return -ENODEV;
-	}
+	/* TODO: add DT parsing when needed */
 
 	pdev_data.if_ops = &spi_ops;
 
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 3396ce5..39efc6d 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -201,8 +201,12 @@ struct wl1271_if_operations {
 };
 
 struct wlcore_platdev_data {
-	struct wl12xx_platform_data *pdata;
 	struct wl1271_if_operations *if_ops;
+
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
+	bool pwr_in_suspend;
 };
 
 #define MAX_NUM_KEYS 14
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index eea1e6d..95704cd 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -33,21 +33,8 @@ struct wl1251_platform_data {
 	bool use_eeprom;
 };
 
-struct wl12xx_platform_data {
-	int irq;
-	u32 irq_trigger;
-	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
-	u32 ref_clock_freq;	/* in Hertz */
-	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
-	bool pwr_in_suspend;
-};
-
 #ifdef CONFIG_WILINK_PLATFORM_DATA
 
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void);
-
 int wl1251_set_platform_data(const struct wl1251_platform_data *data);
 
 struct wl1251_platform_data *wl1251_get_platform_data(void);
@@ -55,18 +42,6 @@ struct wl1251_platform_data *wl1251_get_platform_data(void);
 #else
 
 static inline
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	return -ENOSYS;
-}
-
-static inline
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	return ERR_PTR(-ENODATA);
-}
-
-static inline
 int wl1251_set_platform_data(const struct wl1251_platform_data *data)
 {
 	return -ENOSYS;
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman, Luciano Coelho

Now that we have wlcore device-tree bindings in place
(for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_data struct, and move its members
into the platform device data (that is passed to wlcore)

Davinci 850 is the only platform that still set
the platform data in the legacy way (and doesn't
have DT bindings), so remove the relevant
code/Kconfig option from the board file (as suggested
by Sekhar Nori)

Since no one currently uses wlcore_spi, simply remove its
platform data support (DT bindings will have to be added
if someone actually needs it)

Signed-off-by: Luciano Coelho <luca@coelho.fi>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger from wlcore_platdev_data (they are
  being passed separately)

 arch/arm/mach-davinci/Kconfig                  |  11 ---
 arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
 drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
 drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
 drivers/net/wireless/ti/wlcore/boot.c          |   1 -
 drivers/net/wireless/ti/wlcore/main.c          |   4 +-
 drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
 drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
 include/linux/wl12xx.h                         |  25 ------
 10 files changed, 35 insertions(+), 251 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index cd30f6f..dd8f531 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -200,17 +200,6 @@ config DA850_UI_SD_VIDEO_PORT
 
 endchoice
 
-config DA850_WL12XX
-	bool "AM18x wl1271 daughter board"
-	depends on MACH_DAVINCI_DA850_EVM
-	help
-	  The wl1271 daughter card for AM18x EVMs is a combo wireless
-	  connectivity add-on card, based on the LS Research TiWi module with
-	  Texas Instruments' wl1271 solution.
-	  Say Y if you want to use a wl1271 expansion card connected to the
-	  AM18x EVM.
-
-
 config MACH_MITYOMAPL138
 	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
 	depends on ARCH_DAVINCI_DA850
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 853b941..1ed545c 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,7 +38,6 @@
 #include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/wl12xx.h>
 
 #include <mach/common.h>
 #include <mach/cp_intc.h>
@@ -60,9 +59,6 @@
 #define DA850_MMCSD_CD_PIN		GPIO_TO_PIN(4, 0)
 #define DA850_MMCSD_WP_PIN		GPIO_TO_PIN(4, 1)
 
-#define DA850_WLAN_EN			GPIO_TO_PIN(6, 9)
-#define DA850_WLAN_IRQ			GPIO_TO_PIN(6, 10)
-
 #define DA850_MII_MDIO_CLKEN_PIN	GPIO_TO_PIN(2, 6)
 
 static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
 static __init void da850_vpif_init(void) {}
 #endif
 
-#ifdef CONFIG_DA850_WL12XX
-
-static void wl12xx_set_power(int index, bool power_on)
-{
-	static bool power_state;
-
-	pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
-
-	if (power_on == power_state)
-		return;
-	power_state = power_on;
-
-	if (power_on) {
-		/* Power up sequence required for wl127x devices */
-		gpio_set_value(DA850_WLAN_EN, 1);
-		usleep_range(15000, 15000);
-		gpio_set_value(DA850_WLAN_EN, 0);
-		usleep_range(1000, 1000);
-		gpio_set_value(DA850_WLAN_EN, 1);
-		msleep(70);
-	} else {
-		gpio_set_value(DA850_WLAN_EN, 0);
-	}
-}
-
-static struct davinci_mmc_config da850_wl12xx_mmc_config = {
-	.set_power	= wl12xx_set_power,
-	.wires		= 4,
-	.max_freq	= 25000000,
-	.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
-			  MMC_CAP_POWER_OFF_CARD,
-};
-
-static const short da850_wl12xx_pins[] __initconst = {
-	DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
-	DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
-	DA850_GPIO6_9, DA850_GPIO6_10,
-	-1
-};
-
-static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
-	.irq			= -1,
-	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.ref_clock_freq		= 38400000,
-	.ref_clock_xtal		= false,
-};
-
-static __init int da850_wl12xx_init(void)
-{
-	int ret;
-
-	ret = davinci_cfg_reg_list(da850_wl12xx_pins);
-	if (ret) {
-		pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
-	if (ret) {
-		pr_err("wl12xx/mmc registration failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
-	if (ret) {
-		pr_err("Could not request wl12xx enable gpio: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
-	if (ret) {
-		pr_err("Could not request wl12xx irq gpio: %d\n", ret);
-		goto free_wlan_en;
-	}
-
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
-		goto free_wlan_irq;
-	}
-
-	return 0;
-
-free_wlan_irq:
-	gpio_free(DA850_WLAN_IRQ);
-
-free_wlan_en:
-	gpio_free(DA850_WLAN_EN);
-
-exit:
-	return ret;
-}
-
-#else /* CONFIG_DA850_WL12XX */
-
-static __init int da850_wl12xx_init(void)
-{
-	return 0;
-}
-
-#endif /* CONFIG_DA850_WL12XX */
-
 #define DA850EVM_SATA_REFCLKPN_RATE	(100 * 1000 * 1000)
 
 static __init void da850_evm_init(void)
@@ -1503,11 +1395,6 @@ static __init void da850_evm_init(void)
 		if (ret)
 			pr_warn("%s: MMCSD0 registration failed: %d\n",
 				__func__, ret);
-
-		ret = da850_wl12xx_init();
-		if (ret)
-			pr_warn("%s: WL12xx initialization failed: %d\n",
-				__func__, ret);
 	}
 
 	davinci_serial_init(da8xx_serial_device);
diff --git a/drivers/net/wireless/ti/wilink_platform_data.c b/drivers/net/wireless/ti/wilink_platform_data.c
index a92bd3e..ea0e359 100644
--- a/drivers/net/wireless/ti/wilink_platform_data.c
+++ b/drivers/net/wireless/ti/wilink_platform_data.c
@@ -23,31 +23,6 @@
 #include <linux/err.h>
 #include <linux/wl12xx.h>
 
-static struct wl12xx_platform_data *wl12xx_platform_data;
-
-int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	if (wl12xx_platform_data)
-		return -EBUSY;
-	if (!data)
-		return -EINVAL;
-
-	wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
-	if (!wl12xx_platform_data)
-		return -ENOMEM;
-
-	return 0;
-}
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	if (!wl12xx_platform_data)
-		return ERR_PTR(-ENODEV);
-
-	return wl12xx_platform_data;
-}
-EXPORT_SYMBOL(wl12xx_get_platform_data);
-
 static struct wl1251_platform_data *wl1251_platform_data;
 
 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index b3f751f..af0fe2e 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -24,8 +24,6 @@
 
 #include <linux/err.h>
 
-#include <linux/wl12xx.h>
-
 #include "../wlcore/wlcore.h"
 #include "../wlcore/debug.h"
 #include "../wlcore/io.h"
@@ -1808,7 +1806,6 @@ static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
 	struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
 	BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
@@ -1834,12 +1831,12 @@ static int wl12xx_setup(struct wl1271 *wl)
 
 	if (!fref_param) {
 		priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
-						       pdata->ref_clock_freq,
-						       pdata->ref_clock_xtal);
+						pdev_data->ref_clock_freq,
+						pdev_data->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 ?
+				     pdev_data->ref_clock_freq,
+				     pdev_data->ref_clock_xtal ?
 				     "XTAL" : "not XTAL");
 
 			return priv->ref_clock;
@@ -1861,13 +1858,13 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param && pdata->tcxo_clock_freq) {
+	if (!tcxo_param && pdev_data->tcxo_clock_freq) {
 		priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
-							pdata->tcxo_clock_freq,
-							true);
+						pdev_data->tcxo_clock_freq,
+						true);
 		if (priv->tcxo_clock < 0) {
 			wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
-				     pdata->tcxo_clock_freq);
+				     pdev_data->tcxo_clock_freq);
 
 			return priv->tcxo_clock;
 		}
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 77752b0..19b7ec7 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -22,7 +22,6 @@
  */
 
 #include <linux/slab.h>
-#include <linux/wl12xx.h>
 #include <linux/export.h>
 
 #include "debug.h"
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 67518f6..0be8079 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -25,7 +25,6 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/vmalloc.h>
-#include <linux/wl12xx.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
@@ -6390,7 +6389,6 @@ 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;
 	struct resource *res;
 
 	int ret;
@@ -6446,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
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index b55dc0e..ea7e07a 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -31,7 +31,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
 #include <linux/gpio.h>
-#include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
 #include <linux/of.h>
@@ -231,67 +230,37 @@ static const struct of_device_id wlcore_sdio_of_match_table[] = {
 	{ }
 };
 
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
 	struct device_node *np = dev->of_node;
-	struct wl12xx_platform_data *pdata;
 
 	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
-		return NULL;
+		return -ENODATA;
 
-	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
-	if (!pdata)
-		return NULL;
-
-	pdata->irq = irq_of_parse_and_map(np, 0);
-	if (!pdata->irq) {
+	*irq = irq_of_parse_and_map(np, 0);
+	if (!*irq) {
 		dev_err(dev, "No irq in platform data\n");
-		kfree(pdata);
-		return NULL;
+		kfree(pdev_data);
+		return -EINVAL;
 	}
 
-	pdata->irq_trigger =
-		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
-
 	/* optional clock frequency params */
 	of_property_read_u32(np, "ref-clock-frequency",
-			     &pdata->ref_clock_freq);
+			     &pdev_data->ref_clock_freq);
 	of_property_read_u32(np, "tcxo-clock-frequency",
-			     &pdata->tcxo_clock_freq);
+			     &pdev_data->tcxo_clock_freq);
 
-	return pdata;
+	return 0;
 }
 #else
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
-	return NULL;
+	return -ENODATA;
 }
 #endif
 
-static struct wl12xx_platform_data *
-wlcore_get_platform_data(struct device *dev)
-{
-	struct wl12xx_platform_data *pdata;
-
-	/* first, look for DT data */
-	pdata = wlcore_probe_of(dev);
-	if (pdata)
-		return pdata;
-
-	/* if not found - fallback to static platform data */
-	pdata = wl12xx_get_platform_data();
-	if (!IS_ERR(pdata))
-		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
-
-	dev_err(dev, "No platform data set\n");
-	return NULL;
-}
-
-static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
-{
-	kfree(pdata);
-}
-
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -300,6 +269,7 @@ static int wl1271_probe(struct sdio_func *func,
 	struct resource res[1];
 	mmc_pm_flag_t mmcflags;
 	int ret = -ENOMEM;
+	int irq;
 	const char *chip_family;
 
 	/* We are only able to handle the wlan function */
@@ -323,8 +293,7 @@ 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;
 
-	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
-	if (!pdev_data.pdata)
+	if (wlcore_probe_of(&func->dev, &irq, &pdev_data))
 		goto out_free_glue;
 
 	/* if sdio can keep power while host is suspended, enable wow */
@@ -332,7 +301,7 @@ static int wl1271_probe(struct sdio_func *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);
 
@@ -354,15 +323,16 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_pdata;
+		goto out_free_glue;
 	}
 
 	glue->core->dev.parent = &func->dev;
 
 	memset(res, 0x00, sizeof(res));
 
-	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
+	res[0].start = irq;
+	res[0].flags = IORESOURCE_IRQ |
+		       irqd_get_trigger_type(irq_get_irq_data(irq));
 	res[0].name = "irq";
 
 	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
@@ -388,9 +358,6 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
-out_free_pdata:
-	wlcore_del_platform_data(pdev_data.pdata);
-
 out_free_glue:
 	kfree(glue);
 
@@ -401,14 +368,11 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
-	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
-	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 69601f6..f1ac283 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -331,11 +331,7 @@ static int wl1271_probe(struct spi_device *spi)
 
 	memset(&pdev_data, 0x00, sizeof(pdev_data));
 
-	pdev_data.pdata = dev_get_platdata(&spi->dev);
-	if (!pdev_data.pdata) {
-		dev_err(&spi->dev, "no platform data\n");
-		return -ENODEV;
-	}
+	/* TODO: add DT parsing when needed */
 
 	pdev_data.if_ops = &spi_ops;
 
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 3396ce5..39efc6d 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -201,8 +201,12 @@ struct wl1271_if_operations {
 };
 
 struct wlcore_platdev_data {
-	struct wl12xx_platform_data *pdata;
 	struct wl1271_if_operations *if_ops;
+
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
+	bool pwr_in_suspend;
 };
 
 #define MAX_NUM_KEYS 14
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index eea1e6d..95704cd 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -33,21 +33,8 @@ struct wl1251_platform_data {
 	bool use_eeprom;
 };
 
-struct wl12xx_platform_data {
-	int irq;
-	u32 irq_trigger;
-	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
-	u32 ref_clock_freq;	/* in Hertz */
-	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
-	bool pwr_in_suspend;
-};
-
 #ifdef CONFIG_WILINK_PLATFORM_DATA
 
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void);
-
 int wl1251_set_platform_data(const struct wl1251_platform_data *data);
 
 struct wl1251_platform_data *wl1251_get_platform_data(void);
@@ -55,18 +42,6 @@ struct wl1251_platform_data *wl1251_get_platform_data(void);
 #else
 
 static inline
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	return -ENOSYS;
-}
-
-static inline
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	return ERR_PTR(-ENODATA);
-}
-
-static inline
 int wl1251_set_platform_data(const struct wl1251_platform_data *data)
 {
 	return -ENOSYS;
-- 
1.8.5.2.229.g4448466.dirty


^ permalink raw reply related	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-18 16:38   ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-18 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Now that we have wlcore device-tree bindings in place
(for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_data struct, and move its members
into the platform device data (that is passed to wlcore)

Davinci 850 is the only platform that still set
the platform data in the legacy way (and doesn't
have DT bindings), so remove the relevant
code/Kconfig option from the board file (as suggested
by Sekhar Nori)

Since no one currently uses wlcore_spi, simply remove its
platform data support (DT bindings will have to be added
if someone actually needs it)

Signed-off-by: Luciano Coelho <luca@coelho.fi>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger from wlcore_platdev_data (they are
  being passed separately)

 arch/arm/mach-davinci/Kconfig                  |  11 ---
 arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
 drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
 drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
 drivers/net/wireless/ti/wlcore/boot.c          |   1 -
 drivers/net/wireless/ti/wlcore/main.c          |   4 +-
 drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
 drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
 drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
 include/linux/wl12xx.h                         |  25 ------
 10 files changed, 35 insertions(+), 251 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index cd30f6f..dd8f531 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -200,17 +200,6 @@ config DA850_UI_SD_VIDEO_PORT
 
 endchoice
 
-config DA850_WL12XX
-	bool "AM18x wl1271 daughter board"
-	depends on MACH_DAVINCI_DA850_EVM
-	help
-	  The wl1271 daughter card for AM18x EVMs is a combo wireless
-	  connectivity add-on card, based on the LS Research TiWi module with
-	  Texas Instruments' wl1271 solution.
-	  Say Y if you want to use a wl1271 expansion card connected to the
-	  AM18x EVM.
-
-
 config MACH_MITYOMAPL138
 	bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
 	depends on ARCH_DAVINCI_DA850
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 853b941..1ed545c 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,7 +38,6 @@
 #include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
-#include <linux/wl12xx.h>
 
 #include <mach/common.h>
 #include <mach/cp_intc.h>
@@ -60,9 +59,6 @@
 #define DA850_MMCSD_CD_PIN		GPIO_TO_PIN(4, 0)
 #define DA850_MMCSD_WP_PIN		GPIO_TO_PIN(4, 1)
 
-#define DA850_WLAN_EN			GPIO_TO_PIN(6, 9)
-#define DA850_WLAN_IRQ			GPIO_TO_PIN(6, 10)
-
 #define DA850_MII_MDIO_CLKEN_PIN	GPIO_TO_PIN(2, 6)
 
 static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
 static __init void da850_vpif_init(void) {}
 #endif
 
-#ifdef CONFIG_DA850_WL12XX
-
-static void wl12xx_set_power(int index, bool power_on)
-{
-	static bool power_state;
-
-	pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
-
-	if (power_on == power_state)
-		return;
-	power_state = power_on;
-
-	if (power_on) {
-		/* Power up sequence required for wl127x devices */
-		gpio_set_value(DA850_WLAN_EN, 1);
-		usleep_range(15000, 15000);
-		gpio_set_value(DA850_WLAN_EN, 0);
-		usleep_range(1000, 1000);
-		gpio_set_value(DA850_WLAN_EN, 1);
-		msleep(70);
-	} else {
-		gpio_set_value(DA850_WLAN_EN, 0);
-	}
-}
-
-static struct davinci_mmc_config da850_wl12xx_mmc_config = {
-	.set_power	= wl12xx_set_power,
-	.wires		= 4,
-	.max_freq	= 25000000,
-	.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
-			  MMC_CAP_POWER_OFF_CARD,
-};
-
-static const short da850_wl12xx_pins[] __initconst = {
-	DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
-	DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
-	DA850_GPIO6_9, DA850_GPIO6_10,
-	-1
-};
-
-static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
-	.irq			= -1,
-	.irq_trigger		= IRQ_TYPE_EDGE_RISING,
-	.ref_clock_freq		= 38400000,
-	.ref_clock_xtal		= false,
-};
-
-static __init int da850_wl12xx_init(void)
-{
-	int ret;
-
-	ret = davinci_cfg_reg_list(da850_wl12xx_pins);
-	if (ret) {
-		pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
-	if (ret) {
-		pr_err("wl12xx/mmc registration failed: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
-	if (ret) {
-		pr_err("Could not request wl12xx enable gpio: %d\n", ret);
-		goto exit;
-	}
-
-	ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
-	if (ret) {
-		pr_err("Could not request wl12xx irq gpio: %d\n", ret);
-		goto free_wlan_en;
-	}
-
-	da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
-
-	ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
-	if (ret) {
-		pr_err("Could not set wl12xx data: %d\n", ret);
-		goto free_wlan_irq;
-	}
-
-	return 0;
-
-free_wlan_irq:
-	gpio_free(DA850_WLAN_IRQ);
-
-free_wlan_en:
-	gpio_free(DA850_WLAN_EN);
-
-exit:
-	return ret;
-}
-
-#else /* CONFIG_DA850_WL12XX */
-
-static __init int da850_wl12xx_init(void)
-{
-	return 0;
-}
-
-#endif /* CONFIG_DA850_WL12XX */
-
 #define DA850EVM_SATA_REFCLKPN_RATE	(100 * 1000 * 1000)
 
 static __init void da850_evm_init(void)
@@ -1503,11 +1395,6 @@ static __init void da850_evm_init(void)
 		if (ret)
 			pr_warn("%s: MMCSD0 registration failed: %d\n",
 				__func__, ret);
-
-		ret = da850_wl12xx_init();
-		if (ret)
-			pr_warn("%s: WL12xx initialization failed: %d\n",
-				__func__, ret);
 	}
 
 	davinci_serial_init(da8xx_serial_device);
diff --git a/drivers/net/wireless/ti/wilink_platform_data.c b/drivers/net/wireless/ti/wilink_platform_data.c
index a92bd3e..ea0e359 100644
--- a/drivers/net/wireless/ti/wilink_platform_data.c
+++ b/drivers/net/wireless/ti/wilink_platform_data.c
@@ -23,31 +23,6 @@
 #include <linux/err.h>
 #include <linux/wl12xx.h>
 
-static struct wl12xx_platform_data *wl12xx_platform_data;
-
-int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	if (wl12xx_platform_data)
-		return -EBUSY;
-	if (!data)
-		return -EINVAL;
-
-	wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
-	if (!wl12xx_platform_data)
-		return -ENOMEM;
-
-	return 0;
-}
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	if (!wl12xx_platform_data)
-		return ERR_PTR(-ENODEV);
-
-	return wl12xx_platform_data;
-}
-EXPORT_SYMBOL(wl12xx_get_platform_data);
-
 static struct wl1251_platform_data *wl1251_platform_data;
 
 int __init wl1251_set_platform_data(const struct wl1251_platform_data *data)
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index b3f751f..af0fe2e 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -24,8 +24,6 @@
 
 #include <linux/err.h>
 
-#include <linux/wl12xx.h>
-
 #include "../wlcore/wlcore.h"
 #include "../wlcore/debug.h"
 #include "../wlcore/io.h"
@@ -1808,7 +1806,6 @@ static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
 	struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
 	BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
@@ -1834,12 +1831,12 @@ static int wl12xx_setup(struct wl1271 *wl)
 
 	if (!fref_param) {
 		priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
-						       pdata->ref_clock_freq,
-						       pdata->ref_clock_xtal);
+						pdev_data->ref_clock_freq,
+						pdev_data->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 ?
+				     pdev_data->ref_clock_freq,
+				     pdev_data->ref_clock_xtal ?
 				     "XTAL" : "not XTAL");
 
 			return priv->ref_clock;
@@ -1861,13 +1858,13 @@ static int wl12xx_setup(struct wl1271 *wl)
 			wl1271_error("Invalid fref parameter %s", fref_param);
 	}
 
-	if (!tcxo_param && pdata->tcxo_clock_freq) {
+	if (!tcxo_param && pdev_data->tcxo_clock_freq) {
 		priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
-							pdata->tcxo_clock_freq,
-							true);
+						pdev_data->tcxo_clock_freq,
+						true);
 		if (priv->tcxo_clock < 0) {
 			wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
-				     pdata->tcxo_clock_freq);
+				     pdev_data->tcxo_clock_freq);
 
 			return priv->tcxo_clock;
 		}
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 77752b0..19b7ec7 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -22,7 +22,6 @@
  */
 
 #include <linux/slab.h>
-#include <linux/wl12xx.h>
 #include <linux/export.h>
 
 #include "debug.h"
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 67518f6..0be8079 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -25,7 +25,6 @@
 #include <linux/firmware.h>
 #include <linux/etherdevice.h>
 #include <linux/vmalloc.h>
-#include <linux/wl12xx.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
@@ -6390,7 +6389,6 @@ 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;
 	struct resource *res;
 
 	int ret;
@@ -6446,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
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index b55dc0e..ea7e07a 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -31,7 +31,6 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/host.h>
 #include <linux/gpio.h>
-#include <linux/wl12xx.h>
 #include <linux/pm_runtime.h>
 #include <linux/printk.h>
 #include <linux/of.h>
@@ -231,67 +230,37 @@ static const struct of_device_id wlcore_sdio_of_match_table[] = {
 	{ }
 };
 
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
 	struct device_node *np = dev->of_node;
-	struct wl12xx_platform_data *pdata;
 
 	if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
-		return NULL;
+		return -ENODATA;
 
-	pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
-	if (!pdata)
-		return NULL;
-
-	pdata->irq = irq_of_parse_and_map(np, 0);
-	if (!pdata->irq) {
+	*irq = irq_of_parse_and_map(np, 0);
+	if (!*irq) {
 		dev_err(dev, "No irq in platform data\n");
-		kfree(pdata);
-		return NULL;
+		kfree(pdev_data);
+		return -EINVAL;
 	}
 
-	pdata->irq_trigger =
-		irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
-
 	/* optional clock frequency params */
 	of_property_read_u32(np, "ref-clock-frequency",
-			     &pdata->ref_clock_freq);
+			     &pdev_data->ref_clock_freq);
 	of_property_read_u32(np, "tcxo-clock-frequency",
-			     &pdata->tcxo_clock_freq);
+			     &pdev_data->tcxo_clock_freq);
 
-	return pdata;
+	return 0;
 }
 #else
-static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev)
+static int wlcore_probe_of(struct device *dev, int *irq,
+			   struct wlcore_platdev_data *pdev_data)
 {
-	return NULL;
+	return -ENODATA;
 }
 #endif
 
-static struct wl12xx_platform_data *
-wlcore_get_platform_data(struct device *dev)
-{
-	struct wl12xx_platform_data *pdata;
-
-	/* first, look for DT data */
-	pdata = wlcore_probe_of(dev);
-	if (pdata)
-		return pdata;
-
-	/* if not found - fallback to static platform data */
-	pdata = wl12xx_get_platform_data();
-	if (!IS_ERR(pdata))
-		return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
-
-	dev_err(dev, "No platform data set\n");
-	return NULL;
-}
-
-static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
-{
-	kfree(pdata);
-}
-
 static int wl1271_probe(struct sdio_func *func,
 				  const struct sdio_device_id *id)
 {
@@ -300,6 +269,7 @@ static int wl1271_probe(struct sdio_func *func,
 	struct resource res[1];
 	mmc_pm_flag_t mmcflags;
 	int ret = -ENOMEM;
+	int irq;
 	const char *chip_family;
 
 	/* We are only able to handle the wlan function */
@@ -323,8 +293,7 @@ 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;
 
-	pdev_data.pdata = wlcore_get_platform_data(&func->dev);
-	if (!pdev_data.pdata)
+	if (wlcore_probe_of(&func->dev, &irq, &pdev_data))
 		goto out_free_glue;
 
 	/* if sdio can keep power while host is suspended, enable wow */
@@ -332,7 +301,7 @@ static int wl1271_probe(struct sdio_func *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);
 
@@ -354,15 +323,16 @@ static int wl1271_probe(struct sdio_func *func,
 	if (!glue->core) {
 		dev_err(glue->dev, "can't allocate platform_device");
 		ret = -ENOMEM;
-		goto out_free_pdata;
+		goto out_free_glue;
 	}
 
 	glue->core->dev.parent = &func->dev;
 
 	memset(res, 0x00, sizeof(res));
 
-	res[0].start = pdev_data.pdata->irq;
-	res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger;
+	res[0].start = irq;
+	res[0].flags = IORESOURCE_IRQ |
+		       irqd_get_trigger_type(irq_get_irq_data(irq));
 	res[0].name = "irq";
 
 	ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
@@ -388,9 +358,6 @@ static int wl1271_probe(struct sdio_func *func,
 out_dev_put:
 	platform_device_put(glue->core);
 
-out_free_pdata:
-	wlcore_del_platform_data(pdev_data.pdata);
-
 out_free_glue:
 	kfree(glue);
 
@@ -401,14 +368,11 @@ out:
 static void wl1271_remove(struct sdio_func *func)
 {
 	struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
-	struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
 	/* Undo decrement done above in wl1271_probe */
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
-	wlcore_del_platform_data(pdata);
 	kfree(glue);
 }
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 69601f6..f1ac283 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -331,11 +331,7 @@ static int wl1271_probe(struct spi_device *spi)
 
 	memset(&pdev_data, 0x00, sizeof(pdev_data));
 
-	pdev_data.pdata = dev_get_platdata(&spi->dev);
-	if (!pdev_data.pdata) {
-		dev_err(&spi->dev, "no platform data\n");
-		return -ENODEV;
-	}
+	/* TODO: add DT parsing when needed */
 
 	pdev_data.if_ops = &spi_ops;
 
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 3396ce5..39efc6d 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -201,8 +201,12 @@ struct wl1271_if_operations {
 };
 
 struct wlcore_platdev_data {
-	struct wl12xx_platform_data *pdata;
 	struct wl1271_if_operations *if_ops;
+
+	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
+	u32 ref_clock_freq;	/* in Hertz */
+	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
+	bool pwr_in_suspend;
 };
 
 #define MAX_NUM_KEYS 14
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index eea1e6d..95704cd 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -33,21 +33,8 @@ struct wl1251_platform_data {
 	bool use_eeprom;
 };
 
-struct wl12xx_platform_data {
-	int irq;
-	u32 irq_trigger;
-	bool ref_clock_xtal;	/* specify whether the clock is XTAL or not */
-	u32 ref_clock_freq;	/* in Hertz */
-	u32 tcxo_clock_freq;	/* in Hertz, tcxo is always XTAL */
-	bool pwr_in_suspend;
-};
-
 #ifdef CONFIG_WILINK_PLATFORM_DATA
 
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
-
-struct wl12xx_platform_data *wl12xx_get_platform_data(void);
-
 int wl1251_set_platform_data(const struct wl1251_platform_data *data);
 
 struct wl1251_platform_data *wl1251_get_platform_data(void);
@@ -55,18 +42,6 @@ struct wl1251_platform_data *wl1251_get_platform_data(void);
 #else
 
 static inline
-int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
-{
-	return -ENOSYS;
-}
-
-static inline
-struct wl12xx_platform_data *wl12xx_get_platform_data(void)
-{
-	return ERR_PTR(-ENODATA);
-}
-
-static inline
 int wl1251_set_platform_data(const struct wl1251_platform_data *data)
 {
 	return -ENOSYS;
-- 
1.8.5.2.229.g4448466.dirty

^ permalink raw reply related	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 20:53   ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-18 20:53 UTC (permalink / raw)
  To: Eliad Peller
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

* Eliad Peller <eliad@wizery.com> [150318 09:39]:
> Add device-tree support to the wlcore (wl12xx/wl18xx)
> driver.
> 
> Update the current users to use the bindings instead
> of pdata-quirks.
> 
> Finally, remove the deprecated wl12xx_platform_data
> struct (along with the da850 board file code that
> still uses it)
> 
> v7:
> * rebase (v4.0-rc4)
> * fix wlcore_spi compilation (remove platform data)
> * additional minor changes in driver code

Thanks for updating it, looks good to me now and still works
for me.

Regards,

Tony
 
> v6:
> * Add Luca's patches to pass irq_trigger/freq
> * Support wl12xx as well
> * Update all relevant platforms
> 
> Eliad Peller (4):
>   dt: bindings: add TI's wilink wireless device
>   wlcore: add device-tree support
>   ARM: dts: add wl12xx/wl18xx bindings
>   wlcore: remove wl12xx_platform_data
> 
> Luciano Coelho (2):
>   wlcore: set irq_trigger in board files instead of hiding behind a
>     quirk
>   wl12xx: use frequency instead of enumerations for pdata clocks
> 
>  .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
>  arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
>  arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
>  arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
>  arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
>  arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
>  arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
>  arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
>  arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
>  arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
>  arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
>  arch/arm/mach-davinci/Kconfig                      |  11 --
>  arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
>  arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
>  drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
>  drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
>  drivers/net/wireless/ti/wlcore/boot.c              |   1 -
>  drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
>  drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
>  drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
>  include/linux/wl12xx.h                             |  49 ---------
>  25 files changed, 311 insertions(+), 312 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
> 
> -- 
> 1.8.5.2.229.g4448466.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 20:53   ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-18 20:53 UTC (permalink / raw)
  To: Eliad Peller
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Arnd Bergmann,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org> [150318 09:39]:
> Add device-tree support to the wlcore (wl12xx/wl18xx)
> driver.
> 
> Update the current users to use the bindings instead
> of pdata-quirks.
> 
> Finally, remove the deprecated wl12xx_platform_data
> struct (along with the da850 board file code that
> still uses it)
> 
> v7:
> * rebase (v4.0-rc4)
> * fix wlcore_spi compilation (remove platform data)
> * additional minor changes in driver code

Thanks for updating it, looks good to me now and still works
for me.

Regards,

Tony
 
> v6:
> * Add Luca's patches to pass irq_trigger/freq
> * Support wl12xx as well
> * Update all relevant platforms
> 
> Eliad Peller (4):
>   dt: bindings: add TI's wilink wireless device
>   wlcore: add device-tree support
>   ARM: dts: add wl12xx/wl18xx bindings
>   wlcore: remove wl12xx_platform_data
> 
> Luciano Coelho (2):
>   wlcore: set irq_trigger in board files instead of hiding behind a
>     quirk
>   wl12xx: use frequency instead of enumerations for pdata clocks
> 
>  .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
>  arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
>  arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
>  arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
>  arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
>  arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
>  arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
>  arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
>  arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
>  arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
>  arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
>  arch/arm/mach-davinci/Kconfig                      |  11 --
>  arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
>  arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
>  drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
>  drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
>  drivers/net/wireless/ti/wlcore/boot.c              |   1 -
>  drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
>  drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
>  drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
>  include/linux/wl12xx.h                             |  49 ---------
>  25 files changed, 311 insertions(+), 312 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
> 
> -- 
> 1.8.5.2.229.g4448466.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-18 20:53   ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-18 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

* Eliad Peller <eliad@wizery.com> [150318 09:39]:
> Add device-tree support to the wlcore (wl12xx/wl18xx)
> driver.
> 
> Update the current users to use the bindings instead
> of pdata-quirks.
> 
> Finally, remove the deprecated wl12xx_platform_data
> struct (along with the da850 board file code that
> still uses it)
> 
> v7:
> * rebase (v4.0-rc4)
> * fix wlcore_spi compilation (remove platform data)
> * additional minor changes in driver code

Thanks for updating it, looks good to me now and still works
for me.

Regards,

Tony
 
> v6:
> * Add Luca's patches to pass irq_trigger/freq
> * Support wl12xx as well
> * Update all relevant platforms
> 
> Eliad Peller (4):
>   dt: bindings: add TI's wilink wireless device
>   wlcore: add device-tree support
>   ARM: dts: add wl12xx/wl18xx bindings
>   wlcore: remove wl12xx_platform_data
> 
> Luciano Coelho (2):
>   wlcore: set irq_trigger in board files instead of hiding behind a
>     quirk
>   wl12xx: use frequency instead of enumerations for pdata clocks
> 
>  .../devicetree/bindings/net/wireless/ti,wlcore.txt |  47 +++++++++
>  arch/arm/boot/dts/am335x-evmsk.dts                 |  11 ++
>  arch/arm/boot/dts/omap3-cm-t3517.dts               |  10 ++
>  arch/arm/boot/dts/omap3-cm-t3730.dts               |  10 ++
>  arch/arm/boot/dts/omap3-evm-common.dtsi            |  10 ++
>  arch/arm/boot/dts/omap3-igep0020-rev-f.dts         |   9 ++
>  arch/arm/boot/dts/omap3-igep0030-rev-g.dts         |   9 ++
>  arch/arm/boot/dts/omap3-zoom3.dts                  |  10 ++
>  arch/arm/boot/dts/omap4-panda-common.dtsi          |  10 ++
>  arch/arm/boot/dts/omap4-sdp.dts                    |  11 ++
>  arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi     |  10 ++
>  arch/arm/mach-davinci/Kconfig                      |  11 --
>  arch/arm/mach-davinci/board-da850-evm.c            | 112 ---------------------
>  arch/arm/mach-omap2/pdata-quirks.c                 |  74 --------------
>  drivers/net/wireless/ti/wilink_platform_data.c     |  25 -----
>  drivers/net/wireless/ti/wl12xx/main.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wl12xx/wl12xx.h            |  28 ++++++
>  drivers/net/wireless/ti/wlcore/boot.c              |   1 -
>  drivers/net/wireless/ti/wlcore/debugfs.c           |   2 +-
>  drivers/net/wireless/ti/wlcore/main.c              |  31 +++---
>  drivers/net/wireless/ti/wlcore/sdio.c              |  63 ++++++++++--
>  drivers/net/wireless/ti/wlcore/spi.c               |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore.h            |   5 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h          |   6 +-
>  include/linux/wl12xx.h                             |  49 ---------
>  25 files changed, 311 insertions(+), 312 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
> 
> -- 
> 1.8.5.2.229.g4448466.dirty
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-19 14:05     ` Pontus Fuchs
  0 siblings, 0 replies; 64+ messages in thread
From: Pontus Fuchs @ 2015-03-19 14:05 UTC (permalink / raw)
  To: Eliad Peller, linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

On 2015-03-18 17:38, Eliad Peller wrote:
> Replace all the pdata-quirks for setting wl12xx/wl18xx
> platform data with proper DT definitions.
>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> ---
> v7: rebase
>
>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++

Hi Eliad,

Tested OK (boot, scan, join, ping) on Pandaboard ES.

BR,

Pontus


^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-19 14:05     ` Pontus Fuchs
  0 siblings, 0 replies; 64+ messages in thread
From: Pontus Fuchs @ 2015-03-19 14:05 UTC (permalink / raw)
  To: Eliad Peller, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

On 2015-03-18 17:38, Eliad Peller wrote:
> Replace all the pdata-quirks for setting wl12xx/wl18xx
> platform data with proper DT definitions.
>
> Signed-off-by: Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
> Acked-by: Javier Martinez Canillas <javier-0uQlZySMnqxg9hUCZPvPmw@public.gmane.org>
> Acked-by: Enric Balletbo i Serra <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Tested-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> ---
> v7: rebase
>
>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++

Hi Eliad,

Tested OK (boot, scan, join, ping) on Pandaboard ES.

BR,

Pontus

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-19 14:05     ` Pontus Fuchs
  0 siblings, 0 replies; 64+ messages in thread
From: Pontus Fuchs @ 2015-03-19 14:05 UTC (permalink / raw)
  To: linux-arm-kernel

On 2015-03-18 17:38, Eliad Peller wrote:
> Replace all the pdata-quirks for setting wl12xx/wl18xx
> platform data with proper DT definitions.
>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> Tested-by: Tony Lindgren <tony@atomide.com>
> ---
> v7: rebase
>
>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++

Hi Eliad,

Tested OK (boot, scan, join, ping) on Pandaboard ES.

BR,

Pontus

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
  2015-03-19 14:05     ` Pontus Fuchs
@ 2015-03-19 14:42       ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-19 14:42 UTC (permalink / raw)
  To: Pontus Fuchs
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

hi Pontus,

On Thu, Mar 19, 2015 at 4:05 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> On 2015-03-18 17:38, Eliad Peller wrote:
>>
>> Replace all the pdata-quirks for setting wl12xx/wl18xx
>> platform data with proper DT definitions.
>>
>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
>> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> Tested-by: Tony Lindgren <tony@atomide.com>
>> ---
>> v7: rebase
>>
>>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
>>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
>>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
>>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
>>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
>>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
>>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
>>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
>
>
> Hi Eliad,
>
> Tested OK (boot, scan, join, ping) on Pandaboard ES.
>
thanks for testing it!

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-19 14:42       ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-19 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

hi Pontus,

On Thu, Mar 19, 2015 at 4:05 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> On 2015-03-18 17:38, Eliad Peller wrote:
>>
>> Replace all the pdata-quirks for setting wl12xx/wl18xx
>> platform data with proper DT definitions.
>>
>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
>> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
>> Tested-by: Tony Lindgren <tony@atomide.com>
>> ---
>> v7: rebase
>>
>>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
>>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
>>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
>>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
>>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
>>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
>>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
>>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
>
>
> Hi Eliad,
>
> Tested OK (boot, scan, join, ping) on Pandaboard ES.
>
thanks for testing it!

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
  2015-03-19 14:42       ` Eliad Peller
@ 2015-03-19 21:25         ` Tony Lindgren
  -1 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-19 21:25 UTC (permalink / raw)
  To: Eliad Peller
  Cc: Pontus Fuchs, linux-wireless, devicetree, linux-omap,
	linux-arm-kernel, Arnd Bergmann, Rob Herring, Pawel Moll,
	Mark Rutland, Ian Campbell, Kumar Gala, Benoît Cousson,
	Enric Balletbo i Serra, Javier Martinez Canillas, Sekhar Nori,
	Kevin Hilman

* Eliad Peller <eliad@wizery.com> [150319 07:43]:
> hi Pontus,
> 
> On Thu, Mar 19, 2015 at 4:05 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> > On 2015-03-18 17:38, Eliad Peller wrote:
> >>
> >> Replace all the pdata-quirks for setting wl12xx/wl18xx
> >> platform data with proper DT definitions.
> >>
> >> Signed-off-by: Eliad Peller <eliad@wizery.com>
> >> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> >> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> Tested-by: Tony Lindgren <tony@atomide.com>
> >> ---
> >> v7: rebase
> >>
> >>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
> >>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
> >>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
> >>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
> >>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
> >>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
> >>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
> >>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
> >
> >
> > Hi Eliad,
> >
> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >
> thanks for testing it!

Great. As suggested by Kalle, I'll apply all these into
omap-for-v4.1/wl12xx branch and send a pull request for
the arm-soc probably on Friday if no issues are found.

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-19 21:25         ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-19 21:25 UTC (permalink / raw)
  To: linux-arm-kernel

* Eliad Peller <eliad@wizery.com> [150319 07:43]:
> hi Pontus,
> 
> On Thu, Mar 19, 2015 at 4:05 PM, Pontus Fuchs <pontus.fuchs@gmail.com> wrote:
> > On 2015-03-18 17:38, Eliad Peller wrote:
> >>
> >> Replace all the pdata-quirks for setting wl12xx/wl18xx
> >> platform data with proper DT definitions.
> >>
> >> Signed-off-by: Eliad Peller <eliad@wizery.com>
> >> Acked-by: Javier Martinez Canillas <javier@dowhile0.org>
> >> Acked-by: Enric Balletbo i Serra <eballetbo@gmail.com>
> >> Tested-by: Tony Lindgren <tony@atomide.com>
> >> ---
> >> v7: rebase
> >>
> >>   arch/arm/boot/dts/am335x-evmsk.dts             | 11 ++++
> >>   arch/arm/boot/dts/omap3-cm-t3517.dts           | 10 ++++
> >>   arch/arm/boot/dts/omap3-cm-t3730.dts           | 10 ++++
> >>   arch/arm/boot/dts/omap3-evm-common.dtsi        | 10 ++++
> >>   arch/arm/boot/dts/omap3-igep0020-rev-f.dts     |  9 ++++
> >>   arch/arm/boot/dts/omap3-igep0030-rev-g.dts     |  9 ++++
> >>   arch/arm/boot/dts/omap3-zoom3.dts              | 10 ++++
> >>   arch/arm/boot/dts/omap4-panda-common.dtsi      | 10 ++++
> >
> >
> > Hi Eliad,
> >
> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >
> thanks for testing it!

Great. As suggested by Kalle, I'll apply all these into
omap-for-v4.1/wl12xx branch and send a pull request for
the arm-soc probably on Friday if no issues are found.

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20  6:03           ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-20  6:03 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

Tony Lindgren <tony@atomide.com> writes:

>> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
>> >
>> thanks for testing it!
>
> Great. As suggested by Kalle, I'll apply all these into
> omap-for-v4.1/wl12xx branch and send a pull request for
> the arm-soc probably on Friday if no issues are found.

Great, thank you. Just in case you want this:

Acked-by: Kalle Valo <kvalo@codeaurora.org>

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20  6:03           ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-20  6:03 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless@vger.kernel.org,
	devicetree@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> writes:

>> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
>> >
>> thanks for testing it!
>
> Great. As suggested by Kalle, I'll apply all these into
> omap-for-v4.1/wl12xx branch and send a pull request for
> the arm-soc probably on Friday if no issues are found.

Great, thank you. Just in case you want this:

Acked-by: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20  6:03           ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-20  6:03 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

>> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
>> >
>> thanks for testing it!
>
> Great. As suggested by Kalle, I'll apply all these into
> omap-for-v4.1/wl12xx branch and send a pull request for
> the arm-soc probably on Friday if no issues are found.

Great, thank you. Just in case you want this:

Acked-by: Kalle Valo <kvalo@codeaurora.org>

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
  2015-03-20  6:03           ` Kalle Valo
@ 2015-03-20 15:33             ` Tony Lindgren
  -1 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-20 15:33 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >> >
> >> thanks for testing it!
> >
> > Great. As suggested by Kalle, I'll apply all these into
> > omap-for-v4.1/wl12xx branch and send a pull request for
> > the arm-soc probably on Friday if no issues are found.
> 
> Great, thank you. Just in case you want this:
> 
> Acked-by: Kalle Valo <kvalo@codeaurora.org>

Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
with your acks assuming you or somebody else have not
merged the existing omap-for-v4.1/wl12xx branch yet into the
wireless tree?

In that case I can scrap omap-for-v4.1/wl12xx and then will
reply with a commit that we can consider immutable that can
be merged into various trees as needed in case of merge
conflicts.

But I'll wait for your confirmation first :)

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20 15:33             ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-20 15:33 UTC (permalink / raw)
  To: linux-arm-kernel

* Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >> >
> >> thanks for testing it!
> >
> > Great. As suggested by Kalle, I'll apply all these into
> > omap-for-v4.1/wl12xx branch and send a pull request for
> > the arm-soc probably on Friday if no issues are found.
> 
> Great, thank you. Just in case you want this:
> 
> Acked-by: Kalle Valo <kvalo@codeaurora.org>

Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
with your acks assuming you or somebody else have not
merged the existing omap-for-v4.1/wl12xx branch yet into the
wireless tree?

In that case I can scrap omap-for-v4.1/wl12xx and then will
reply with a commit that we can consider immutable that can
be merged into various trees as needed in case of merge
conflicts.

But I'll wait for your confirmation first :)

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
  2015-03-20 15:33             ` Tony Lindgren
@ 2015-03-20 15:50               ` Kalle Valo
  -1 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-20 15:50 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

Tony Lindgren <tony@atomide.com> writes:

> * Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
>> Tony Lindgren <tony@atomide.com> writes:
>> 
>> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
>> >> >
>> >> thanks for testing it!
>> >
>> > Great. As suggested by Kalle, I'll apply all these into
>> > omap-for-v4.1/wl12xx branch and send a pull request for
>> > the arm-soc probably on Friday if no issues are found.
>> 
>> Great, thank you. Just in case you want this:
>> 
>> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>
> Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
> with your acks assuming you or somebody else have not
> merged the existing omap-for-v4.1/wl12xx branch yet into the
> wireless tree?
>
> In that case I can scrap omap-for-v4.1/wl12xx and then will
> reply with a commit that we can consider immutable that can
> be merged into various trees as needed in case of merge
> conflicts.
>
> But I'll wait for your confirmation first :)

After John "retired" we actually have two set of trees now: mac80211
maintained by Johannes and wireless-drivers maintained by me. I haven't
pulled anything from your tree and I'm 100% sure Johannes hasn't either.
So green light from me.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20 15:50               ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-20 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

> * Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
>> Tony Lindgren <tony@atomide.com> writes:
>> 
>> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
>> >> >
>> >> thanks for testing it!
>> >
>> > Great. As suggested by Kalle, I'll apply all these into
>> > omap-for-v4.1/wl12xx branch and send a pull request for
>> > the arm-soc probably on Friday if no issues are found.
>> 
>> Great, thank you. Just in case you want this:
>> 
>> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>
> Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
> with your acks assuming you or somebody else have not
> merged the existing omap-for-v4.1/wl12xx branch yet into the
> wireless tree?
>
> In that case I can scrap omap-for-v4.1/wl12xx and then will
> reply with a commit that we can consider immutable that can
> be merged into various trees as needed in case of merge
> conflicts.
>
> But I'll wait for your confirmation first :)

After John "retired" we actually have two set of trees now: mac80211
maintained by Johannes and wireless-drivers maintained by me. I haven't
pulled anything from your tree and I'm 100% sure Johannes hasn't either.
So green light from me.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20 16:21                 ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-20 16:21 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Kalle Valo <kvalo@codeaurora.org> [150320 08:51]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> > * Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
> >> Tony Lindgren <tony@atomide.com> writes:
> >> 
> >> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >> >> >
> >> >> thanks for testing it!
> >> >
> >> > Great. As suggested by Kalle, I'll apply all these into
> >> > omap-for-v4.1/wl12xx branch and send a pull request for
> >> > the arm-soc probably on Friday if no issues are found.
> >> 
> >> Great, thank you. Just in case you want this:
> >> 
> >> Acked-by: Kalle Valo <kvalo@codeaurora.org>
> >
> > Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
> > with your acks assuming you or somebody else have not
> > merged the existing omap-for-v4.1/wl12xx branch yet into the
> > wireless tree?
> >
> > In that case I can scrap omap-for-v4.1/wl12xx and then will
> > reply with a commit that we can consider immutable that can
> > be merged into various trees as needed in case of merge
> > conflicts.
> >
> > But I'll wait for your confirmation first :)
> 
> After John "retired" we actually have two set of trees now: mac80211
> maintained by Johannes and wireless-drivers maintained by me. I haven't
> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> So green light from me.

OK, I'll set up the new branch then. I take your ack is for the
whole series? If it's just for the $subject patch, please let
me know.

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20 16:21                 ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-20 16:21 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Pontus Fuchs,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Arnd Bergmann,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> [150320 08:51]:
> Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> writes:
> 
> > * Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> [150319 23:04]:
> >> Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> writes:
> >> 
> >> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >> >> >
> >> >> thanks for testing it!
> >> >
> >> > Great. As suggested by Kalle, I'll apply all these into
> >> > omap-for-v4.1/wl12xx branch and send a pull request for
> >> > the arm-soc probably on Friday if no issues are found.
> >> 
> >> Great, thank you. Just in case you want this:
> >> 
> >> Acked-by: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> >
> > Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
> > with your acks assuming you or somebody else have not
> > merged the existing omap-for-v4.1/wl12xx branch yet into the
> > wireless tree?
> >
> > In that case I can scrap omap-for-v4.1/wl12xx and then will
> > reply with a commit that we can consider immutable that can
> > be merged into various trees as needed in case of merge
> > conflicts.
> >
> > But I'll wait for your confirmation first :)
> 
> After John "retired" we actually have two set of trees now: mac80211
> maintained by Johannes and wireless-drivers maintained by me. I haven't
> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> So green light from me.

OK, I'll set up the new branch then. I take your ack is for the
whole series? If it's just for the $subject patch, please let
me know.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-20 16:21                 ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-20 16:21 UTC (permalink / raw)
  To: linux-arm-kernel

* Kalle Valo <kvalo@codeaurora.org> [150320 08:51]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> > * Kalle Valo <kvalo@codeaurora.org> [150319 23:04]:
> >> Tony Lindgren <tony@atomide.com> writes:
> >> 
> >> >> > Tested OK (boot, scan, join, ping) on Pandaboard ES.
> >> >> >
> >> >> thanks for testing it!
> >> >
> >> > Great. As suggested by Kalle, I'll apply all these into
> >> > omap-for-v4.1/wl12xx branch and send a pull request for
> >> > the arm-soc probably on Friday if no issues are found.
> >> 
> >> Great, thank you. Just in case you want this:
> >> 
> >> Acked-by: Kalle Valo <kvalo@codeaurora.org>
> >
> > Thanks, I can push out a new branch omap-for-v4.1/wl12xx-v2
> > with your acks assuming you or somebody else have not
> > merged the existing omap-for-v4.1/wl12xx branch yet into the
> > wireless tree?
> >
> > In that case I can scrap omap-for-v4.1/wl12xx and then will
> > reply with a commit that we can consider immutable that can
> > be merged into various trees as needed in case of merge
> > conflicts.
> >
> > But I'll wait for your confirmation first :)
> 
> After John "retired" we actually have two set of trees now: mac80211
> maintained by Johannes and wireless-drivers maintained by me. I haven't
> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> So green light from me.

OK, I'll set up the new branch then. I take your ack is for the
whole series? If it's just for the $subject patch, please let
me know.

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-23  4:51                   ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-23  4:51 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

Tony Lindgren <tony@atomide.com> writes:

>> After John "retired" we actually have two set of trees now: mac80211
>> maintained by Johannes and wireless-drivers maintained by me. I haven't
>> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
>> So green light from me.
>
> OK, I'll set up the new branch then. I take your ack is for the
> whole series? If it's just for the $subject patch, please let
> me know.

It was for the whole series.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-23  4:51                   ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-23  4:51 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless@vger.kernel.org,
	devicetree@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> writes:

>> After John "retired" we actually have two set of trees now: mac80211
>> maintained by Johannes and wireless-drivers maintained by me. I haven't
>> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
>> So green light from me.
>
> OK, I'll set up the new branch then. I take your ack is for the
> whole series? If it's just for the $subject patch, please let
> me know.

It was for the whole series.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-23  4:51                   ` Kalle Valo
  0 siblings, 0 replies; 64+ messages in thread
From: Kalle Valo @ 2015-03-23  4:51 UTC (permalink / raw)
  To: linux-arm-kernel

Tony Lindgren <tony@atomide.com> writes:

>> After John "retired" we actually have two set of trees now: mac80211
>> maintained by Johannes and wireless-drivers maintained by me. I haven't
>> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
>> So green light from me.
>
> OK, I'll set up the new branch then. I take your ack is for the
> whole series? If it's just for the $subject patch, please let
> me know.

It was for the whole series.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
  2015-03-18 16:38   ` Eliad Peller
  (?)
@ 2015-03-23  7:51     ` Sekhar Nori
  -1 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  7:51 UTC (permalink / raw)
  To: Eliad Peller, linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

+ Ido

On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
> Now that we have wlcore device-tree bindings in place
> (for both wl12xx and wl18xx), remove the legacy
> wl12xx_platform_data struct, and move its members
> into the platform device data (that is passed to wlcore)
> 
> Davinci 850 is the only platform that still set
> the platform data in the legacy way (and doesn't
> have DT bindings), so remove the relevant
> code/Kconfig option from the board file (as suggested
> by Sekhar Nori)
> 
> Since no one currently uses wlcore_spi, simply remove its
> platform data support (DT bindings will have to be added
> if someone actually needs it)
> 
> Signed-off-by: Luciano Coelho <luca@coelho.fi>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
> v7:
> * fix spi compilation (Tony)
> * remove irq/irq_trigger from wlcore_platdev_data (they are
>   being passed separately)
> 
>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>  include/linux/wl12xx.h                         |  25 ------
>  10 files changed, 35 insertions(+), 251 deletions(-)

The patch looks good to me, but it will be nice to know to which base it
applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
failed.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  7:51     ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  7:51 UTC (permalink / raw)
  To: Eliad Peller, linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

+ Ido

On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
> Now that we have wlcore device-tree bindings in place
> (for both wl12xx and wl18xx), remove the legacy
> wl12xx_platform_data struct, and move its members
> into the platform device data (that is passed to wlcore)
> 
> Davinci 850 is the only platform that still set
> the platform data in the legacy way (and doesn't
> have DT bindings), so remove the relevant
> code/Kconfig option from the board file (as suggested
> by Sekhar Nori)
> 
> Since no one currently uses wlcore_spi, simply remove its
> platform data support (DT bindings will have to be added
> if someone actually needs it)
> 
> Signed-off-by: Luciano Coelho <luca@coelho.fi>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
> v7:
> * fix spi compilation (Tony)
> * remove irq/irq_trigger from wlcore_platdev_data (they are
>   being passed separately)
> 
>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>  include/linux/wl12xx.h                         |  25 ------
>  10 files changed, 35 insertions(+), 251 deletions(-)

The patch looks good to me, but it will be nice to know to which base it
applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
failed.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  7:51     ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  7:51 UTC (permalink / raw)
  To: linux-arm-kernel

+ Ido

On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
> Now that we have wlcore device-tree bindings in place
> (for both wl12xx and wl18xx), remove the legacy
> wl12xx_platform_data struct, and move its members
> into the platform device data (that is passed to wlcore)
> 
> Davinci 850 is the only platform that still set
> the platform data in the legacy way (and doesn't
> have DT bindings), so remove the relevant
> code/Kconfig option from the board file (as suggested
> by Sekhar Nori)
> 
> Since no one currently uses wlcore_spi, simply remove its
> platform data support (DT bindings will have to be added
> if someone actually needs it)
> 
> Signed-off-by: Luciano Coelho <luca@coelho.fi>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
> v7:
> * fix spi compilation (Tony)
> * remove irq/irq_trigger from wlcore_platdev_data (they are
>   being passed separately)
> 
>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>  include/linux/wl12xx.h                         |  25 ------
>  10 files changed, 35 insertions(+), 251 deletions(-)

The patch looks good to me, but it will be nice to know to which base it
applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
failed.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:06       ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-23  8:06 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

hi Sekhar,

On Mon, Mar 23, 2015 at 9:51 AM, Sekhar Nori <nsekhar@ti.com> wrote:
> + Ido
>
> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>> Now that we have wlcore device-tree bindings in place
>> (for both wl12xx and wl18xx), remove the legacy
>> wl12xx_platform_data struct, and move its members
>> into the platform device data (that is passed to wlcore)
>>
>> Davinci 850 is the only platform that still set
>> the platform data in the legacy way (and doesn't
>> have DT bindings), so remove the relevant
>> code/Kconfig option from the board file (as suggested
>> by Sekhar Nori)
>>
>> Since no one currently uses wlcore_spi, simply remove its
>> platform data support (DT bindings will have to be added
>> if someone actually needs it)
>>
>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>> ---
>> v7:
>> * fix spi compilation (Tony)
>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>   being passed separately)
>>
>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>  include/linux/wl12xx.h                         |  25 ------
>>  10 files changed, 35 insertions(+), 251 deletions(-)
>
> The patch looks good to me, but it will be nice to know to which base it
> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
> failed.
>
The patchset was rebased on top of v4.0-rc4.
(Note that you'll have to apply the whole series, as this patch relies
on some intermediate changes done by the previous patches in the
patchset)

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:06       ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-23  8:06 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Arnd Bergmann,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Tony Lindgren, Enric Balletbo i Serra,
	Javier Martinez Canillas, Kevin Hilman, Luciano Coelho,
	Ido Yariv

hi Sekhar,

On Mon, Mar 23, 2015 at 9:51 AM, Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> wrote:
> + Ido
>
> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>> Now that we have wlcore device-tree bindings in place
>> (for both wl12xx and wl18xx), remove the legacy
>> wl12xx_platform_data struct, and move its members
>> into the platform device data (that is passed to wlcore)
>>
>> Davinci 850 is the only platform that still set
>> the platform data in the legacy way (and doesn't
>> have DT bindings), so remove the relevant
>> code/Kconfig option from the board file (as suggested
>> by Sekhar Nori)
>>
>> Since no one currently uses wlcore_spi, simply remove its
>> platform data support (DT bindings will have to be added
>> if someone actually needs it)
>>
>> Signed-off-by: Luciano Coelho <luca-XPOmlcxoEMv1KXRcyAk9cg@public.gmane.org>
>> Signed-off-by: Eliad Peller <eliad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
>> ---
>> v7:
>> * fix spi compilation (Tony)
>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>   being passed separately)
>>
>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>  include/linux/wl12xx.h                         |  25 ------
>>  10 files changed, 35 insertions(+), 251 deletions(-)
>
> The patch looks good to me, but it will be nice to know to which base it
> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
> failed.
>
The patchset was rebased on top of v4.0-rc4.
(Note that you'll have to apply the whole series, as this patch relies
on some intermediate changes done by the previous patches in the
patchset)

Eliad.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:06       ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-23  8:06 UTC (permalink / raw)
  To: linux-arm-kernel

hi Sekhar,

On Mon, Mar 23, 2015 at 9:51 AM, Sekhar Nori <nsekhar@ti.com> wrote:
> + Ido
>
> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>> Now that we have wlcore device-tree bindings in place
>> (for both wl12xx and wl18xx), remove the legacy
>> wl12xx_platform_data struct, and move its members
>> into the platform device data (that is passed to wlcore)
>>
>> Davinci 850 is the only platform that still set
>> the platform data in the legacy way (and doesn't
>> have DT bindings), so remove the relevant
>> code/Kconfig option from the board file (as suggested
>> by Sekhar Nori)
>>
>> Since no one currently uses wlcore_spi, simply remove its
>> platform data support (DT bindings will have to be added
>> if someone actually needs it)
>>
>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>> ---
>> v7:
>> * fix spi compilation (Tony)
>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>   being passed separately)
>>
>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>  include/linux/wl12xx.h                         |  25 ------
>>  10 files changed, 35 insertions(+), 251 deletions(-)
>
> The patch looks good to me, but it will be nice to know to which base it
> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
> failed.
>
The patchset was rebased on top of v4.0-rc4.
(Note that you'll have to apply the whole series, as this patch relies
on some intermediate changes done by the previous patches in the
patchset)

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
  2015-03-23  8:06       ` Eliad Peller
@ 2015-03-23  8:21         ` Sekhar Nori
  -1 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  8:21 UTC (permalink / raw)
  To: Eliad Peller
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

On Monday 23 March 2015 01:36 PM, Eliad Peller wrote:
> hi Sekhar,
> 
> On Mon, Mar 23, 2015 at 9:51 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> + Ido
>>
>> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>>> Now that we have wlcore device-tree bindings in place
>>> (for both wl12xx and wl18xx), remove the legacy
>>> wl12xx_platform_data struct, and move its members
>>> into the platform device data (that is passed to wlcore)
>>>
>>> Davinci 850 is the only platform that still set
>>> the platform data in the legacy way (and doesn't
>>> have DT bindings), so remove the relevant
>>> code/Kconfig option from the board file (as suggested
>>> by Sekhar Nori)
>>>
>>> Since no one currently uses wlcore_spi, simply remove its
>>> platform data support (DT bindings will have to be added
>>> if someone actually needs it)
>>>
>>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>>> ---
>>> v7:
>>> * fix spi compilation (Tony)
>>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>>   being passed separately)
>>>
>>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>>  include/linux/wl12xx.h                         |  25 ------
>>>  10 files changed, 35 insertions(+), 251 deletions(-)
>>
>> The patch looks good to me, but it will be nice to know to which base it
>> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
>> failed.
>>
> The patchset was rebased on top of v4.0-rc4.
> (Note that you'll have to apply the whole series, as this patch relies
> on some intermediate changes done by the previous patches in the
> patchset)

I was applying the whole series, but over v4.0-rc1 :) Its best to
mention the baseline in cover-letter itself.

The DA850 related changes in the patch look good to me.

Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar


^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:21         ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  8:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 23 March 2015 01:36 PM, Eliad Peller wrote:
> hi Sekhar,
> 
> On Mon, Mar 23, 2015 at 9:51 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>> + Ido
>>
>> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>>> Now that we have wlcore device-tree bindings in place
>>> (for both wl12xx and wl18xx), remove the legacy
>>> wl12xx_platform_data struct, and move its members
>>> into the platform device data (that is passed to wlcore)
>>>
>>> Davinci 850 is the only platform that still set
>>> the platform data in the legacy way (and doesn't
>>> have DT bindings), so remove the relevant
>>> code/Kconfig option from the board file (as suggested
>>> by Sekhar Nori)
>>>
>>> Since no one currently uses wlcore_spi, simply remove its
>>> platform data support (DT bindings will have to be added
>>> if someone actually needs it)
>>>
>>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>>> ---
>>> v7:
>>> * fix spi compilation (Tony)
>>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>>   being passed separately)
>>>
>>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>>  include/linux/wl12xx.h                         |  25 ------
>>>  10 files changed, 35 insertions(+), 251 deletions(-)
>>
>> The patch looks good to me, but it will be nice to know to which base it
>> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
>> failed.
>>
> The patchset was rebased on top of v4.0-rc4.
> (Note that you'll have to apply the whole series, as this patch relies
> on some intermediate changes done by the previous patches in the
> patchset)

I was applying the whole series, but over v4.0-rc1 :) Its best to
mention the baseline in cover-letter itself.

The DA850 related changes in the patch look good to me.

Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
  2015-03-23  8:21         ` Sekhar Nori
@ 2015-03-23  8:27           ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-23  8:27 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

On Mon, Mar 23, 2015 at 10:21 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>>> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>>>> Now that we have wlcore device-tree bindings in place
>>>> (for both wl12xx and wl18xx), remove the legacy
>>>> wl12xx_platform_data struct, and move its members
>>>> into the platform device data (that is passed to wlcore)
>>>>
>>>> Davinci 850 is the only platform that still set
>>>> the platform data in the legacy way (and doesn't
>>>> have DT bindings), so remove the relevant
>>>> code/Kconfig option from the board file (as suggested
>>>> by Sekhar Nori)
>>>>
>>>> Since no one currently uses wlcore_spi, simply remove its
>>>> platform data support (DT bindings will have to be added
>>>> if someone actually needs it)
>>>>
>>>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>>>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>>>> ---
>>>> v7:
>>>> * fix spi compilation (Tony)
>>>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>>>   being passed separately)
>>>>
>>>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>>>  include/linux/wl12xx.h                         |  25 ------
>>>>  10 files changed, 35 insertions(+), 251 deletions(-)
>>>
>>> The patch looks good to me, but it will be nice to know to which base it
>>> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
>>> failed.
>>>
>> The patchset was rebased on top of v4.0-rc4.
>> (Note that you'll have to apply the whole series, as this patch relies
>> on some intermediate changes done by the previous patches in the
>> patchset)
>
> I was applying the whole series, but over v4.0-rc1 :) Its best to
> mention the baseline in cover-letter itself.
>
check out again the cover-letter. you probably overlooked it :)

> The DA850 related changes in the patch look good to me.
>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
>
thanks,
Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:27           ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-23  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 23, 2015 at 10:21 AM, Sekhar Nori <nsekhar@ti.com> wrote:
>>> On Wednesday 18 March 2015 10:08 PM, Eliad Peller wrote:
>>>> Now that we have wlcore device-tree bindings in place
>>>> (for both wl12xx and wl18xx), remove the legacy
>>>> wl12xx_platform_data struct, and move its members
>>>> into the platform device data (that is passed to wlcore)
>>>>
>>>> Davinci 850 is the only platform that still set
>>>> the platform data in the legacy way (and doesn't
>>>> have DT bindings), so remove the relevant
>>>> code/Kconfig option from the board file (as suggested
>>>> by Sekhar Nori)
>>>>
>>>> Since no one currently uses wlcore_spi, simply remove its
>>>> platform data support (DT bindings will have to be added
>>>> if someone actually needs it)
>>>>
>>>> Signed-off-by: Luciano Coelho <luca@coelho.fi>
>>>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>>>> ---
>>>> v7:
>>>> * fix spi compilation (Tony)
>>>> * remove irq/irq_trigger from wlcore_platdev_data (they are
>>>>   being passed separately)
>>>>
>>>>  arch/arm/mach-davinci/Kconfig                  |  11 ---
>>>>  arch/arm/mach-davinci/board-da850-evm.c        | 113 -------------------------
>>>>  drivers/net/wireless/ti/wilink_platform_data.c |  25 ------
>>>>  drivers/net/wireless/ti/wl12xx/main.c          |  19 ++---
>>>>  drivers/net/wireless/ti/wlcore/boot.c          |   1 -
>>>>  drivers/net/wireless/ti/wlcore/main.c          |   4 +-
>>>>  drivers/net/wireless/ti/wlcore/sdio.c          |  76 +++++------------
>>>>  drivers/net/wireless/ti/wlcore/spi.c           |   6 +-
>>>>  drivers/net/wireless/ti/wlcore/wlcore_i.h      |   6 +-
>>>>  include/linux/wl12xx.h                         |  25 ------
>>>>  10 files changed, 35 insertions(+), 251 deletions(-)
>>>
>>> The patch looks good to me, but it will be nice to know to which base it
>>> applies cleanly. I tried applying to v4.0-rc1 and linux-next and both
>>> failed.
>>>
>> The patchset was rebased on top of v4.0-rc4.
>> (Note that you'll have to apply the whole series, as this patch relies
>> on some intermediate changes done by the previous patches in the
>> patchset)
>
> I was applying the whole series, but over v4.0-rc1 :) Its best to
> mention the baseline in cover-letter itself.
>
check out again the cover-letter. you probably overlooked it :)

> The DA850 related changes in the patch look good to me.
>
> Acked-by: Sekhar Nori <nsekhar@ti.com>
>
thanks,
Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:48             ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  8:48 UTC (permalink / raw)
  To: Eliad Peller
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Arnd Bergmann, Rob Herring, Pawel Moll, Mark Rutland,
	Ian Campbell, Kumar Gala, Benoît Cousson, Tony Lindgren,
	Enric Balletbo i Serra, Javier Martinez Canillas, Kevin Hilman,
	Luciano Coelho, Ido Yariv

On Monday 23 March 2015 01:57 PM, Eliad Peller wrote:
>> I was applying the whole series, but over v4.0-rc1 :) Its best to
>> mention the baseline in cover-letter itself.
>>
> check out again the cover-letter. you probably overlooked it :)

I see it now :)

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:48             ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  8:48 UTC (permalink / raw)
  To: Eliad Peller
  Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Arnd Bergmann,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Tony Lindgren, Enric Balletbo i Serra,
	Javier Martinez Canillas, Kevin Hilman, Luciano Coelho,
	Ido Yariv

On Monday 23 March 2015 01:57 PM, Eliad Peller wrote:
>> I was applying the whole series, but over v4.0-rc1 :) Its best to
>> mention the baseline in cover-letter itself.
>>
> check out again the cover-letter. you probably overlooked it :)

I see it now :)

Thanks,
Sekhar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 6/6] wlcore: remove wl12xx_platform_data
@ 2015-03-23  8:48             ` Sekhar Nori
  0 siblings, 0 replies; 64+ messages in thread
From: Sekhar Nori @ 2015-03-23  8:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 23 March 2015 01:57 PM, Eliad Peller wrote:
>> I was applying the whole series, but over v4.0-rc1 :) Its best to
>> mention the baseline in cover-letter itself.
>>
> check out again the cover-letter. you probably overlooked it :)

I see it now :)

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 0/6] wlcore: add device-tree support
  2015-03-18 16:38 ` Eliad Peller
@ 2015-03-24 11:37   ` Nikita Kiryanov
  -1 siblings, 0 replies; 64+ messages in thread
From: Nikita Kiryanov @ 2015-03-24 11:37 UTC (permalink / raw)
  To: Eliad Peller, linux-wireless, devicetree, linux-omap, linux-arm-kernel
  Cc: Mark Rutland, Arnd Bergmann, Pawel Moll, Ian Campbell,
	Tony Lindgren, Sekhar Nori, Enric Balletbo i Serra, Rob Herring,
	Benoît Cousson, Kumar Gala, Kevin Hilman,
	Javier Martinez Canillas

Hi Eliad,

On 03/18/2015 06:38 PM, Eliad Peller wrote:
> Add device-tree support to the wlcore (wl12xx/wl18xx)
> driver.
>
> Update the current users to use the bindings instead
> of pdata-quirks.
>
> Finally, remove the deprecated wl12xx_platform_data
> struct (along with the da850 board file code that
> still uses it)

Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
Tested on am437x-gp-evm with WL1835MODCOM8B

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-24 11:37   ` Nikita Kiryanov
  0 siblings, 0 replies; 64+ messages in thread
From: Nikita Kiryanov @ 2015-03-24 11:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eliad,

On 03/18/2015 06:38 PM, Eliad Peller wrote:
> Add device-tree support to the wlcore (wl12xx/wl18xx)
> driver.
>
> Update the current users to use the bindings instead
> of pdata-quirks.
>
> Finally, remove the deprecated wl12xx_platform_data
> struct (along with the da850 board file code that
> still uses it)

Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
Tested on am437x-gp-evm with WL1835MODCOM8B

-- 
Regards,
Nikita Kiryanov

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 0/6] wlcore: add device-tree support
  2015-03-24 11:37   ` Nikita Kiryanov
@ 2015-03-24 19:24     ` Eliad Peller
  -1 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-24 19:24 UTC (permalink / raw)
  To: Nikita Kiryanov
  Cc: linux-wireless, devicetree, linux-omap, linux-arm-kernel,
	Mark Rutland, Arnd Bergmann, Pawel Moll, Ian Campbell,
	Tony Lindgren, Sekhar Nori, Enric Balletbo i Serra, Rob Herring,
	Benoît Cousson, Kumar Gala, Kevin Hilman,
	Javier Martinez Canillas

hi Nikita,

On Tue, Mar 24, 2015 at 1:37 PM, Nikita Kiryanov <nikita@compulab.co.il> wrote:
> Hi Eliad,
>
> On 03/18/2015 06:38 PM, Eliad Peller wrote:
>>
>> Add device-tree support to the wlcore (wl12xx/wl18xx)
>> driver.
>>
>> Update the current users to use the bindings instead
>> of pdata-quirks.
>>
>> Finally, remove the deprecated wl12xx_platform_data
>> struct (along with the da850 board file code that
>> still uses it)
>
>
> Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
> Tested on am437x-gp-evm with WL1835MODCOM8B
>
thanks for testing it!

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 0/6] wlcore: add device-tree support
@ 2015-03-24 19:24     ` Eliad Peller
  0 siblings, 0 replies; 64+ messages in thread
From: Eliad Peller @ 2015-03-24 19:24 UTC (permalink / raw)
  To: linux-arm-kernel

hi Nikita,

On Tue, Mar 24, 2015 at 1:37 PM, Nikita Kiryanov <nikita@compulab.co.il> wrote:
> Hi Eliad,
>
> On 03/18/2015 06:38 PM, Eliad Peller wrote:
>>
>> Add device-tree support to the wlcore (wl12xx/wl18xx)
>> driver.
>>
>> Update the current users to use the bindings instead
>> of pdata-quirks.
>>
>> Finally, remove the deprecated wl12xx_platform_data
>> struct (along with the da850 board file code that
>> still uses it)
>
>
> Tested-by: Nikita Kiryanov <nikita@compulab.co.il>
> Tested on am437x-gp-evm with WL1835MODCOM8B
>
thanks for testing it!

Eliad.

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-25 21:42                     ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-25 21:42 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Pontus Fuchs, linux-wireless, devicetree,
	linux-omap, linux-arm-kernel, Arnd Bergmann, Rob Herring,
	Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Kalle Valo <kvalo@codeaurora.org> [150322 21:52]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> >> After John "retired" we actually have two set of trees now: mac80211
> >> maintained by Johannes and wireless-drivers maintained by me. I haven't
> >> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> >> So green light from me.
> >
> > OK, I'll set up the new branch then. I take your ack is for the
> > whole series? If it's just for the $subject patch, please let
> > me know.
> 
> It was for the whole series.

OK thanks, I've sent of the pull request for arm-soc for this series
as "[GIT PULL] wireless wl12xx and omap device tree changes for v4.1".

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

* Re: [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-25 21:42                     ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-25 21:42 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Eliad Peller, Pontus Fuchs,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Arnd Bergmann,
	Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoît Cousson, Enric Balletbo i Serra,
	Javier Martinez Canillas, Sekhar Nori, Kevin Hilman

* Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org> [150322 21:52]:
> Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> writes:
> 
> >> After John "retired" we actually have two set of trees now: mac80211
> >> maintained by Johannes and wireless-drivers maintained by me. I haven't
> >> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> >> So green light from me.
> >
> > OK, I'll set up the new branch then. I take your ack is for the
> > whole series? If it's just for the $subject patch, please let
> > me know.
> 
> It was for the whole series.

OK thanks, I've sent of the pull request for arm-soc for this series
as "[GIT PULL] wireless wl12xx and omap device tree changes for v4.1".

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 64+ messages in thread

* [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings
@ 2015-03-25 21:42                     ` Tony Lindgren
  0 siblings, 0 replies; 64+ messages in thread
From: Tony Lindgren @ 2015-03-25 21:42 UTC (permalink / raw)
  To: linux-arm-kernel

* Kalle Valo <kvalo@codeaurora.org> [150322 21:52]:
> Tony Lindgren <tony@atomide.com> writes:
> 
> >> After John "retired" we actually have two set of trees now: mac80211
> >> maintained by Johannes and wireless-drivers maintained by me. I haven't
> >> pulled anything from your tree and I'm 100% sure Johannes hasn't either.
> >> So green light from me.
> >
> > OK, I'll set up the new branch then. I take your ack is for the
> > whole series? If it's just for the $subject patch, please let
> > me know.
> 
> It was for the whole series.

OK thanks, I've sent of the pull request for arm-soc for this series
as "[GIT PULL] wireless wl12xx and omap device tree changes for v4.1".

Regards,

Tony

^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2015-03-25 21:46 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18 16:38 [PATCH v7 0/6] wlcore: add device-tree support Eliad Peller
2015-03-18 16:38 ` Eliad Peller
2015-03-18 16:38 ` Eliad Peller
2015-03-18 16:38 ` [PATCH v7 1/6] wlcore: set irq_trigger in board files instead of hiding behind a quirk Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38 ` [PATCH v7 2/6] wl12xx: use frequency instead of enumerations for pdata clocks Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38 ` [PATCH v7 3/6] dt: bindings: add TI's wilink wireless device Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38 ` [PATCH v7 4/6] wlcore: add device-tree support Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38 ` [PATCH v7 5/6] ARM: dts: add wl12xx/wl18xx bindings Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-19 14:05   ` Pontus Fuchs
2015-03-19 14:05     ` Pontus Fuchs
2015-03-19 14:05     ` Pontus Fuchs
2015-03-19 14:42     ` Eliad Peller
2015-03-19 14:42       ` Eliad Peller
2015-03-19 21:25       ` Tony Lindgren
2015-03-19 21:25         ` Tony Lindgren
2015-03-20  6:03         ` Kalle Valo
2015-03-20  6:03           ` Kalle Valo
2015-03-20  6:03           ` Kalle Valo
2015-03-20 15:33           ` Tony Lindgren
2015-03-20 15:33             ` Tony Lindgren
2015-03-20 15:50             ` Kalle Valo
2015-03-20 15:50               ` Kalle Valo
2015-03-20 16:21               ` Tony Lindgren
2015-03-20 16:21                 ` Tony Lindgren
2015-03-20 16:21                 ` Tony Lindgren
2015-03-23  4:51                 ` Kalle Valo
2015-03-23  4:51                   ` Kalle Valo
2015-03-23  4:51                   ` Kalle Valo
2015-03-25 21:42                   ` Tony Lindgren
2015-03-25 21:42                     ` Tony Lindgren
2015-03-25 21:42                     ` Tony Lindgren
2015-03-18 16:38 ` [PATCH v7 6/6] wlcore: remove wl12xx_platform_data Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-18 16:38   ` Eliad Peller
2015-03-23  7:51   ` Sekhar Nori
2015-03-23  7:51     ` Sekhar Nori
2015-03-23  7:51     ` Sekhar Nori
2015-03-23  8:06     ` Eliad Peller
2015-03-23  8:06       ` Eliad Peller
2015-03-23  8:06       ` Eliad Peller
2015-03-23  8:21       ` Sekhar Nori
2015-03-23  8:21         ` Sekhar Nori
2015-03-23  8:27         ` Eliad Peller
2015-03-23  8:27           ` Eliad Peller
2015-03-23  8:48           ` Sekhar Nori
2015-03-23  8:48             ` Sekhar Nori
2015-03-23  8:48             ` Sekhar Nori
2015-03-18 20:53 ` [PATCH v7 0/6] wlcore: add device-tree support Tony Lindgren
2015-03-18 20:53   ` Tony Lindgren
2015-03-18 20:53   ` Tony Lindgren
2015-03-24 11:37 ` Nikita Kiryanov
2015-03-24 11:37   ` Nikita Kiryanov
2015-03-24 19:24   ` Eliad Peller
2015-03-24 19:24     ` Eliad Peller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.