difos/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch
Mathias Kresin 192f0a3db8 ath9k: unset the default LED pin if used by platform leds
Unset the default LED gpio pin if the same gpio pin is used by a LED
defined via platform LED. This prevents that the default led trigger
gets assigned to this LED and the GPIO value gets changed on
wifi up/down in case the led is not used for signaling the wifi state.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-04-08 14:30:00 +02:00

39 lines
1.3 KiB
Diff

From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
Date: Sun, 31 Jan 2016 20:45:57 +0100
Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name
Enable platform-supplied WLAN LED name for ath9k device. It replaces generic
'ath9k-phy*' label with string set during platform initialization.
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
---
drivers/net/wireless/ath/ath9k/gpio.c | 7 +++++--
include/linux/ath9k_platform.h | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -166,8 +166,11 @@ void ath_init_leds(struct ath_softc *sc)
if (sc->sc_ah->led_pin < 0)
return;
- snprintf(led_name, sizeof(led_name), "ath9k-%s",
- wiphy_name(sc->hw->wiphy));
+ if (pdata && pdata->led_name)
+ strncpy(led_name, pdata->led_name, sizeof(led_name));
+ else
+ snprintf(led_name, sizeof(led_name), "ath9k-%s",
+ wiphy_name(sc->hw->wiphy));
if (ath9k_led_blink)
trigger = sc->led_default_trigger;
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -49,6 +49,7 @@ struct ath9k_platform_data {
int num_leds;
const struct gpio_led *leds;
+ const char *led_name;
};
#endif /* _LINUX_ATH9K_PLATFORM_H */