|
@@ -38,7 +38,7 @@
|
|
|
#ifdef CPTCFG_ATH9K_DEBUGFS
|
|
#ifdef CPTCFG_ATH9K_DEBUGFS
|
|
|
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
|
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
|
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
|
|
-@@ -39,61 +39,115 @@ static void ath_fill_led_pin(struct ath_
|
|
|
|
|
|
|
+@@ -39,61 +39,111 @@ static void ath_fill_led_pin(struct ath_
|
|
|
else
|
|
else
|
|
|
ah->led_pin = ATH_LED_PIN_DEF;
|
|
ah->led_pin = ATH_LED_PIN_DEF;
|
|
|
}
|
|
}
|
|
@@ -125,11 +125,11 @@
|
|
|
{
|
|
{
|
|
|
- if (!sc->led_registered)
|
|
- if (!sc->led_registered)
|
|
|
- return;
|
|
- return;
|
|
|
--
|
|
|
|
|
-- ath_led_brightness(&sc->led_cdev, LED_OFF);
|
|
|
|
|
-- led_classdev_unregister(&sc->led_cdev);
|
|
|
|
|
+ struct ath_led *led;
|
|
+ struct ath_led *led;
|
|
|
|
|
|
|
|
|
|
+- ath_led_brightness(&sc->led_cdev, LED_OFF);
|
|
|
|
|
+- led_classdev_unregister(&sc->led_cdev);
|
|
|
|
|
+-
|
|
|
- ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
|
|
- ath9k_hw_gpio_free(sc->sc_ah, sc->sc_ah->led_pin);
|
|
|
+ while (!list_empty(&sc->leds)) {
|
|
+ while (!list_empty(&sc->leds)) {
|
|
|
+ led = list_first_entry(&sc->leds, struct ath_led, list);
|
|
+ led = list_first_entry(&sc->leds, struct ath_led, list);
|
|
@@ -144,7 +144,6 @@
|
|
|
void ath_init_leds(struct ath_softc *sc)
|
|
void ath_init_leds(struct ath_softc *sc)
|
|
|
{
|
|
{
|
|
|
- int ret;
|
|
- int ret;
|
|
|
-+ struct ath_hw *ah = sc->sc_ah;
|
|
|
|
|
+ char led_name[32];
|
|
+ char led_name[32];
|
|
|
+ const char *trigger;
|
|
+ const char *trigger;
|
|
|
+
|
|
+
|
|
@@ -163,21 +162,18 @@
|
|
|
- "ath9k-%s", wiphy_name(sc->hw->wiphy));
|
|
- "ath9k-%s", wiphy_name(sc->hw->wiphy));
|
|
|
- sc->led_cdev.name = sc->led_name;
|
|
- sc->led_cdev.name = sc->led_name;
|
|
|
- sc->led_cdev.brightness_set = ath_led_brightness;
|
|
- sc->led_cdev.brightness_set = ath_led_brightness;
|
|
|
--
|
|
|
|
|
-- ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &sc->led_cdev);
|
|
|
|
|
-- if (ret < 0)
|
|
|
|
|
-+ if (ah->led_pin < 0)
|
|
|
|
|
- return;
|
|
|
|
|
-
|
|
|
|
|
-- sc->led_registered = true;
|
|
|
|
|
+ snprintf(led_name, sizeof(led_name), "ath9k-%s",
|
|
+ snprintf(led_name, sizeof(led_name), "ath9k-%s",
|
|
|
+ wiphy_name(sc->hw->wiphy));
|
|
+ wiphy_name(sc->hw->wiphy));
|
|
|
-+
|
|
|
|
|
|
|
+
|
|
|
|
|
+- ret = led_classdev_register(wiphy_dev(sc->hw->wiphy), &sc->led_cdev);
|
|
|
|
|
+- if (ret < 0)
|
|
|
|
|
+- return;
|
|
|
+ if (ath9k_led_blink)
|
|
+ if (ath9k_led_blink)
|
|
|
+ trigger = sc->led_default_trigger;
|
|
+ trigger = sc->led_default_trigger;
|
|
|
+ else
|
|
+ else
|
|
|
+ trigger = ieee80211_get_radio_led_name(sc->hw);
|
|
+ trigger = ieee80211_get_radio_led_name(sc->hw);
|
|
|
-+
|
|
|
|
|
|
|
+
|
|
|
|
|
+- sc->led_registered = true;
|
|
|
+ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
|
|
+ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
|
|
|
+ !sc->sc_ah->config.led_active_high);
|
|
+ !sc->sc_ah->config.led_active_high);
|
|
|
}
|
|
}
|