aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorVivek Natarajan <vivek.natraj@gmail.com>2009-08-14 02:00:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:35:52 -0400
commit08fc5c1ba026de0904aeeba9785f95f6603d58f7 (patch)
treed3eb522787b2bec24ac6d76b0960493fe769d68a /drivers/net/wireless/ath/ath9k/main.c
parentd340b1f0e5e374fc902a020cb6ef9ebd7fb9f368 (diff)
ath9k: Enable LEDs for AR9287 chipsets.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index fa4c6e74f977..3e09b9ac165b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -968,9 +968,9 @@ static void ath_led_blink_work(struct work_struct *work)
968 968
969 if ((sc->led_on_duration == ATH_LED_ON_DURATION_IDLE) || 969 if ((sc->led_on_duration == ATH_LED_ON_DURATION_IDLE) ||
970 (sc->led_off_duration == ATH_LED_OFF_DURATION_IDLE)) 970 (sc->led_off_duration == ATH_LED_OFF_DURATION_IDLE))
971 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0); 971 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
972 else 972 else
973 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 973 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin,
974 (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0); 974 (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0);
975 975
976 ieee80211_queue_delayed_work(sc->hw, 976 ieee80211_queue_delayed_work(sc->hw,
@@ -1002,7 +1002,7 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
1002 case LED_OFF: 1002 case LED_OFF:
1003 if (led->led_type == ATH_LED_ASSOC || 1003 if (led->led_type == ATH_LED_ASSOC ||
1004 led->led_type == ATH_LED_RADIO) { 1004 led->led_type == ATH_LED_RADIO) {
1005 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1005 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin,
1006 (led->led_type == ATH_LED_RADIO)); 1006 (led->led_type == ATH_LED_RADIO));
1007 sc->sc_flags &= ~SC_OP_LED_ASSOCIATED; 1007 sc->sc_flags &= ~SC_OP_LED_ASSOCIATED;
1008 if (led->led_type == ATH_LED_RADIO) 1008 if (led->led_type == ATH_LED_RADIO)
@@ -1017,7 +1017,7 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
1017 ieee80211_queue_delayed_work(sc->hw, 1017 ieee80211_queue_delayed_work(sc->hw,
1018 &sc->ath_led_blink_work, 0); 1018 &sc->ath_led_blink_work, 0);
1019 } else if (led->led_type == ATH_LED_RADIO) { 1019 } else if (led->led_type == ATH_LED_RADIO) {
1020 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0); 1020 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 0);
1021 sc->sc_flags |= SC_OP_LED_ON; 1021 sc->sc_flags |= SC_OP_LED_ON;
1022 } else { 1022 } else {
1023 sc->led_on_cnt++; 1023 sc->led_on_cnt++;
@@ -1062,7 +1062,7 @@ static void ath_deinit_leds(struct ath_softc *sc)
1062 ath_unregister_led(&sc->tx_led); 1062 ath_unregister_led(&sc->tx_led);
1063 ath_unregister_led(&sc->rx_led); 1063 ath_unregister_led(&sc->rx_led);
1064 ath_unregister_led(&sc->radio_led); 1064 ath_unregister_led(&sc->radio_led);
1065 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); 1065 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
1066} 1066}
1067 1067
1068static void ath_init_leds(struct ath_softc *sc) 1068static void ath_init_leds(struct ath_softc *sc)
@@ -1070,11 +1070,16 @@ static void ath_init_leds(struct ath_softc *sc)
1070 char *trigger; 1070 char *trigger;
1071 int ret; 1071 int ret;
1072 1072
1073 if (AR_SREV_9287(sc->sc_ah))
1074 sc->sc_ah->led_pin = ATH_LED_PIN_9287;
1075 else
1076 sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
1077
1073 /* Configure gpio 1 for output */ 1078 /* Configure gpio 1 for output */
1074 ath9k_hw_cfg_output(sc->sc_ah, ATH_LED_PIN, 1079 ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
1075 AR_GPIO_OUTPUT_MUX_AS_OUTPUT); 1080 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
1076 /* LED off, active low */ 1081 /* LED off, active low */
1077 ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1); 1082 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
1078 1083
1079 INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work); 1084 INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
1080 1085
@@ -1153,9 +1158,9 @@ void ath_radio_enable(struct ath_softc *sc)
1153 ath9k_hw_set_interrupts(ah, sc->imask); 1158 ath9k_hw_set_interrupts(ah, sc->imask);
1154 1159
1155 /* Enable LED */ 1160 /* Enable LED */
1156 ath9k_hw_cfg_output(ah, ATH_LED_PIN, 1161 ath9k_hw_cfg_output(ah, ah->led_pin,
1157 AR_GPIO_OUTPUT_MUX_AS_OUTPUT); 1162 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
1158 ath9k_hw_set_gpio(ah, ATH_LED_PIN, 0); 1163 ath9k_hw_set_gpio(ah, ah->led_pin, 0);
1159 1164
1160 ieee80211_wake_queues(sc->hw); 1165 ieee80211_wake_queues(sc->hw);
1161 ath9k_ps_restore(sc); 1166 ath9k_ps_restore(sc);
@@ -1171,8 +1176,8 @@ void ath_radio_disable(struct ath_softc *sc)
1171 ieee80211_stop_queues(sc->hw); 1176 ieee80211_stop_queues(sc->hw);
1172 1177
1173 /* Disable LED */ 1178 /* Disable LED */
1174 ath9k_hw_set_gpio(ah, ATH_LED_PIN, 1); 1179 ath9k_hw_set_gpio(ah, ah->led_pin, 1);
1175 ath9k_hw_cfg_gpio_input(ah, ATH_LED_PIN); 1180 ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
1176 1181
1177 /* Disable interrupts */ 1182 /* Disable interrupts */
1178 ath9k_hw_set_interrupts(ah, 0); 1183 ath9k_hw_set_interrupts(ah, 0);