From 620833b3a1ac621e93dc747def1e1f0bb97cb753 Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Wed, 27 Nov 2013 12:40:07 +0000 Subject: add device tree based initialization to wl12xx Signed-off-by: Imre Kaloz git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38933 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...251-platform-data-to-a-separate-structure.patch | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 package/kernel/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch (limited to 'package/kernel/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch') diff --git a/package/kernel/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch b/package/kernel/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch new file mode 100644 index 0000000000..a8af257c34 --- /dev/null +++ b/package/kernel/mac80211/patches/900-wl1251-split-wl251-platform-data-to-a-separate-structure.patch @@ -0,0 +1,109 @@ +Move the wl1251 part of the wl12xx platform data structure into a new +structure specifically for wl1251. Change the platform data built-in +block and board files accordingly. + +Cc: Tony Lindgren +Signed-off-by: Luciano Coelho +Acked-by: Tony Lindgren +Reviewed-by: Felipe Balbi + +--- a/drivers/net/wireless/ti/wilink_platform_data.c ++++ b/drivers/net/wireless/ti/wilink_platform_data.c +@@ -23,17 +23,17 @@ + #include + #include + +-static struct wl12xx_platform_data *platform_data; ++static struct wl12xx_platform_data *wl12xx_platform_data; + + int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data) + { +- if (platform_data) ++ if (wl12xx_platform_data) + return -EBUSY; + if (!data) + return -EINVAL; + +- platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); +- if (!platform_data) ++ wl12xx_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); ++ if (!wl12xx_platform_data) + return -ENOMEM; + + return 0; +@@ -41,9 +41,34 @@ int __init wl12xx_set_platform_data(cons + + struct wl12xx_platform_data *wl12xx_get_platform_data(void) + { +- if (!platform_data) ++ if (!wl12xx_platform_data) + return ERR_PTR(-ENODEV); + +- return platform_data; ++ 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) ++{ ++ if (wl1251_platform_data) ++ return -EBUSY; ++ if (!data) ++ return -EINVAL; ++ ++ wl1251_platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL); ++ if (!wl1251_platform_data) ++ return -ENOMEM; ++ ++ return 0; ++} ++ ++struct wl1251_platform_data *wl1251_get_platform_data(void) ++{ ++ if (!wl1251_platform_data) ++ return ERR_PTR(-ENODEV); ++ ++ return wl1251_platform_data; ++} ++EXPORT_SYMBOL(wl1251_get_platform_data); +--- a/drivers/net/wireless/ti/wl1251/sdio.c ++++ b/drivers/net/wireless/ti/wl1251/sdio.c +@@ -227,7 +227,7 @@ static int wl1251_sdio_probe(struct sdio + struct wl1251 *wl; + struct ieee80211_hw *hw; + struct wl1251_sdio *wl_sdio; +- const struct wl12xx_platform_data *wl12xx_board_data; ++ const struct wl1251_platform_data *wl1251_board_data; + + hw = wl1251_alloc_hw(); + if (IS_ERR(hw)) +@@ -254,11 +254,11 @@ static int wl1251_sdio_probe(struct sdio + wl->if_priv = wl_sdio; + wl->if_ops = &wl1251_sdio_ops; + +- wl12xx_board_data = wl12xx_get_platform_data(); +- if (!IS_ERR(wl12xx_board_data)) { +- wl->set_power = wl12xx_board_data->set_power; +- wl->irq = wl12xx_board_data->irq; +- wl->use_eeprom = wl12xx_board_data->use_eeprom; ++ wl1251_board_data = wl1251_get_platform_data(); ++ if (!IS_ERR(wl1251_board_data)) { ++ wl->set_power = wl1251_board_data->set_power; ++ wl->irq = wl1251_board_data->irq; ++ wl->use_eeprom = wl1251_board_data->use_eeprom; + } + + if (wl->irq) { +--- a/drivers/net/wireless/ti/wl1251/spi.c ++++ b/drivers/net/wireless/ti/wl1251/spi.c +@@ -241,7 +241,7 @@ static const struct wl1251_if_operations + + static int wl1251_spi_probe(struct spi_device *spi) + { +- struct wl12xx_platform_data *pdata; ++ struct wl1251_platform_data *pdata; + struct ieee80211_hw *hw; + struct wl1251 *wl; + int ret; -- cgit v1.2.3