wilc1000: Add reset/enable GPIO support to SPI driver
authorDavid Mosberger-Tang <davidm@egauge.net>
Tue, 21 Dec 2021 21:25:34 +0000 (21:25 +0000)
committerKalle Valo <kvalo@kernel.org>
Wed, 22 Dec 2021 17:51:18 +0000 (19:51 +0200)
commitec031ac4792c72d9e925313366df8064e092f685
tree481b7002423b51a47ee7d1e5356ab1ca12876bbf
parent4d2cd7b06ce0d539b70619f7662fa67508d9008a
wilc1000: Add reset/enable GPIO support to SPI driver

For the SDIO driver, the RESET/ENABLE pins of WILC1000 are controlled
through the SDIO power sequence driver.  This commit adds analogous
support for the SPI driver.  Specifically, during initialization, the
chip will be ENABLEd and taken out of RESET and during
deinitialization, the chip will be placed back into RESET and disabled
(both to reduce power consumption and to ensure the WiFi radio is
off).

Both RESET and ENABLE GPIOs are optional.  However, if the ENABLE GPIO
is specified, then the RESET GPIO should normally also be specified as
otherwise there is no way to ensure proper timing of the ENABLE/RESET
sequence.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211221212531.4011609-2-davidm@egauge.net
drivers/net/wireless/microchip/wilc1000/spi.c
drivers/net/wireless/microchip/wilc1000/wlan.c