wlcore: sdio: Populate config firmware data
Configure the config firmware names and make it available in platform data. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
a762bb8ecb
commit
d776fc86b8
@ -216,17 +216,33 @@ static struct wl1271_if_operations sdio_ops = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
|
|
||||||
|
static const struct wilink_family_data wl127x_data = {
|
||||||
|
.name = "wl127x",
|
||||||
|
.nvs_name = "ti-connectivity/wl127x-nvs.bin",
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct wilink_family_data wl128x_data = {
|
||||||
|
.name = "wl128x",
|
||||||
|
.nvs_name = "ti-connectivity/wl128x-nvs.bin",
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct wilink_family_data wl18xx_data = {
|
||||||
|
.name = "wl18xx",
|
||||||
|
.cfg_name = "ti-connectivity/wl18xx-conf.bin",
|
||||||
|
};
|
||||||
|
|
||||||
static const struct of_device_id wlcore_sdio_of_match_table[] = {
|
static const struct of_device_id wlcore_sdio_of_match_table[] = {
|
||||||
{ .compatible = "ti,wl1271" },
|
{ .compatible = "ti,wl1271", .data = &wl127x_data },
|
||||||
{ .compatible = "ti,wl1273" },
|
{ .compatible = "ti,wl1273", .data = &wl127x_data },
|
||||||
{ .compatible = "ti,wl1281" },
|
{ .compatible = "ti,wl1281", .data = &wl128x_data },
|
||||||
{ .compatible = "ti,wl1283" },
|
{ .compatible = "ti,wl1283", .data = &wl128x_data },
|
||||||
{ .compatible = "ti,wl1801" },
|
{ .compatible = "ti,wl1801", .data = &wl18xx_data },
|
||||||
{ .compatible = "ti,wl1805" },
|
{ .compatible = "ti,wl1805", .data = &wl18xx_data },
|
||||||
{ .compatible = "ti,wl1807" },
|
{ .compatible = "ti,wl1807", .data = &wl18xx_data },
|
||||||
{ .compatible = "ti,wl1831" },
|
{ .compatible = "ti,wl1831", .data = &wl18xx_data },
|
||||||
{ .compatible = "ti,wl1835" },
|
{ .compatible = "ti,wl1835", .data = &wl18xx_data },
|
||||||
{ .compatible = "ti,wl1837" },
|
{ .compatible = "ti,wl1837", .data = &wl18xx_data },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -234,9 +250,13 @@ static int wlcore_probe_of(struct device *dev, int *irq,
|
|||||||
struct wlcore_platdev_data *pdev_data)
|
struct wlcore_platdev_data *pdev_data)
|
||||||
{
|
{
|
||||||
struct device_node *np = dev->of_node;
|
struct device_node *np = dev->of_node;
|
||||||
|
const struct of_device_id *of_id;
|
||||||
|
|
||||||
if (!np || !of_match_node(wlcore_sdio_of_match_table, np))
|
of_id = of_match_node(wlcore_sdio_of_match_table, np);
|
||||||
return -ENODATA;
|
if (!of_id)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
pdev_data->family = of_id->data;
|
||||||
|
|
||||||
*irq = irq_of_parse_and_map(np, 0);
|
*irq = irq_of_parse_and_map(np, 0);
|
||||||
if (!*irq) {
|
if (!*irq) {
|
||||||
@ -263,7 +283,7 @@ static int wlcore_probe_of(struct device *dev, int *irq,
|
|||||||
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 wlcore_platdev_data pdev_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;
|
||||||
@ -275,14 +295,15 @@ static int wl1271_probe(struct sdio_func *func,
|
|||||||
if (func->num != 0x02)
|
if (func->num != 0x02)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
memset(&pdev_data, 0x00, sizeof(pdev_data));
|
pdev_data = devm_kzalloc(&func->dev, sizeof(*pdev_data), GFP_KERNEL);
|
||||||
pdev_data.if_ops = &sdio_ops;
|
if (!pdev_data)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
|
pdev_data->if_ops = &sdio_ops;
|
||||||
if (!glue) {
|
|
||||||
dev_err(&func->dev, "can't allocate glue\n");
|
glue = devm_kzalloc(&func->dev, sizeof(*glue), GFP_KERNEL);
|
||||||
goto out;
|
if (!glue)
|
||||||
}
|
return -ENOMEM;
|
||||||
|
|
||||||
glue->dev = &func->dev;
|
glue->dev = &func->dev;
|
||||||
|
|
||||||
@ -292,16 +313,16 @@ 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;
|
||||||
|
|
||||||
ret = wlcore_probe_of(&func->dev, &irq, &pdev_data);
|
ret = wlcore_probe_of(&func->dev, &irq, pdev_data);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free_glue;
|
goto out;
|
||||||
|
|
||||||
/* if sdio can keep power while host is suspended, enable wow */
|
/* if sdio can keep power while host is suspended, enable wow */
|
||||||
mmcflags = sdio_get_host_pm_caps(func);
|
mmcflags = sdio_get_host_pm_caps(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)
|
||||||
pdev_data.pwr_in_suspend = true;
|
pdev_data->pwr_in_suspend = true;
|
||||||
|
|
||||||
sdio_set_drvdata(func, glue);
|
sdio_set_drvdata(func, glue);
|
||||||
|
|
||||||
@ -323,7 +344,7 @@ static int wl1271_probe(struct sdio_func *func,
|
|||||||
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;
|
||||||
goto out_free_glue;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
glue->core->dev.parent = &func->dev;
|
glue->core->dev.parent = &func->dev;
|
||||||
@ -341,8 +362,8 @@ static int wl1271_probe(struct sdio_func *func,
|
|||||||
goto out_dev_put;
|
goto out_dev_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = platform_device_add_data(glue->core, &pdev_data,
|
ret = platform_device_add_data(glue->core, pdev_data,
|
||||||
sizeof(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;
|
||||||
@ -358,9 +379,6 @@ static int wl1271_probe(struct sdio_func *func,
|
|||||||
out_dev_put:
|
out_dev_put:
|
||||||
platform_device_put(glue->core);
|
platform_device_put(glue->core);
|
||||||
|
|
||||||
out_free_glue:
|
|
||||||
kfree(glue);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user