mac80211: ath9k: remove platform leds
authorRosen Penev <rosenp@gmail.com>
Tue, 31 Dec 2024 22:09:44 +0000 (14:09 -0800)
committerRobert Marko <robimarko@gmail.com>
Wed, 9 Apr 2025 10:43:30 +0000 (12:43 +0200)
These only work with and are useful with mach files. Now that those are
gone, this can go too.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17445
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch [deleted file]
package/kernel/mac80211/patches/ath9k/547-ath9k_led_defstate_fix.patch
package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch
package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch
target/linux/generic/files/include/linux/ath9k_platform.h

diff --git a/package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch
deleted file mode 100644 (file)
index 1055bd3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/drivers/net/wireless/ath/ath9k/gpio.c
-+++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -15,6 +15,7 @@
-  */
- #include "ath9k.h"
-+#include <linux/ath9k_platform.h>
- /********************************/
- /*     LED functions          */
-@@ -108,6 +109,24 @@ int ath_create_gpio_led(struct ath_softc
-       return ret;
- }
-+static int ath_create_platform_led(struct ath_softc *sc,
-+                                 const struct gpio_led *gpio)
-+{
-+      struct ath_led *led;
-+      int ret;
-+
-+      led = kzalloc(sizeof(*led), GFP_KERNEL);
-+      if (!led)
-+              return -ENOMEM;
-+
-+      led->gpio = gpio;
-+      ret = ath_add_led(sc, led);
-+      if (ret < 0)
-+              kfree(led);
-+
-+      return ret;
-+}
-+
- void ath_deinit_leds(struct ath_softc *sc)
- {
-       struct ath_led *led;
-@@ -124,8 +143,10 @@ void ath_deinit_leds(struct ath_softc *s
- void ath_init_leds(struct ath_softc *sc)
- {
-+      struct ath9k_platform_data *pdata = sc->dev->platform_data;
-       char led_name[32];
-       const char *trigger;
-+      int i;
-       INIT_LIST_HEAD(&sc->leds);
-@@ -134,6 +155,17 @@ void ath_init_leds(struct ath_softc *sc)
-       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 (sc->sc_ah->led_pin < 0)
-+              return;
-+
-       snprintf(led_name, sizeof(led_name), "ath9k-%s",
-                wiphy_name(sc->hw->wiphy));
index 5d84cf0c423a6138b0a48305006202f00e4bbdef..d633c051b0d04c945fc884ade2f38ab1a93c62ea 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
 
 --- a/drivers/net/wireless/ath/ath9k/gpio.c
 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -74,8 +74,11 @@ static int ath_add_led(struct ath_softc
+@@ -73,8 +73,11 @@ static int ath_add_led(struct ath_softc
        ath9k_hw_gpio_request_out(sc->sc_ah, gpio->gpio, gpio->name,
                                  AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
  
index 9696ea5c8838c11001c157b818e991bb1dbb03c9..288948c8386c89420772ca0d4652991dbadd178a 100644 (file)
@@ -32,9 +32,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #ifdef CPTCFG_ATH9K_DEBUGFS
 --- a/drivers/net/wireless/ath/ath9k/gpio.c
 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -17,12 +17,120 @@
+@@ -16,12 +16,120 @@
  #include "ath9k.h"
- #include <linux/ath9k_platform.h>
  
 +#ifdef CPTCFG_MAC80211_LEDS
 +
@@ -155,7 +155,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static void ath_fill_led_pin(struct ath_softc *sc)
  {
        struct ath_hw *ah = sc->sc_ah;
-@@ -80,6 +188,12 @@ static int ath_add_led(struct ath_softc
+@@ -79,6 +187,12 @@ static int ath_add_led(struct ath_softc
        else
                ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
  
@@ -168,7 +168,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        return 0;
  }
  
-@@ -136,17 +250,24 @@ void ath_deinit_leds(struct ath_softc *s
+@@ -117,16 +231,23 @@ void ath_deinit_leds(struct ath_softc *s
  
        while (!list_empty(&sc->leds)) {
                led = list_first_entry(&sc->leds, struct ath_led, list);
@@ -188,12 +188,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  void ath_init_leds(struct ath_softc *sc)
  {
-       struct ath9k_platform_data *pdata = sc->dev->platform_data;
 +      struct device_node *np = sc->dev->of_node;
        char led_name[32];
        const char *trigger;
-       int i;
-@@ -156,6 +277,15 @@ void ath_init_leds(struct ath_softc *sc)
+@@ -135,6 +256,15 @@ void ath_init_leds(struct ath_softc *sc)
        if (AR_SREV_9100(sc->sc_ah))
                return;
  
@@ -208,4 +207,4 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +
        ath_fill_led_pin(sc);
  
-       if (pdata && pdata->leds && pdata->num_leds)
+       snprintf(led_name, sizeof(led_name), "ath9k-%s",
index 83f7a146e3c64ab8f6bc906f04bacbe5948930f2..5a8c057b31858bf2dd74d5cab681c1c3b8d8a810 100644 (file)
@@ -20,16 +20,17 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/drivers/net/wireless/ath/ath9k/gpio.c
 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -16,6 +16,8 @@
+@@ -15,6 +15,9 @@
+  */
  
  #include "ath9k.h"
- #include <linux/ath9k_platform.h>
++#include <linux/ath9k_platform.h>
 +#include <linux/platform_device.h>
 +#include <linux/gpio_keys.h>
  
  #ifdef CPTCFG_MAC80211_LEDS
  
-@@ -115,6 +117,67 @@ static void ath9k_unregister_gpio_chip(s
+@@ -114,6 +117,67 @@ static void ath9k_unregister_gpio_chip(s
        kfree(gc);
  }
  
@@ -97,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #else /* CONFIG_GPIOLIB */
  
  static inline void ath9k_register_gpio_chip(struct ath_softc *sc)
-@@ -125,6 +188,14 @@ static inline void ath9k_unregister_gpio
+@@ -124,6 +188,14 @@ static inline void ath9k_unregister_gpio
  {
  }
  
@@ -112,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #endif /* CONFIG_GPIOLIB */
  
  /********************************/
-@@ -248,6 +319,7 @@ void ath_deinit_leds(struct ath_softc *s
+@@ -229,6 +301,7 @@ void ath_deinit_leds(struct ath_softc *s
  {
        struct ath_led *led;
  
@@ -120,11 +121,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        while (!list_empty(&sc->leds)) {
                led = list_first_entry(&sc->leds, struct ath_led, list);
  #ifdef CONFIG_GPIOLIB
-@@ -287,6 +359,7 @@ void ath_init_leds(struct ath_softc *sc)
+@@ -266,6 +339,7 @@ void ath_init_leds(struct ath_softc *sc)
        }
  
        ath_fill_led_pin(sc);
 +      ath9k_init_buttons(sc);
  
-       if (pdata && pdata->leds && pdata->num_leds)
-               for (i = 0; i < pdata->num_leds; i++) {
+       snprintf(led_name, sizeof(led_name), "ath9k-%s",
+                wiphy_name(sc->hw->wiphy));
index e210108568a6902c4db10307c875ea936664723f..c4389b7e6cb11d547d4716cc84c8a64da4b2b722 100644 (file)
@@ -47,9 +47,6 @@ struct ath9k_platform_data {
 
        bool use_eeprom;
 
-       int num_leds;
-       const struct gpio_led *leds;
-
        unsigned num_btns;
        const struct gpio_keys_button *btns;
        unsigned btn_poll_interval;