aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-03-18 12:38:30 -0400
committerTony Lindgren <tony@atomide.com>2015-03-24 12:48:14 -0400
commit83c3a7d4ac7fdc29a64bf9a5467a36b4c72a1eed (patch)
tree2cceed6622d8ec6e33403613cfbcfc701fcbc98f
parent99f84cae43df242f0d69ffcfee3a4d69f9b71b44 (diff)
wlcore: remove wl12xx_platform_data
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> Tested-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-davinci/Kconfig11
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c113
-rw-r--r--drivers/net/wireless/ti/wilink_platform_data.c25
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c19
-rw-r--r--drivers/net/wireless/ti/wlcore/boot.c1
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c4
-rw-r--r--drivers/net/wireless/ti/wlcore/sdio.c76
-rw-r--r--drivers/net/wireless/ti/wlcore/spi.c6
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h6
-rw-r--r--include/linux/wl12xx.h25
10 files changed, 35 insertions, 251 deletions
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index cd30f6f5f2ff..dd8f5312b2c0 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -200,17 +200,6 @@ config DA850_UI_SD_VIDEO_PORT
200 200
201endchoice 201endchoice
202 202
203config DA850_WL12XX
204 bool "AM18x wl1271 daughter board"
205 depends on MACH_DAVINCI_DA850_EVM
206 help
207 The wl1271 daughter card for AM18x EVMs is a combo wireless
208 connectivity add-on card, based on the LS Research TiWi module with
209 Texas Instruments' wl1271 solution.
210 Say Y if you want to use a wl1271 expansion card connected to the
211 AM18x EVM.
212
213
214config MACH_MITYOMAPL138 203config MACH_MITYOMAPL138
215 bool "Critical Link MityDSP-L138/MityARM-1808 SoM" 204 bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
216 depends on ARCH_DAVINCI_DA850 205 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 853b941b710e..1ed545cc2b83 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,7 +38,6 @@
38#include <linux/regulator/fixed.h> 38#include <linux/regulator/fixed.h>
39#include <linux/spi/spi.h> 39#include <linux/spi/spi.h>
40#include <linux/spi/flash.h> 40#include <linux/spi/flash.h>
41#include <linux/wl12xx.h>
42 41
43#include <mach/common.h> 42#include <mach/common.h>
44#include <mach/cp_intc.h> 43#include <mach/cp_intc.h>
@@ -60,9 +59,6 @@
60#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) 59#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
61#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) 60#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
62 61
63#define DA850_WLAN_EN GPIO_TO_PIN(6, 9)
64#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10)
65
66#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) 62#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
67 63
68static struct mtd_partition da850evm_spiflash_part[] = { 64static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
1343static __init void da850_vpif_init(void) {} 1339static __init void da850_vpif_init(void) {}
1344#endif 1340#endif
1345 1341
1346#ifdef CONFIG_DA850_WL12XX
1347
1348static void wl12xx_set_power(int index, bool power_on)
1349{
1350 static bool power_state;
1351
1352 pr_debug("Powering %s wl12xx", power_on ? "on" : "off");
1353
1354 if (power_on == power_state)
1355 return;
1356 power_state = power_on;
1357
1358 if (power_on) {
1359 /* Power up sequence required for wl127x devices */
1360 gpio_set_value(DA850_WLAN_EN, 1);
1361 usleep_range(15000, 15000);
1362 gpio_set_value(DA850_WLAN_EN, 0);
1363 usleep_range(1000, 1000);
1364 gpio_set_value(DA850_WLAN_EN, 1);
1365 msleep(70);
1366 } else {
1367 gpio_set_value(DA850_WLAN_EN, 0);
1368 }
1369}
1370
1371static struct davinci_mmc_config da850_wl12xx_mmc_config = {
1372 .set_power = wl12xx_set_power,
1373 .wires = 4,
1374 .max_freq = 25000000,
1375 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
1376 MMC_CAP_POWER_OFF_CARD,
1377};
1378
1379static const short da850_wl12xx_pins[] __initconst = {
1380 DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
1381 DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
1382 DA850_GPIO6_9, DA850_GPIO6_10,
1383 -1
1384};
1385
1386static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
1387 .irq = -1,
1388 .irq_trigger = IRQ_TYPE_EDGE_RISING,
1389 .ref_clock_freq = 38400000,
1390 .ref_clock_xtal = false,
1391};
1392
1393static __init int da850_wl12xx_init(void)
1394{
1395 int ret;
1396
1397 ret = davinci_cfg_reg_list(da850_wl12xx_pins);
1398 if (ret) {
1399 pr_err("wl12xx/mmc mux setup failed: %d\n", ret);
1400 goto exit;
1401 }
1402
1403 ret = da850_register_mmcsd1(&da850_wl12xx_mmc_config);
1404 if (ret) {
1405 pr_err("wl12xx/mmc registration failed: %d\n", ret);
1406 goto exit;
1407 }
1408
1409 ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, "wl12xx_en");
1410 if (ret) {
1411 pr_err("Could not request wl12xx enable gpio: %d\n", ret);
1412 goto exit;
1413 }
1414
1415 ret = gpio_request_one(DA850_WLAN_IRQ, GPIOF_IN, "wl12xx_irq");
1416 if (ret) {
1417 pr_err("Could not request wl12xx irq gpio: %d\n", ret);
1418 goto free_wlan_en;
1419 }
1420
1421 da850_wl12xx_wlan_data.irq = gpio_to_irq(DA850_WLAN_IRQ);
1422
1423 ret = wl12xx_set_platform_data(&da850_wl12xx_wlan_data);
1424 if (ret) {
1425 pr_err("Could not set wl12xx data: %d\n", ret);
1426 goto free_wlan_irq;
1427 }
1428
1429 return 0;
1430
1431free_wlan_irq:
1432 gpio_free(DA850_WLAN_IRQ);
1433
1434free_wlan_en:
1435 gpio_free(DA850_WLAN_EN);
1436
1437exit:
1438 return ret;
1439}
1440
1441#else /* CONFIG_DA850_WL12XX */
1442
1443static __init int da850_wl12xx_init(void)
1444{
1445 return 0;
1446}
1447
1448#endif /* CONFIG_DA850_WL12XX */
1449
1450#define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000) 1342#define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000)
1451 1343
1452static __init void da850_evm_init(void) 1344static __init void da850_evm_init(void)
@@ -1503,11 +1395,6 @@ static __init void da850_evm_init(void)
1503 if (ret) 1395 if (ret)
1504 pr_warn("%s: MMCSD0 registration failed: %d\n", 1396 pr_warn("%s: MMCSD0 registration failed: %d\n",
1505 __func__, ret); 1397 __func__, ret);
1506
1507 ret = da850_wl12xx_init();
1508 if (ret)
1509 pr_warn("%s: WL12xx initialization failed: %d\n",
1510 __func__, ret);
1511 } 1398 }
1512 1399
1513 davinci_serial_init(da8xx_serial_device); 1400 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 a92bd3e89796..ea0e359bdb43 100644
--- a/drivers/net/wireless/ti/wilink_platform_data.c
+++ b/drivers/net/wireless/ti/wilink_platform_data.c
@@ -23,31 +23,6 @@
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/wl12xx.h> 24#include <linux/wl12xx.h>
25 25
26static struct wl12xx_platform_data *wl12xx_platform_data;
27
28int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
29{
30 if (wl12xx_platform_data)
31 return -EBUSY;
32 if (!data)
33 return -EINVAL;
34
35 wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
36 if (!wl12xx_platform_data)
37 return -ENOMEM;
38
39 return 0;
40}
41
42struct wl12xx_platform_data *wl12xx_get_platform_data(void)
43{
44 if (!wl12xx_platform_data)
45 return ERR_PTR(-ENODEV);
46
47 return wl12xx_platform_data;
48}
49EXPORT_SYMBOL(wl12xx_get_platform_data);
50
51static struct wl1251_platform_data *wl1251_platform_data; 26static struct wl1251_platform_data *wl1251_platform_data;
52 27
53int __init wl1251_set_platform_data(const struct wl1251_platform_data *data) 28int __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 b3f751f1e08f..af0fe2e17151 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -24,8 +24,6 @@
24 24
25#include <linux/err.h> 25#include <linux/err.h>
26 26
27#include <linux/wl12xx.h>
28
29#include "../wlcore/wlcore.h" 27#include "../wlcore/wlcore.h"
30#include "../wlcore/debug.h" 28#include "../wlcore/debug.h"
31#include "../wlcore/io.h" 29#include "../wlcore/io.h"
@@ -1808,7 +1806,6 @@ static int wl12xx_setup(struct wl1271 *wl)
1808{ 1806{
1809 struct wl12xx_priv *priv = wl->priv; 1807 struct wl12xx_priv *priv = wl->priv;
1810 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev); 1808 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
1811 struct wl12xx_platform_data *pdata = pdev_data->pdata;
1812 1809
1813 BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS); 1810 BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
1814 BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS); 1811 BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
@@ -1834,12 +1831,12 @@ static int wl12xx_setup(struct wl1271 *wl)
1834 1831
1835 if (!fref_param) { 1832 if (!fref_param) {
1836 priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table, 1833 priv->ref_clock = wl12xx_get_clock_idx(wl12xx_refclock_table,
1837 pdata->ref_clock_freq, 1834 pdev_data->ref_clock_freq,
1838 pdata->ref_clock_xtal); 1835 pdev_data->ref_clock_xtal);
1839 if (priv->ref_clock < 0) { 1836 if (priv->ref_clock < 0) {
1840 wl1271_error("Invalid ref_clock frequency (%d Hz, %s)", 1837 wl1271_error("Invalid ref_clock frequency (%d Hz, %s)",
1841 pdata->ref_clock_freq, 1838 pdev_data->ref_clock_freq,
1842 pdata->ref_clock_xtal ? 1839 pdev_data->ref_clock_xtal ?
1843 "XTAL" : "not XTAL"); 1840 "XTAL" : "not XTAL");
1844 1841
1845 return priv->ref_clock; 1842 return priv->ref_clock;
@@ -1861,13 +1858,13 @@ static int wl12xx_setup(struct wl1271 *wl)
1861 wl1271_error("Invalid fref parameter %s", fref_param); 1858 wl1271_error("Invalid fref parameter %s", fref_param);
1862 } 1859 }
1863 1860
1864 if (!tcxo_param && pdata->tcxo_clock_freq) { 1861 if (!tcxo_param && pdev_data->tcxo_clock_freq) {
1865 priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table, 1862 priv->tcxo_clock = wl12xx_get_clock_idx(wl12xx_tcxoclock_table,
1866 pdata->tcxo_clock_freq, 1863 pdev_data->tcxo_clock_freq,
1867 true); 1864 true);
1868 if (priv->tcxo_clock < 0) { 1865 if (priv->tcxo_clock < 0) {
1869 wl1271_error("Invalid tcxo_clock frequency (%d Hz)", 1866 wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
1870 pdata->tcxo_clock_freq); 1867 pdev_data->tcxo_clock_freq);
1871 1868
1872 return priv->tcxo_clock; 1869 return priv->tcxo_clock;
1873 } 1870 }
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 77752b03f189..19b7ec7b69c2 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -22,7 +22,6 @@
22 */ 22 */
23 23
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/wl12xx.h>
26#include <linux/export.h> 25#include <linux/export.h>
27 26
28#include "debug.h" 27#include "debug.h"
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 67518f692cfc..0be807951afe 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -25,7 +25,6 @@
25#include <linux/firmware.h> 25#include <linux/firmware.h>
26#include <linux/etherdevice.h> 26#include <linux/etherdevice.h>
27#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
28#include <linux/wl12xx.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
30#include <linux/irq.h> 29#include <linux/irq.h>
31 30
@@ -6390,7 +6389,6 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6390 struct wl1271 *wl = context; 6389 struct wl1271 *wl = context;
6391 struct platform_device *pdev = wl->pdev; 6390 struct platform_device *pdev = wl->pdev;
6392 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev); 6391 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&pdev->dev);
6393 struct wl12xx_platform_data *pdata = pdev_data->pdata;
6394 struct resource *res; 6392 struct resource *res;
6395 6393
6396 int ret; 6394 int ret;
@@ -6446,7 +6444,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
6446 if (!ret) { 6444 if (!ret) {
6447 wl->irq_wake_enabled = true; 6445 wl->irq_wake_enabled = true;
6448 device_init_wakeup(wl->dev, 1); 6446 device_init_wakeup(wl->dev, 1);
6449 if (pdata->pwr_in_suspend) 6447 if (pdev_data->pwr_in_suspend)
6450 wl->hw->wiphy->wowlan = &wlcore_wowlan_support; 6448 wl->hw->wiphy->wowlan = &wlcore_wowlan_support;
6451 } 6449 }
6452#endif 6450#endif
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index b55dc0ede513..ea7e07abca4e 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -31,7 +31,6 @@
31#include <linux/mmc/card.h> 31#include <linux/mmc/card.h>
32#include <linux/mmc/host.h> 32#include <linux/mmc/host.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/wl12xx.h>
35#include <linux/pm_runtime.h> 34#include <linux/pm_runtime.h>
36#include <linux/printk.h> 35#include <linux/printk.h>
37#include <linux/of.h> 36#include <linux/of.h>
@@ -231,67 +230,37 @@ static const struct of_device_id wlcore_sdio_of_match_table[] = {
231 { } 230 { }
232}; 231};
233 232
234static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev) 233static int wlcore_probe_of(struct device *dev, int *irq,
234 struct wlcore_platdev_data *pdev_data)
235{ 235{
236 struct device_node *np = dev->of_node; 236 struct device_node *np = dev->of_node;
237 struct wl12xx_platform_data *pdata;
238 237
239 if (!np || !of_match_node(wlcore_sdio_of_match_table, np)) 238 if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
240 return NULL; 239 return -ENODATA;
241 240
242 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); 241 *irq = irq_of_parse_and_map(np, 0);
243 if (!pdata) 242 if (!*irq) {
244 return NULL;
245
246 pdata->irq = irq_of_parse_and_map(np, 0);
247 if (!pdata->irq) {
248 dev_err(dev, "No irq in platform data\n"); 243 dev_err(dev, "No irq in platform data\n");
249 kfree(pdata); 244 kfree(pdev_data);
250 return NULL; 245 return -EINVAL;
251 } 246 }
252 247
253 pdata->irq_trigger =
254 irqd_get_trigger_type(irq_get_irq_data(pdata->irq));
255
256 /* optional clock frequency params */ 248 /* optional clock frequency params */
257 of_property_read_u32(np, "ref-clock-frequency", 249 of_property_read_u32(np, "ref-clock-frequency",
258 &pdata->ref_clock_freq); 250 &pdev_data->ref_clock_freq);
259 of_property_read_u32(np, "tcxo-clock-frequency", 251 of_property_read_u32(np, "tcxo-clock-frequency",
260 &pdata->tcxo_clock_freq); 252 &pdev_data->tcxo_clock_freq);
261 253
262 return pdata; 254 return 0;
263} 255}
264#else 256#else
265static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev) 257static int wlcore_probe_of(struct device *dev, int *irq,
258 struct wlcore_platdev_data *pdev_data)
266{ 259{
267 return NULL; 260 return -ENODATA;
268} 261}
269#endif 262#endif
270 263
271static struct wl12xx_platform_data *
272wlcore_get_platform_data(struct device *dev)
273{
274 struct wl12xx_platform_data *pdata;
275
276 /* first, look for DT data */
277 pdata = wlcore_probe_of(dev);
278 if (pdata)
279 return pdata;
280
281 /* if not found - fallback to static platform data */
282 pdata = wl12xx_get_platform_data();
283 if (!IS_ERR(pdata))
284 return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL);
285
286 dev_err(dev, "No platform data set\n");
287 return NULL;
288}
289
290static void wlcore_del_platform_data(struct wl12xx_platform_data *pdata)
291{
292 kfree(pdata);
293}
294
295static int wl1271_probe(struct sdio_func *func, 264static int wl1271_probe(struct sdio_func *func,
296 const struct sdio_device_id *id) 265 const struct sdio_device_id *id)
297{ 266{
@@ -300,6 +269,7 @@ static int wl1271_probe(struct sdio_func *func,
300 struct resource res[1]; 269 struct resource res[1];
301 mmc_pm_flag_t mmcflags; 270 mmc_pm_flag_t mmcflags;
302 int ret = -ENOMEM; 271 int ret = -ENOMEM;
272 int irq;
303 const char *chip_family; 273 const char *chip_family;
304 274
305 /* We are only able to handle the wlan function */ 275 /* We are only able to handle the wlan function */
@@ -323,8 +293,7 @@ static int wl1271_probe(struct sdio_func *func,
323 /* Use block mode for transferring over one block size of data */ 293 /* Use block mode for transferring over one block size of data */
324 func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; 294 func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
325 295
326 pdev_data.pdata = wlcore_get_platform_data(&func->dev); 296 if (wlcore_probe_of(&func->dev, &irq, &pdev_data))
327 if (!pdev_data.pdata)
328 goto out_free_glue; 297 goto out_free_glue;
329 298
330 /* if sdio can keep power while host is suspended, enable wow */ 299 /* if sdio can keep power while host is suspended, enable wow */
@@ -332,7 +301,7 @@ static int wl1271_probe(struct sdio_func *func,
332 dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags); 301 dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
333 302
334 if (mmcflags & MMC_PM_KEEP_POWER) 303 if (mmcflags & MMC_PM_KEEP_POWER)
335 pdev_data.pdata->pwr_in_suspend = true; 304 pdev_data.pwr_in_suspend = true;
336 305
337 sdio_set_drvdata(func, glue); 306 sdio_set_drvdata(func, glue);
338 307
@@ -354,15 +323,16 @@ static int wl1271_probe(struct sdio_func *func,
354 if (!glue->core) { 323 if (!glue->core) {
355 dev_err(glue->dev, "can't allocate platform_device"); 324 dev_err(glue->dev, "can't allocate platform_device");
356 ret = -ENOMEM; 325 ret = -ENOMEM;
357 goto out_free_pdata; 326 goto out_free_glue;
358 } 327 }
359 328
360 glue->core->dev.parent = &func->dev; 329 glue->core->dev.parent = &func->dev;
361 330
362 memset(res, 0x00, sizeof(res)); 331 memset(res, 0x00, sizeof(res));
363 332
364 res[0].start = pdev_data.pdata->irq; 333 res[0].start = irq;
365 res[0].flags = IORESOURCE_IRQ | pdev_data.pdata->irq_trigger; 334 res[0].flags = IORESOURCE_IRQ |
335 irqd_get_trigger_type(irq_get_irq_data(irq));
366 res[0].name = "irq"; 336 res[0].name = "irq";
367 337
368 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res)); 338 ret = platform_device_add_resources(glue->core, res, ARRAY_SIZE(res));
@@ -388,9 +358,6 @@ static int wl1271_probe(struct sdio_func *func,
388out_dev_put: 358out_dev_put:
389 platform_device_put(glue->core); 359 platform_device_put(glue->core);
390 360
391out_free_pdata:
392 wlcore_del_platform_data(pdev_data.pdata);
393
394out_free_glue: 361out_free_glue:
395 kfree(glue); 362 kfree(glue);
396 363
@@ -401,14 +368,11 @@ out:
401static void wl1271_remove(struct sdio_func *func) 368static void wl1271_remove(struct sdio_func *func)
402{ 369{
403 struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func); 370 struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
404 struct wlcore_platdev_data *pdev_data = glue->core->dev.platform_data;
405 struct wl12xx_platform_data *pdata = pdev_data->pdata;
406 371
407 /* Undo decrement done above in wl1271_probe */ 372 /* Undo decrement done above in wl1271_probe */
408 pm_runtime_get_noresume(&func->dev); 373 pm_runtime_get_noresume(&func->dev);
409 374
410 platform_device_unregister(glue->core); 375 platform_device_unregister(glue->core);
411 wlcore_del_platform_data(pdata);
412 kfree(glue); 376 kfree(glue);
413} 377}
414 378
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 69601f6741d9..f1ac2839d97c 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)
331 331
332 memset(&pdev_data, 0x00, sizeof(pdev_data)); 332 memset(&pdev_data, 0x00, sizeof(pdev_data));
333 333
334 pdev_data.pdata = dev_get_platdata(&spi->dev); 334 /* TODO: add DT parsing when needed */
335 if (!pdev_data.pdata) {
336 dev_err(&spi->dev, "no platform data\n");
337 return -ENODEV;
338 }
339 335
340 pdev_data.if_ops = &spi_ops; 336 pdev_data.if_ops = &spi_ops;
341 337
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 3396ce5a934d..39efc6d78b10 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 {
201}; 201};
202 202
203struct wlcore_platdev_data { 203struct wlcore_platdev_data {
204 struct wl12xx_platform_data *pdata;
205 struct wl1271_if_operations *if_ops; 204 struct wl1271_if_operations *if_ops;
205
206 bool ref_clock_xtal; /* specify whether the clock is XTAL or not */
207 u32 ref_clock_freq; /* in Hertz */
208 u32 tcxo_clock_freq; /* in Hertz, tcxo is always XTAL */
209 bool pwr_in_suspend;
206}; 210};
207 211
208#define MAX_NUM_KEYS 14 212#define MAX_NUM_KEYS 14
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index eea1e6dac4be..95704cd4cfab 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -33,21 +33,8 @@ struct wl1251_platform_data {
33 bool use_eeprom; 33 bool use_eeprom;
34}; 34};
35 35
36struct wl12xx_platform_data {
37 int irq;
38 u32 irq_trigger;
39 bool ref_clock_xtal; /* specify whether the clock is XTAL or not */
40 u32 ref_clock_freq; /* in Hertz */
41 u32 tcxo_clock_freq; /* in Hertz, tcxo is always XTAL */
42 bool pwr_in_suspend;
43};
44
45#ifdef CONFIG_WILINK_PLATFORM_DATA 36#ifdef CONFIG_WILINK_PLATFORM_DATA
46 37
47int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
48
49struct wl12xx_platform_data *wl12xx_get_platform_data(void);
50
51int wl1251_set_platform_data(const struct wl1251_platform_data *data); 38int wl1251_set_platform_data(const struct wl1251_platform_data *data);
52 39
53struct wl1251_platform_data *wl1251_get_platform_data(void); 40struct wl1251_platform_data *wl1251_get_platform_data(void);
@@ -55,18 +42,6 @@ struct wl1251_platform_data *wl1251_get_platform_data(void);
55#else 42#else
56 43
57static inline 44static inline
58int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
59{
60 return -ENOSYS;
61}
62
63static inline
64struct wl12xx_platform_data *wl12xx_get_platform_data(void)
65{
66 return ERR_PTR(-ENODATA);
67}
68
69static inline
70int wl1251_set_platform_data(const struct wl1251_platform_data *data) 45int wl1251_set_platform_data(const struct wl1251_platform_data *data)
71{ 46{
72 return -ENOSYS; 47 return -ENOSYS;