wl1271: add gpio_power file in debugfs to power the chip on and off
Some debugging tools require the chip to be powered on before they can work.
With these tools, we shouldn't upload the firmware nor boot the firmware
ourselves, so this debufs file is provided. It always contains the gpio
power setting (0 = off, 1 = on). To change the power setting, just write 0
or 1 to the file.
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 147aab2..b33bdcc 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -399,11 +399,13 @@
static void wl1271_power_off(struct wl1271 *wl)
{
wl->set_power(false);
+ wl->gpio_power = false;
}
static void wl1271_power_on(struct wl1271 *wl)
{
wl->set_power(true);
+ wl->gpio_power = true;
}
static void wl1271_fw_status(struct wl1271 *wl,
@@ -1923,6 +1925,7 @@
wl->band = IEEE80211_BAND_2GHZ;
wl->vif = NULL;
wl->joined = false;
+ wl->gpio_power = false;
for (i = 0; i < ACX_TX_DESCRIPTORS; i++)
wl->tx_frames[i] = NULL;