diff options
Diffstat (limited to 'drivers/staging/wfx/bus_sdio.c')
-rw-r--r-- | drivers/staging/wfx/bus_sdio.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c index 5c45ccd85a7d..361585763f30 100644 --- a/drivers/staging/wfx/bus_sdio.c +++ b/drivers/staging/wfx/bus_sdio.c @@ -10,6 +10,7 @@ #include <linux/mmc/sdio_func.h> #include <linux/mmc/card.h> #include <linux/interrupt.h> +#include <linux/of_device.h> #include <linux/of_irq.h> #include <linux/irq.h> #include <linux/align.h> @@ -20,7 +21,28 @@ #include "main.h" #include "bh.h" -static const struct wfx_platform_data wfx_sdio_pdata = { +static const struct wfx_platform_data pdata_wf200 = { + .file_fw = "wfm_wf200", + .file_pds = "wf200.pds", +}; + +static const struct wfx_platform_data pdata_brd4001a = { + .file_fw = "wfm_wf200", + .file_pds = "brd4001a.pds", +}; + +static const struct wfx_platform_data pdata_brd8022a = { + .file_fw = "wfm_wf200", + .file_pds = "brd8022a.pds", +}; + +static const struct wfx_platform_data pdata_brd8023a = { + .file_fw = "wfm_wf200", + .file_pds = "brd8023a.pds", +}; + +/* Legacy DT don't use it */ +static const struct wfx_platform_data pdata_wfx_sdio = { .file_fw = "wfm_wf200", .file_pds = "wf200.pds", }; @@ -167,14 +189,18 @@ static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = { }; static const struct of_device_id wfx_sdio_of_match[] = { - { .compatible = "silabs,wfx-sdio" }, - { .compatible = "silabs,wf200" }, + { .compatible = "silabs,wf200", .data = &pdata_wf200 }, + { .compatible = "silabs,brd4001a", .data = &pdata_brd4001a }, + { .compatible = "silabs,brd8022a", .data = &pdata_brd8022a }, + { .compatible = "silabs,brd8023a", .data = &pdata_brd8023a }, + { .compatible = "silabs,wfx-sdio", .data = &pdata_wfx_sdio }, { }, }; MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) { + const struct wfx_platform_data *pdata = of_device_get_match_data(&func->dev); struct device_node *np = func->dev.of_node; struct wfx_sdio_priv *bus; int ret; @@ -216,8 +242,7 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i if (ret) return ret; - bus->core = wfx_init_common(&func->dev, &wfx_sdio_pdata, - &wfx_sdio_hwbus_ops, bus); + bus->core = wfx_init_common(&func->dev, pdata, &wfx_sdio_hwbus_ops, bus); if (!bus->core) { ret = -EIO; goto sdio_release; |