wlcore: add device-tree support
Subsystems (7)
v7 cover wlcore: add device-tree support
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
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 1/6 wlcore: set irq_trigger in board files instead of hiding behind a quirk
From: Luciano Coelho <[email protected]>
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.
[Eliad - rebase, add irq_trigger field and pass it, update board file changes]
--- 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(-)
arch/arm/mach-davinci/board-da850-evm.c +1 -1
@@ -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 )
arch/arm/mach-omap2/pdata-quirks.c +1 -0
@@ -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) {
drivers/net/wireless/ti/wlcore/debugfs.c +1 -1
@@ -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);
drivers/net/wireless/ti/wlcore/main.c +16 -11
@@ -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;
drivers/net/wireless/ti/wlcore/sdio.c +1 -1
@@ -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));
drivers/net/wireless/ti/wlcore/wlcore.h +2 -3
@@ -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;
include/linux/wl12xx.h +1 -4
@@ -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);
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 2/6 wl12xx: use frequency instead of enumerations for pdata clocks
In reply to Eliad PellerFrom: Luciano Coelho <[email protected]>
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.
---
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(-)
arch/arm/mach-davinci/board-da850-evm.c +2 -1
@@ -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 )
arch/arm/mach-omap2/pdata-quirks.c +14 -15
@@ -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
drivers/net/wireless/ti/wl12xx/main.c +56 -4
78 lines not on this page · raw message
drivers/net/wireless/ti/wl12xx/wl12xx.h +28 -0
@@ -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 ];
include/linux/wl12xx.h +3 -24
@@ -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; };
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 3/6 dt: bindings: add TI's wilink wireless device
In reply to Eliad PellerAdd device tree binding documentation for TI's wilink (wl12xx and wl18xx) wlan chip.
--- .../devicetree/bindings/net/wireless/ti,wlcore.txt | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt
Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt new file +47 -0
@@ -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>; + }; +};
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 4/6 wlcore: add device-tree support
In reply to Eliad PellerWhen 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.
--- drivers/net/wireless/ti/wlcore/sdio.c | 93 ++++++++++++++++++++++++++++++++--- 1 file changed, 87 insertions(+), 6 deletions(-)
drivers/net/wireless/ti/wlcore/sdio.c +87 -6
@@ -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); }
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
In reply to Eliad PellerReplace all the pdata-quirks for setting wl12xx/wl18xx platform data with proper DT definitions.
---
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(-)
arch/arm/boot/dts/am335x-evmsk.dts +11 -0
@@ -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 {
arch/arm/boot/dts/omap3-cm-t3517.dts +10 -0
@@ -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 {
arch/arm/boot/dts/omap3-cm-t3730.dts +10 -0
@@ -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 {
arch/arm/boot/dts/omap3-evm-common.dtsi +10 -0
@@ -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 {
arch/arm/boot/dts/omap3-igep0020-rev-f.dts +9 -0
@@ -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 */ + }; };
arch/arm/boot/dts/omap3-igep0030-rev-g.dts +9 -0
@@ -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 */ + }; };
arch/arm/boot/dts/omap3-zoom3.dts +10 -0
@@ -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 {
arch/arm/boot/dts/omap4-panda-common.dtsi +10 -0
@@ -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 {
arch/arm/boot/dts/omap4-sdp.dts +11 -0
@@ -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 {
arch/arm/boot/dts/omap4-var-som-om44-wlan.dtsi +10 -0
@@ -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>; + }; };
arch/arm/mach-omap2/pdata-quirks.c +0 -74
137 lines not on this page · raw message
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 10 lines · Eliad Peller
Replace all the pdata-quirks for setting wl12xx/wl18xx platform data with proper DT definitions.
Signed-off-by Eliad Peller <[email protected]>Tested-by Tony Lindgren <[email protected]>---
v7: rebase
Quoted 8 lines
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
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
hi Pontus,
Quoted 22 lines · Pontus Fuchs
Quoted 11 lines · Eliad Peller
Replace all the pdata-quirks for setting wl12xx/wl18xx platform data with proper DT definitions.
Signed-off-by Eliad Peller <[email protected]>Tested-by Tony Lindgren <[email protected]>---
v7: rebaseQuoted 8 lines
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 ++++
Quoted 4 lines
Hi Eliad,
Tested OK (boot, scan, join, ping) on Pandaboard ES.
thanks for testing it!
Eliad.
Tony Lindgren
maintainerPATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 25 lines · Eliad Peller
hi Pontus,
Quoted 22 lines · Pontus Fuchs
Quoted 19 lines · Eliad Peller
Replace all the pdata-quirks for setting wl12xx/wl18xx platform data with proper DT definitions.
Signed-off-by Eliad Peller <[email protected]>Tested-by Tony Lindgren <[email protected]>---
v7: rebasearch/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 ++++
Quoted 5 lines
Quoted 4 lines
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
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 7 lines · Tony Lindgren
Quoted 3 lines
Quoted 2 lines
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:
Signature · 1 line
Kalle Valo
Tony Lindgren
maintainerPATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Tony Lindgren
Quoted 3 lines
Quoted 2 lines
Tested OK (boot, scan, join, ping) on Pandaboard ES.
thanks for testing it!
Quoted 7 lines
Quoted 3 lines
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 <[email protected]>
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
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 20 lines · Tony Lindgren
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Tony Lindgren
Quoted 3 lines
Quoted 2 lines
Tested OK (boot, scan, join, ping) on Pandaboard ES.
thanks for testing it!
Quoted 7 lines
Quoted 3 lines
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 <[email protected]>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?
Quoted 6 lines
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.
Signature · 1 line
Kalle Valo
Tony Lindgren
maintainerPATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 27 lines · Kalle Valo
Quoted 25 lines · Tony Lindgren
Quoted 6 lines · Kalle Valo
Quoted 4 lines · Tony Lindgren
Quoted 3 lines
Quoted 2 lines
Tested OK (boot, scan, join, ping) on Pandaboard ES.
thanks for testing it!
Quoted 7 lines
Quoted 3 lines
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 <[email protected]>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.
Quoted 6 lines
Quoted 1 line
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
PATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 8 lines · Tony Lindgren
Quoted 4 lines
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.
Signature · 1 line
Kalle Valo
Tony Lindgren
maintainerPATCH v7 5/6 ARM: dts: add wl12xx/wl18xx bindings
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Tony Lindgren
Quoted 4 lines
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.
Quoted 5 lines
Quoted 3 lines
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
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
In reply to Eliad PellerNow 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)
---
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(-)
arch/arm/mach-davinci/Kconfig +0 -11
@@ -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
arch/arm/mach-davinci/board-da850-evm.c +0 -113
137 lines not on this page · raw message
drivers/net/wireless/ti/wilink_platform_data.c +0 -25
@@ -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)
drivers/net/wireless/ti/wl12xx/main.c +8 -11
@@ -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; }
drivers/net/wireless/ti/wlcore/boot.c +0 -1
@@ -22,7 +22,6 @@*/ #include <linux/slab.h> -#include <linux/wl12xx.h> #include <linux/export.h> #include "debug.h"
drivers/net/wireless/ti/wlcore/main.c +1 -3
@@ -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
drivers/net/wireless/ti/wlcore/sdio.c +20 -56
153 lines not on this page · raw message
drivers/net/wireless/ti/wlcore/spi.c +1 -5
@@ -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;
drivers/net/wireless/ti/wlcore/wlcore_i.h +5 -1
@@ -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
include/linux/wl12xx.h +0 -25
@@ -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 ;
Signature · 1 line
1.8.5.2.229.g4448466.dirty
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
+ Ido
Quoted 23 lines · Eliad Peller
Now that we have wlcore device-tree bindings in place (for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_datastruct, 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 <[email protected]>Signed-off-by Eliad Peller <[email protected]>---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger fromwlcore_platdev_data(they are being passed separately)
Quoted 11 lines
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
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
hi Sekhar,
Quoted 38 lines · Sekhar Nori
+ Ido
Quoted 23 lines · Eliad Peller
Now that we have wlcore device-tree bindings in place (for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_datastruct, 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 <[email protected]>Signed-off-by Eliad Peller <[email protected]>---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger fromwlcore_platdev_data(they are being passed separately)Quoted 11 lines
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(-)
Quoted 4 lines
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.
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
Quoted 41 lines · Eliad Peller
hi Sekhar,
Quoted 38 lines · Sekhar Nori
+ Ido
Quoted 34 lines · Eliad Peller
Now that we have wlcore device-tree bindings in place (for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_datastruct, 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 <[email protected]>Signed-off-by Eliad Peller <[email protected]>---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger fromwlcore_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(-)
Quoted 8 lines
Quoted 4 lines
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.
Thanks,
Sekhar
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
Quoted 40 lines · Sekhar Nori
Quoted 40 lines
Quoted 40 lines · Eliad Peller
Quoted 23 lines
Now that we have wlcore device-tree bindings in place (for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_datastruct, 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 <[email protected]>Signed-off-by Eliad Peller <[email protected]>---
v7:
* fix spi compilation (Tony)
* remove irq/irq_trigger fromwlcore_platdev_data(they are being passed separately)Quoted 11 lines
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.
Quoted 8 lines
Quoted 4 lines
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 :)
Quoted 4 lines
The DA850 related changes in the patch look good to me.
Acked-by Sekhar Nori <[email protected]>
thanks,
Eliad.
PATCH v7 6/6 wlcore: remove wl12xx_platform_data
Quoted 4 lines · Eliad Peller
Quoted 3 lines
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
Tony Lindgren
maintainerv7 cover wlcore: add device-tree support
In reply to Eliad PellerQuoted 6 lines · Eliad Peller
Add device-tree support to the wlcore (wl12xx/wl18xx) driver.
Update the current users to use the bindings instead of pdata-quirks.
Quoted 8 lines
Finally, remove the deprecated
wl12xx_platform_datastruct (along with the da850 board file code that still uses it)v7:
* rebase (v4.0-rc4)
* fixwlcore_spicompilation (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
Quoted 52 lines
v6:
* Add Luca's patches to pass irq_trigger/freq
* Support wl12xx as well
* Update all relevant platformsEliad Peller (4):
dt: bindings: add TI's wilink wireless device
wlcore: add device-tree support
ARM: dts: add wl12xx/wl18xx bindings
wlcore: removewl12xx_platform_dataLuciano Coelho (2):
wlcore: setirq_triggerin 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.txtSignature · 6 lines
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
v7 cover wlcore: add device-tree support
In reply to Eliad PellerHi Eliad,
Quoted 9 lines · Eliad Peller
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_datastruct (along with the da850 board file code that still uses it)
Tested on am437x-gp-evm with WL1835MODCOM8B
Signature · 2 lines
Regards, Nikita Kiryanov
v7 cover wlcore: add device-tree support
hi Nikita,
Quoted 10 lines · Nikita Kiryanov
Hi Eliad,
Quoted 7 lines · Eliad Peller
Add device-tree support to the wlcore (wl12xx/wl18xx) driver.
Update the current users to use the bindings instead of pdata-quirks.
Quoted 8 lines
Quoted 3 lines
Finally, remove the deprecated
wl12xx_platform_datastruct (along with the da850 board file code that still uses it)Tested-by Nikita Kiryanov <[email protected]>Tested on am437x-gp-evm with WL1835MODCOM8B
thanks for testing it!
Eliad.