1 From cd84042ce9040ad038e958bc67a46fcfc015c736 Mon Sep 17 00:00:00 2001
2 From: "Vittorio Gambaletta (VittGam)" <linux-wireless@vittgam.net>
3 Date: Mon, 11 Apr 2016 04:48:54 +0200
4 Subject: ath9k: Add a module parameter to invert LED polarity.
6 From: Vittorio Gambaletta (VittGam) <linux-wireless@vittgam.net>
8 commit cd84042ce9040ad038e958bc67a46fcfc015c736 upstream.
10 The LED can be active high instead of active low on some hardware.
12 Add the led_active_high module parameter. It defaults to -1 to obey
13 platform data as before.
15 Setting the parameter to 1 or 0 will force the LED respectively
16 active high or active low.
18 Cc: <linux-wireless@vger.kernel.org>
19 Cc: <ath9k-devel@qca.qualcomm.com>
20 Cc: <ath9k-devel@lists.ath9k.org>
21 Signed-off-by: Vittorio Gambaletta <linuxbugs@vittgam.net>
22 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 drivers/net/wireless/ath/ath9k/init.c | 7 +++++++
27 1 file changed, 7 insertions(+)
29 --- a/drivers/net/wireless/ath/ath9k/init.c
30 +++ b/drivers/net/wireless/ath/ath9k/init.c
31 @@ -49,6 +49,10 @@ int ath9k_led_blink;
32 module_param_named(blink, ath9k_led_blink, int, 0444);
33 MODULE_PARM_DESC(blink, "Enable LED blink on activity");
35 +static int ath9k_led_active_high = -1;
36 +module_param_named(led_active_high, ath9k_led_active_high, int, 0444);
37 +MODULE_PARM_DESC(led_active_high, "Invert LED polarity");
39 static int ath9k_btcoex_enable;
40 module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
41 MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
42 @@ -600,6 +604,9 @@ static int ath9k_init_softc(u16 devid, s
46 + if (ath9k_led_active_high != -1)
47 + ah->config.led_active_high = ath9k_led_active_high == 1;
50 * Enable WLAN/BT RX Antenna diversity only when: