|
@@ -968,9 +968,9 @@ static void ath_led_blink_work(struct work_struct *work)
|
|
|
|
|
|
if ((sc->led_on_duration == ATH_LED_ON_DURATION_IDLE) ||
|
|
|
(sc->led_off_duration == ATH_LED_OFF_DURATION_IDLE))
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0);
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
|
|
|
else
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN,
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin,
|
|
|
(sc->sc_flags & SC_OP_LED_ON) ? 1 : 0);
|
|
|
|
|
|
ieee80211_queue_delayed_work(sc->hw,
|
|
@@ -1002,7 +1002,7 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
|
|
|
case LED_OFF:
|
|
|
if (led->led_type == ATH_LED_ASSOC ||
|
|
|
led->led_type == ATH_LED_RADIO) {
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN,
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin,
|
|
|
(led->led_type == ATH_LED_RADIO));
|
|
|
sc->sc_flags &= ~SC_OP_LED_ASSOCIATED;
|
|
|
if (led->led_type == ATH_LED_RADIO)
|
|
@@ -1017,7 +1017,7 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
|
|
|
ieee80211_queue_delayed_work(sc->hw,
|
|
|
&sc->ath_led_blink_work, 0);
|
|
|
} else if (led->led_type == ATH_LED_RADIO) {
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0);
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
|
|
|
sc->sc_flags |= SC_OP_LED_ON;
|
|
|
} else {
|
|
|
sc->led_on_cnt++;
|
|
@@ -1062,7 +1062,7 @@ static void ath_deinit_leds(struct ath_softc *sc)
|
|
|
ath_unregister_led(&sc->tx_led);
|
|
|
ath_unregister_led(&sc->rx_led);
|
|
|
ath_unregister_led(&sc->radio_led);
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1);
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
|
|
|
}
|
|
|
|
|
|
static void ath_init_leds(struct ath_softc *sc)
|
|
@@ -1070,11 +1070,16 @@ static void ath_init_leds(struct ath_softc *sc)
|
|
|
char *trigger;
|
|
|
int ret;
|
|
|
|
|
|
+ if (AR_SREV_9287(sc->sc_ah))
|
|
|
+ sc->sc_ah->led_pin = ATH_LED_PIN_9287;
|
|
|
+ else
|
|
|
+ sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
|
|
|
+
|
|
|
/* Configure gpio 1 for output */
|
|
|
- ath9k_hw_cfg_output(sc->sc_ah, ATH_LED_PIN,
|
|
|
+ ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
|
|
|
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
/* LED off, active low */
|
|
|
- ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1);
|
|
|
+ ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
|
|
|
|
|
|
INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
|
|
|
|
|
@@ -1153,9 +1158,9 @@ void ath_radio_enable(struct ath_softc *sc)
|
|
|
ath9k_hw_set_interrupts(ah, sc->imask);
|
|
|
|
|
|
/* Enable LED */
|
|
|
- ath9k_hw_cfg_output(ah, ATH_LED_PIN,
|
|
|
+ ath9k_hw_cfg_output(ah, ah->led_pin,
|
|
|
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
|
|
- ath9k_hw_set_gpio(ah, ATH_LED_PIN, 0);
|
|
|
+ ath9k_hw_set_gpio(ah, ah->led_pin, 0);
|
|
|
|
|
|
ieee80211_wake_queues(sc->hw);
|
|
|
ath9k_ps_restore(sc);
|
|
@@ -1171,8 +1176,8 @@ void ath_radio_disable(struct ath_softc *sc)
|
|
|
ieee80211_stop_queues(sc->hw);
|
|
|
|
|
|
/* Disable LED */
|
|
|
- ath9k_hw_set_gpio(ah, ATH_LED_PIN, 1);
|
|
|
- ath9k_hw_cfg_gpio_input(ah, ATH_LED_PIN);
|
|
|
+ ath9k_hw_set_gpio(ah, ah->led_pin, 1);
|
|
|
+ ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
|
|
|
|
|
|
/* Disable interrupts */
|
|
|
ath9k_hw_set_interrupts(ah, 0);
|