diff options
author | Andrejs Cainikovs <andrejs.cainikovs@toradex.com> | 2022-04-22 12:03:12 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-04-27 07:56:31 +0300 |
commit | 255ca28a659d3cfb069f73c7644853ed93aecdb0 (patch) | |
tree | 115a345b0f3c962395ab99f456aed3bb79bd12d5 /drivers/net/wireless/marvell/mwifiex/sdio.h | |
parent | 68d57a07bfe5bb29b80cd8b8fa24c9d1ea104124 (diff) | |
download | linux-255ca28a659d3cfb069f73c7644853ed93aecdb0.tar.xz |
mwifiex: Select firmware based on strapping
Some WiFi/Bluetooth modules might have different host connection
options, allowing to either use SDIO for both WiFi and Bluetooth,
or SDIO for WiFi and UART for Bluetooth. It is possible to detect
whether a module has SDIO-SDIO or SDIO-UART connection by reading
its host strap register.
This change introduces a way to automatically select appropriate
firmware depending of the connection method, and removes a need
of symlinking or overwriting the original firmware file with a
required one.
Host strap register used in this commit comes from the NXP driver [1]
hosted at Code Aurora.
[1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_sdio_mmc.c?h=rel_imx_5.4.70_2.3.2&id=688b67b2c7220b01521ffe560da7eee33042c7bd#n1274
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220422090313.125857-2-andrejs.cainikovs@toradex.com
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/sdio.h')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/sdio.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.h b/drivers/net/wireless/marvell/mwifiex/sdio.h index 5648512c9300..ad2c28cbb630 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.h +++ b/drivers/net/wireless/marvell/mwifiex/sdio.h @@ -196,6 +196,9 @@ struct mwifiex_sdio_card_reg { u8 host_int_rsr_reg; u8 host_int_status_reg; u8 host_int_mask_reg; + u8 host_strap_reg; + u8 host_strap_mask; + u8 host_strap_value; u8 status_reg_0; u8 status_reg_1; u8 sdio_int_mask; @@ -241,6 +244,7 @@ struct sdio_mmc_card { struct completion fw_done; const char *firmware; + const char *firmware_sdiouart; const struct mwifiex_sdio_card_reg *reg; u8 max_ports; u8 mp_agg_pkt_limit; @@ -274,6 +278,7 @@ struct sdio_mmc_card { struct mwifiex_sdio_device { const char *firmware; + const char *firmware_sdiouart; const struct mwifiex_sdio_card_reg *reg; u8 max_ports; u8 mp_agg_pkt_limit; |