Commit 4d25a75b authored by John W. Linville's avatar John W. Linville
parents 3549c6b1 9c3a8d99
...@@ -309,7 +309,7 @@ static struct omap2_hsmmc_info mmc[] = { ...@@ -309,7 +309,7 @@ static struct omap2_hsmmc_info mmc[] = {
.gpio_wp = 63, .gpio_wp = 63,
.deferred = true, .deferred = true,
}, },
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
{ {
.name = "wl1271", .name = "wl1271",
.mmc = 2, .mmc = 2,
...@@ -450,7 +450,7 @@ static struct regulator_init_data omap3evm_vio = { ...@@ -450,7 +450,7 @@ static struct regulator_init_data omap3evm_vio = {
.consumer_supplies = omap3evm_vio_supply, .consumer_supplies = omap3evm_vio_supply,
}; };
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
#define OMAP3EVM_WLAN_PMENA_GPIO (150) #define OMAP3EVM_WLAN_PMENA_GPIO (150)
#define OMAP3EVM_WLAN_IRQ_GPIO (149) #define OMAP3EVM_WLAN_IRQ_GPIO (149)
...@@ -563,7 +563,7 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = { ...@@ -563,7 +563,7 @@ static struct omap_board_mux omap35x_board_mux[] __initdata = {
OMAP_PIN_OFF_NONE), OMAP_PIN_OFF_NONE),
OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
OMAP_PIN_OFF_NONE), OMAP_PIN_OFF_NONE),
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
/* WLAN IRQ - GPIO 149 */ /* WLAN IRQ - GPIO 149 */
OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
...@@ -601,7 +601,7 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = { ...@@ -601,7 +601,7 @@ static struct omap_board_mux omap36x_board_mux[] __initdata = {
OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE), OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
/* WLAN IRQ - GPIO 149 */ /* WLAN IRQ - GPIO 149 */
OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
...@@ -637,7 +637,7 @@ static struct gpio omap3_evm_ehci_gpios[] __initdata = { ...@@ -637,7 +637,7 @@ static struct gpio omap3_evm_ehci_gpios[] __initdata = {
static void __init omap3_evm_wl12xx_init(void) static void __init omap3_evm_wl12xx_init(void)
{ {
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
int ret; int ret;
/* WL12xx WLAN Init */ /* WL12xx WLAN Init */
......
...@@ -12,4 +12,13 @@ source "drivers/net/wireless/ti/wl18xx/Kconfig" ...@@ -12,4 +12,13 @@ source "drivers/net/wireless/ti/wl18xx/Kconfig"
# keep last for automatic dependencies # keep last for automatic dependencies
source "drivers/net/wireless/ti/wlcore/Kconfig" source "drivers/net/wireless/ti/wlcore/Kconfig"
config WILINK_PLATFORM_DATA
bool "TI WiLink platform data"
depends on WLCORE_SDIO || WL1251_SDIO
default y
---help---
Small platform data bit needed to pass data to the sdio modules.
endif # WL_TI endif # WL_TI
obj-$(CONFIG_WLCORE) += wlcore/ obj-$(CONFIG_WLCORE) += wlcore/
obj-$(CONFIG_WL12XX) += wl12xx/ obj-$(CONFIG_WL12XX) += wl12xx/
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wlcore/
obj-$(CONFIG_WL1251) += wl1251/ obj-$(CONFIG_WL1251) += wl1251/
obj-$(CONFIG_WL18XX) += wl18xx/ obj-$(CONFIG_WL18XX) += wl18xx/
# small builtin driver bit
obj-$(CONFIG_WILINK_PLATFORM_DATA) += wilink_platform_data.o
...@@ -1703,7 +1703,8 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = { ...@@ -1703,7 +1703,8 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
static int wl12xx_setup(struct wl1271 *wl) static int wl12xx_setup(struct wl1271 *wl)
{ {
struct wl12xx_priv *priv = wl->priv; struct wl12xx_priv *priv = wl->priv;
struct wl12xx_platform_data *pdata = wl->pdev->dev.platform_data; struct wlcore_platdev_data *pdev_data = wl->pdev->dev.platform_data;
struct wl12xx_platform_data *pdata = pdev_data->pdata;
wl->rtable = wl12xx_rtable; wl->rtable = wl12xx_rtable;
wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS; wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define __WL18XX_CONF_H__ #define __WL18XX_CONF_H__
#define WL18XX_CONF_MAGIC 0x10e100ca #define WL18XX_CONF_MAGIC 0x10e100ca
#define WL18XX_CONF_VERSION (WLCORE_CONF_VERSION | 0x0005) #define WL18XX_CONF_VERSION (WLCORE_CONF_VERSION | 0x0006)
#define WL18XX_CONF_MASK 0x0000ffff #define WL18XX_CONF_MASK 0x0000ffff
#define WL18XX_CONF_SIZE (WLCORE_CONF_SIZE + \ #define WL18XX_CONF_SIZE (WLCORE_CONF_SIZE + \
sizeof(struct wl18xx_priv_conf)) sizeof(struct wl18xx_priv_conf))
...@@ -70,8 +70,9 @@ struct wl18xx_mac_and_phy_params { ...@@ -70,8 +70,9 @@ struct wl18xx_mac_and_phy_params {
u8 pwr_limit_reference_11_abg; u8 pwr_limit_reference_11_abg;
u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P]; u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P];
u8 pwr_limit_reference_11p; u8 pwr_limit_reference_11p;
u8 spare1[9]; u8 spare1;
u8 spare2[9]; u8 per_chan_bo_mode_11_abg[13];
u8 per_chan_bo_mode_11_p[4];
u8 primary_clock_setting_time; u8 primary_clock_setting_time;
u8 clock_valid_on_wake_up; u8 clock_valid_on_wake_up;
u8 secondary_clock_setting_time; u8 secondary_clock_setting_time;
......
...@@ -547,6 +547,11 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = { ...@@ -547,6 +547,11 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
.pwr_limit_reference_11p = 0x64, .pwr_limit_reference_11p = 0x64,
.per_chan_bo_mode_11_abg = { 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00 },
.per_chan_bo_mode_11_p = { 0x00, 0x00, 0x00, 0x00 },
.per_chan_pwr_limit_arr_11p = { 0xff, 0xff, 0xff, 0xff, .per_chan_pwr_limit_arr_11p = { 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff }, 0xff, 0xff, 0xff },
.psat = 0, .psat = 0,
......
...@@ -33,8 +33,3 @@ config WLCORE_SDIO ...@@ -33,8 +33,3 @@ config WLCORE_SDIO
If you choose to build a module, it'll be called wlcore_sdio. If you choose to build a module, it'll be called wlcore_sdio.
Say N if unsure. Say N if unsure.
config WL12XX_PLATFORM_DATA
bool
depends on WLCORE_SDIO != n || WL1251_SDIO != n
default y
...@@ -9,7 +9,4 @@ obj-$(CONFIG_WLCORE) += wlcore.o ...@@ -9,7 +9,4 @@ obj-$(CONFIG_WLCORE) += wlcore.o
obj-$(CONFIG_WLCORE_SPI) += wlcore_spi.o obj-$(CONFIG_WLCORE_SPI) += wlcore_spi.o
obj-$(CONFIG_WLCORE_SDIO) += wlcore_sdio.o obj-$(CONFIG_WLCORE_SDIO) += wlcore_sdio.o
# small builtin driver bit
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o
ccflags-y += -D__CHECK_ENDIAN__ ccflags-y += -D__CHECK_ENDIAN__
...@@ -84,8 +84,8 @@ static int wlcore_boot_parse_fw_ver(struct wl1271 *wl, ...@@ -84,8 +84,8 @@ static int wlcore_boot_parse_fw_ver(struct wl1271 *wl,
static int wlcore_validate_fw_ver(struct wl1271 *wl) static int wlcore_validate_fw_ver(struct wl1271 *wl)
{ {
unsigned int *fw_ver = wl->chip.fw_ver; unsigned int *fw_ver = wl->chip.fw_ver;
unsigned int *min_ver = (wl->fw_type == WL12XX_FW_TYPE_NORMAL) ? unsigned int *min_ver = (wl->fw_type == WL12XX_FW_TYPE_MULTI) ?
wl->min_sr_fw_ver : wl->min_mr_fw_ver; wl->min_mr_fw_ver : wl->min_sr_fw_ver;
char min_fw_str[32] = ""; char min_fw_str[32] = "";
int i; int i;
......
...@@ -510,10 +510,12 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -510,10 +510,12 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
cmd->sta.hlid = wlvif->sta.hlid; cmd->sta.hlid = wlvif->sta.hlid;
cmd->sta.session = wl->session_ids[wlvif->sta.hlid]; cmd->sta.session = wl->session_ids[wlvif->sta.hlid];
/* /*
* We don't have the correct remote rates in this stage. the rates * We don't have the correct remote rates in this stage. The
* will be reconfigured later, after authorization. * rates will be reconfigured later, after association, if the
* firmware supports ACX_PEER_CAP. Otherwise, there's nothing
* we can do, so use all supported_rates here.
*/ */
cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set); cmd->sta.remote_rates = cpu_to_le32(supported_rates);
wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d "
"basic_rate_set: 0x%x, remote_rates: 0x%x", "basic_rate_set: 0x%x, remote_rates: 0x%x",
......
...@@ -2162,7 +2162,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif) ...@@ -2162,7 +2162,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
return 0; return 0;
} }
static bool wl12xx_init_fw(struct wl1271 *wl) static int wl12xx_init_fw(struct wl1271 *wl)
{ {
int retries = WL1271_BOOT_RETRIES; int retries = WL1271_BOOT_RETRIES;
bool booted = false; bool booted = false;
...@@ -2228,7 +2228,7 @@ static bool wl12xx_init_fw(struct wl1271 *wl) ...@@ -2228,7 +2228,7 @@ static bool wl12xx_init_fw(struct wl1271 *wl)
wl->state = WLCORE_STATE_ON; wl->state = WLCORE_STATE_ON;
out: out:
return booted; return ret;
} }
static bool wl12xx_dev_role_started(struct wl12xx_vif *wlvif) static bool wl12xx_dev_role_started(struct wl12xx_vif *wlvif)
...@@ -2371,7 +2371,6 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -2371,7 +2371,6 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
struct vif_counter_data vif_count; struct vif_counter_data vif_count;
int ret = 0; int ret = 0;
u8 role_type; u8 role_type;
bool booted = false;
vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
IEEE80211_VIF_SUPPORTS_CQM_RSSI; IEEE80211_VIF_SUPPORTS_CQM_RSSI;
...@@ -2432,12 +2431,10 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -2432,12 +2431,10 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
*/ */
memcpy(wl->addresses[0].addr, vif->addr, ETH_ALEN); memcpy(wl->addresses[0].addr, vif->addr, ETH_ALEN);
booted = wl12xx_init_fw(wl); ret = wl12xx_init_fw(wl);
if (!booted) { if (ret < 0)
ret = -EINVAL;
goto out; goto out;
} }
}
ret = wl12xx_cmd_role_enable(wl, vif->addr, ret = wl12xx_cmd_role_enable(wl, vif->addr,
role_type, &wlvif->role_id); role_type, &wlvif->role_id);
...@@ -5966,7 +5963,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) ...@@ -5966,7 +5963,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
{ {
struct wl1271 *wl = context; struct wl1271 *wl = context;
struct platform_device *pdev = wl->pdev; struct platform_device *pdev = wl->pdev;
struct wl12xx_platform_data *pdata = pdev->dev.platform_data; struct wlcore_platdev_data *pdev_data = pdev->dev.platform_data;
struct wl12xx_platform_data *pdata = pdev_data->pdata;
unsigned long irqflags; unsigned long irqflags;
int ret; int ret;
...@@ -5995,8 +5993,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context) ...@@ -5995,8 +5993,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
wl->irq = platform_get_irq(pdev, 0); wl->irq = platform_get_irq(pdev, 0);
wl->platform_quirks = pdata->platform_quirks; wl->platform_quirks = pdata->platform_quirks;
wl->set_power = pdata->set_power; wl->if_ops = pdev_data->if_ops;
wl->if_ops = pdata->ops;
if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
irqflags = IRQF_TRIGGER_RISING; irqflags = IRQF_TRIGGER_RISING;
......
...@@ -217,7 +217,7 @@ static struct wl1271_if_operations sdio_ops = { ...@@ -217,7 +217,7 @@ static struct wl1271_if_operations sdio_ops = {
static int wl1271_probe(struct sdio_func *func, static int wl1271_probe(struct sdio_func *func,
const struct sdio_device_id *id) const struct sdio_device_id *id)
{ {
struct wl12xx_platform_data *wlan_data; struct wlcore_platdev_data *pdev_data;
struct wl12xx_sdio_glue *glue; struct wl12xx_sdio_glue *glue;
struct resource res[1]; struct resource res[1];
mmc_pm_flag_t mmcflags; mmc_pm_flag_t mmcflags;
...@@ -228,10 +228,18 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -228,10 +228,18 @@ static int wl1271_probe(struct sdio_func *func,
if (func->num != 0x02) if (func->num != 0x02)
return -ENODEV; return -ENODEV;
pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
if (!pdev_data) {
dev_err(&func->dev, "can't allocate platdev_data\n");
goto out;
}
pdev_data->if_ops = &sdio_ops;
glue = kzalloc(sizeof(*glue), GFP_KERNEL); glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) { if (!glue) {
dev_err(&func->dev, "can't allocate glue\n"); dev_err(&func->dev, "can't allocate glue\n");
goto out; goto out_free_pdev_data;
} }
glue->dev = &func->dev; glue->dev = &func->dev;
...@@ -242,9 +250,9 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -242,9 +250,9 @@ static int wl1271_probe(struct sdio_func *func,
/* Use block mode for transferring over one block size of data */ /* Use block mode for transferring over one block size of data */
func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE; func->card->quirks |= MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
wlan_data = wl12xx_get_platform_data(); pdev_data->pdata = wl12xx_get_platform_data();
if (IS_ERR(wlan_data)) { if (IS_ERR(pdev_data->pdata)) {
ret = PTR_ERR(wlan_data); ret = PTR_ERR(pdev_data->pdata);
dev_err(glue->dev, "missing wlan platform data: %d\n", ret); dev_err(glue->dev, "missing wlan platform data: %d\n", ret);
goto out_free_glue; goto out_free_glue;
} }
...@@ -254,9 +262,7 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -254,9 +262,7 @@ static int wl1271_probe(struct sdio_func *func,
dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags); dev_dbg(glue->dev, "sdio PM caps = 0x%x\n", mmcflags);
if (mmcflags & MMC_PM_KEEP_POWER) if (mmcflags & MMC_PM_KEEP_POWER)
wlan_data->pwr_in_suspend = true; pdev_data->pdata->pwr_in_suspend = true;
wlan_data->ops = &sdio_ops;
sdio_set_drvdata(func, glue); sdio_set_drvdata(func, glue);
...@@ -274,7 +280,7 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -274,7 +280,7 @@ static int wl1271_probe(struct sdio_func *func,
else else
chip_family = "wl12xx"; chip_family = "wl12xx";
glue->core = platform_device_alloc(chip_family, -1); glue->core = platform_device_alloc(chip_family, PLATFORM_DEVID_AUTO);
if (!glue->core) { if (!glue->core) {
dev_err(glue->dev, "can't allocate platform_device"); dev_err(glue->dev, "can't allocate platform_device");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -285,7 +291,7 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -285,7 +291,7 @@ static int wl1271_probe(struct sdio_func *func,
memset(res, 0x00, sizeof(res)); memset(res, 0x00, sizeof(res));
res[0].start = wlan_data->irq; res[0].start = pdev_data->pdata->irq;
res[0].flags = IORESOURCE_IRQ; res[0].flags = IORESOURCE_IRQ;
res[0].name = "irq"; res[0].name = "irq";
...@@ -295,8 +301,8 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -295,8 +301,8 @@ static int wl1271_probe(struct sdio_func *func,
goto out_dev_put; goto out_dev_put;
} }
ret = platform_device_add_data(glue->core, wlan_data, ret = platform_device_add_data(glue->core, pdev_data,
sizeof(*wlan_data)); sizeof(*pdev_data));
if (ret) { if (ret) {
dev_err(glue->dev, "can't add platform data\n"); dev_err(glue->dev, "can't add platform data\n");
goto out_dev_put; goto out_dev_put;
...@@ -315,6 +321,9 @@ static int wl1271_probe(struct sdio_func *func, ...@@ -315,6 +321,9 @@ static int wl1271_probe(struct sdio_func *func,
out_free_glue: out_free_glue:
kfree(glue); kfree(glue);
out_free_pdev_data:
kfree(pdev_data);
out: out:
return ret; return ret;
} }
......
...@@ -327,22 +327,29 @@ static struct wl1271_if_operations spi_ops = { ...@@ -327,22 +327,29 @@ static struct wl1271_if_operations spi_ops = {
static int wl1271_probe(struct spi_device *spi) static int wl1271_probe(struct spi_device *spi)
{ {
struct wl12xx_spi_glue *glue; struct wl12xx_spi_glue *glue;
struct wl12xx_platform_data *pdata; struct wlcore_platdev_data *pdev_data;
struct resource res[1]; struct resource res[1];
int ret = -ENOMEM; int ret = -ENOMEM;
pdata = spi->dev.platform_data; pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
if (!pdata) { if (!pdev_data) {
dev_err(&spi->dev, "can't allocate platdev_data\n");
goto out;
}
pdev_data->pdata = spi->dev.platform_data;
if (!pdev_data->pdata) {
dev_err(&spi->dev, "no platform data\n"); dev_err(&spi->dev, "no platform data\n");
return -ENODEV; ret = -ENODEV;
goto out_free_pdev_data;
} }
pdata->ops = &spi_ops; pdev_data->if_ops = &spi_ops;
glue = kzalloc(sizeof(*glue), GFP_KERNEL); glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) { if (!glue) {
dev_err(&spi->dev, "can't allocate glue\n"); dev_err(&spi->dev, "can't allocate glue\n");
goto out; goto out_free_pdev_data;
} }
glue->dev = &spi->dev; glue->dev = &spi->dev;
...@@ -359,7 +366,7 @@ static int wl1271_probe(struct spi_device *spi) ...@@ -359,7 +366,7 @@ static int wl1271_probe(struct spi_device *spi)
goto out_free_glue; goto out_free_glue;
} }
glue->core = platform_device_alloc("wl12xx", -1); glue->core = platform_device_alloc("wl12xx", PLATFORM_DEVID_AUTO);
if (!glue->core) { if (!glue->core) {
dev_err(glue->dev, "can't allocate platform_device\n"); dev_err(glue->dev, "can't allocate platform_device\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -380,7 +387,8 @@ static int wl1271_probe(struct spi_device *spi) ...@@ -380,7 +387,8 @@ static int wl1271_probe(struct spi_device *spi)
goto out_dev_put; goto out_dev_put;
} }
ret = platform_device_add_data(glue->core, pdata, sizeof(*pdata)); ret = platform_device_add_data(glue->core, pdev_data,
sizeof(*pdev_data));
if (ret) { if (ret) {
dev_err(glue->dev, "can't add platform data\n"); dev_err(glue->dev, "can't add platform data\n");
goto out_dev_put; goto out_dev_put;
...@@ -399,6 +407,10 @@ static int wl1271_probe(struct spi_device *spi) ...@@ -399,6 +407,10 @@ static int wl1271_probe(struct spi_device *spi)
out_free_glue: out_free_glue:
kfree(glue); kfree(glue);
out_free_pdev_data:
kfree(pdev_data);
out: out:
return ret; return ret;
} }
......
...@@ -183,7 +183,6 @@ struct wl1271 { ...@@ -183,7 +183,6 @@ struct wl1271 {
struct wl1271_if_operations *if_ops; struct wl1271_if_operations *if_ops;
void (*set_power)(bool enable);
int irq; int irq;
spinlock_t wl_lock; spinlock_t wl_lock;
......
...@@ -206,6 +206,11 @@ struct wl1271_if_operations { ...@@ -206,6 +206,11 @@ struct wl1271_if_operations {
void (*set_block_size) (struct device *child, unsigned int blksz); void (*set_block_size) (struct device *child, unsigned int blksz);
}; };
struct wlcore_platdev_data {
struct wl12xx_platform_data *pdata;
struct wl1271_if_operations *if_ops;
};
#define MAX_NUM_KEYS 14 #define MAX_NUM_KEYS 14
#define MAX_KEY_SIZE 32 #define MAX_KEY_SIZE 32
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#ifndef _LINUX_WL12XX_H #ifndef _LINUX_WL12XX_H
#define _LINUX_WL12XX_H #define _LINUX_WL12XX_H
#include <linux/err.h>
/* Reference clock values */ /* Reference clock values */
enum { enum {
WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
...@@ -55,17 +57,17 @@ struct wl12xx_platform_data { ...@@ -55,17 +57,17 @@ struct wl12xx_platform_data {
int board_tcxo_clock; int board_tcxo_clock;
unsigned long platform_quirks; unsigned long platform_quirks;
bool pwr_in_suspend; bool pwr_in_suspend;
struct wl1271_if_operations *ops;
}; };
/* Platform does not support level trigger interrupts */ /* Platform does not support level trigger interrupts */
#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) #define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
#ifdef CONFIG_WL12XX_PLATFORM_DATA #ifdef CONFIG_WILINK_PLATFORM_DATA
int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
struct wl12xx_platform_data *wl12xx_get_platform_data(void);
#else #else
static inline static inline
...@@ -74,8 +76,12 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data) ...@@ -74,8 +76,12 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
return -ENOSYS; return -ENOSYS;
} }
#endif static inline
struct wl12xx_platform_data *wl12xx_get_platform_data(void)
{
return ERR_PTR(-ENODATA);
}
struct wl12xx_platform_data *wl12xx_get_platform_data(void); #endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment