]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.5.7/ath9k-add-a-module-parameter-to-invert-led-polarity.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.5.7 / ath9k-add-a-module-parameter-to-invert-led-polarity.patch
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.
5
6 From: Vittorio Gambaletta (VittGam) <linux-wireless@vittgam.net>
7
8 commit cd84042ce9040ad038e958bc67a46fcfc015c736 upstream.
9
10 The LED can be active high instead of active low on some hardware.
11
12 Add the led_active_high module parameter. It defaults to -1 to obey
13 platform data as before.
14
15 Setting the parameter to 1 or 0 will force the LED respectively
16 active high or active low.
17
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>
24
25 ---
26 drivers/net/wireless/ath/ath9k/init.c | 7 +++++++
27 1 file changed, 7 insertions(+)
28
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");
34
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");
38 +
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
43 if (ret)
44 return ret;
45
46 + if (ath9k_led_active_high != -1)
47 + ah->config.led_active_high = ath9k_led_active_high == 1;
48 +
49 /*
50 * Enable WLAN/BT RX Antenna diversity only when:
51 *