summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/microchip/wilc1000/sdio.c
Commit message (Collapse)AuthorAgeFilesLines
* wifi: wilc1000: replace open-coded module_sdio_driver()Krzysztof Kozlowski2024-04-051-3/+2
| | | | | | | | | Use module_sdio_driver() instead of open-coding it. No functional difference. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240329171019.63836-5-krzysztof.kozlowski@linaro.org
* wifi: fill in MODULE_DESCRIPTION()s for wilc1000Breno Leitao2024-01-311-0/+1
| | | | | | | | | W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Add descriptions to the Atmel WILC1000 SPI driver. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240130104243.3025393-9-leitao@debian.org
* wifi: wilc1000: always release SDIO host in wilc_sdio_cmd53()Dmitry Antipov2023-10-301-4/+5
| | | | | | | | | | Ensure 'sdio_release_host()' is always issued on return from 'wilc_sdio_cmd53()'. Compile tested only. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Acked-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20231026141016.71407-2-dmantipov@yandex.ru
* wifi: wilc1000: remove use of has_thrpt_enh3 flagPrasurjya Rohan Saikia2023-08-011-93/+10
| | | | | | | | | | The 'enhance throughput flow' algorithm is used by default. So older sections of the code are removed so as to always use this new algorithm. Signed-off-by: Prasurjya Rohan Saikia <prasurjya.rohansaikia@microchip.com> Acked-by: Ajay Kathat <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20230710094401.235222-1-prasurjya.rohansaikia@microchip.com
* wifi: wilc1000: sdio: fix module autoloadingMichael Walle2022-11-011-0/+1
| | | | | | | | | | There are no SDIO module aliases included in the driver, therefore, module autoloading isn't working. Add the proper MODULE_DEVICE_TABLE(). Cc: stable@vger.kernel.org Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221027171221.491937-1-michael@walle.cc
* wifi: wilc1000: fix DMA on stack objectsAjay.Kathat@microchip.com2022-08-301-6/+33
| | | | | | | | | | | | | | | Sometimes 'wilc_sdio_cmd53' is called with addresses pointing to an object on the stack. Use dynamically allocated memory for cmd53 instead of stack address which is not DMA'able. Fixes: 5625f965d764 ("wilc1000: move wilc driver out of staging") Reported-by: Michael Walle <mwalle@kernel.org> Suggested-by: Michael Walle <mwalle@kernel.org> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Reviewed-by: Michael Walle <mwalle@kernel.org> Tested-by: Michael Walle <mwalle@kernel.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220809075749.62752-1-ajay.kathat@microchip.com
* wifi: wilc1000: add 'isinit' flag for SDIO bus similar to SPIAjay Singh2022-07-271-0/+13
| | | | | | | | | | Similar to SPI priv data, add 'isinit' variable in SDIO priv. Make use of the state to invoke hif_init() once, and acquire the lock before accessing hif function. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220720160302.231516-7-ajay.kathat@microchip.com
* wilc1000: use fixed function base register value to access SDIO_FBR_ENABLE_CSAAjay Singh2022-05-111-1/+1
| | | | | | | | | | The function number was not correct(reset to 0) when host resumes from suspend state. Use hardcoded value in function base information register(FBR base address) to re-initialize correctly on host resume. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220504161924.2146601-2-ajay.kathat@microchip.com
* wilc1000: fix double free error in probe()Dan Carpenter2021-12-201-0/+2
| | | | | | | | | | | | | | | | | | Smatch complains that there is a double free in probe: drivers/net/wireless/microchip/wilc1000/spi.c:186 wilc_bus_probe() error: double free of 'spi_priv' drivers/net/wireless/microchip/wilc1000/sdio.c:163 wilc_sdio_probe() error: double free of 'sdio_priv' The problem is that wilc_netdev_cleanup() function frees "wilc->bus_data". That's confusing and a layering violation. Leave the frees in probe(), delete the free in wilc_netdev_cleanup(), and add some new frees to the remove() functions. Fixes: dc8b338f3bcd ("wilc1000: use goto labels on error path") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20211217150311.GC16611@kili
* wilc1000: handle read failure issue for clockless registersAjay Singh2021-09-211-0/+1
| | | | | | | | | | For SPI bus, the register read fails after read/write to the clockless register during chip wakeup sequence. Add workaround to send CMD_RESET command during chip wake-up sequence to overcome the issue. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210916164902.74629-7-ajay.kathat@microchip.com
* wilc1000: use devm_clk_get_optional()Claudiu Beznea2021-08-211-8/+6
| | | | | | | | | Use devm_clk_get_optional() for rtc clock: it simplifies a bit the code. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210806081229.721731-4-claudiu.beznea@microchip.com
* wilc1000: dispose irq on failure pathClaudiu Beznea2021-08-211-2/+3
| | | | | | | | Dispose IRQ on failure path. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210806081229.721731-3-claudiu.beznea@microchip.com
* wilc1000: use goto labels on error pathClaudiu Beznea2021-08-211-6/+10
| | | | | | | | | | Use goto labels on error path for probe functions. This makes code easier to read. With this introduce also netdev_cleanup and call it where necessary. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210806081229.721731-2-claudiu.beznea@microchip.com
* wilc1000: write value to WILC_INTR2_ENABLE registerMarcus Folkesson2021-03-151-1/+1
| | | | | | | | | Write the value instead of reading it twice. Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210224163706.519658-1-marcus.folkesson@gmail.com
* wilc1000: Fix memleak in wilc_sdio_probeDinghao Liu2020-08-271-2/+3
| | | | | | | | | | | | When devm_clk_get() returns -EPROBE_DEFER, sdio_priv should be freed just like when wilc_cfg80211_init() fails. Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200820054819.23365-1-dinghao.liu@zju.edu.cn
* wilc1000: Move wilc1000 SDIO ID's from driver source to common header fileAjay Singh2020-08-021-4/+2
| | | | | | | | | | | Moved macros used for Vendor/Device ID from wilc1000 driver to common header file and changed macro name for consistency with other macros. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Pali Rohár <pali@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200717051134.19160-1-ajay.kathat@microchip.com
* wilc1000: move wilc driver out of stagingAjay Singh2020-06-261-0/+1023
WILC1000 is an IEEE 802.11 b/g/n IoT link controller module. The WILC1000 connects to Microchip AVR/SMART MCUs, SMART MPUs, and other processors with minimal resource requirements with a simple SPI/SDIO-to-Wi-Fi interface. WILC1000 driver has been part of staging for few years. With contributions from the community, it has improved significantly. Full driver review has helped in achieving the current state. The details for those reviews are captured in 1 & 2. [1]. https://lore.kernel.org/linux-wireless/1537957525-11467-1-git-send-email-ajay.kathat@microchip.com/ [2]. https://lore.kernel.org/linux-wireless/1562896697-8002-1-git-send-email-ajay.kathat@microchip.com/ Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>