From 192f0a3db8598fc6faa47788d0152bda54c5109a Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Tue, 21 Mar 2017 23:21:57 +0100 Subject: 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 --- .../patches/531-ath9k_extra_platform_leds.patch | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch') diff --git a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch index 35d8e8bd42..8ed7ad8a09 100644 --- a/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch +++ b/package/kernel/mac80211/patches/531-ath9k_extra_platform_leds.patch @@ -56,16 +56,21 @@ INIT_LIST_HEAD(&sc->leds); -@@ -144,6 +165,12 @@ void ath_init_leds(struct ath_softc *sc) +@@ -134,6 +155,17 @@ void ath_init_leds(struct ath_softc *sc) - ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, - !sc->sc_ah->config.led_active_high); + ath_fill_led_pin(sc); + ++ if (pdata && pdata->leds && pdata->num_leds) ++ for (i = 0; i < pdata->num_leds; i++) { ++ if (pdata->leds[i].gpio == sc->sc_ah->led_pin) ++ sc->sc_ah->led_pin = -1; ++ ++ ath_create_platform_led(sc, &pdata->leds[i]); ++ } + -+ if (!pdata) ++ if (sc->sc_ah->led_pin < 0) + return; + -+ for (i = 0; i < pdata->num_leds; i++) -+ ath_create_platform_led(sc, &pdata->leds[i]); - } - #endif + snprintf(led_name, sizeof(led_name), "ath9k-%s", + wiphy_name(sc->hw->wiphy)); -- cgit v1.2.3