0081-mac80211-ath9k-set-default-state-for-platform-LEDs.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 29 May 2016 13:37:28 +0200
  3. Subject: mac80211: ath9k: set default state for platform LEDs
  4. Support default state for platform LEDs connected to ath9k device.
  5. Now LEDs are correctly set on or off at ath9k module initialization.
  6. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  7. Acked-by: Hartmut Knaack <knaack.h@gmx.de>
  8. Backport of r48880
  9. diff --git a/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch
  10. new file mode 100644
  11. index 0000000..db0b619
  12. --- /dev/null
  13. +++ b/package/kernel/mac80211/patches/547-ath9k_led_defstate_fix.patch
  14. @@ -0,0 +1,29 @@
  15. +From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  16. +Date: Sun, 31 Jan 2016 20:48:49 +0100
  17. +Subject: [PATCH v4 2/8] mac80211: ath9k: set default state for platform LEDs
  18. +
  19. +Support default state for platform LEDs connected to ath9k device.
  20. +Now LEDs are correctly set on or off at ath9k module initialization.
  21. +Very useful if power LED is connected to wireless chip.
  22. +
  23. +Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  24. +---
  25. + gpio.c | 7 +++++--
  26. + 1 file changed, 5 insertions(+), 2 deletions(-)
  27. +
  28. +--- a/drivers/net/wireless/ath/ath9k/gpio.c
  29. ++++ b/drivers/net/wireless/ath/ath9k/gpio.c
  30. +@@ -54,8 +54,11 @@ static int ath_add_led(struct ath_softc
  31. + ath9k_hw_cfg_output(sc->sc_ah, gpio->gpio,
  32. + AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
  33. +
  34. +- /* LED off */
  35. +- ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
  36. ++ /* Set default LED state */
  37. ++ if (gpio->default_state == LEDS_GPIO_DEFSTATE_ON)
  38. ++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, !gpio->active_low);
  39. ++ else
  40. ++ ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
  41. +
  42. + return 0;
  43. + }