Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159718
b: refs/heads/master
c: 08fc5c1
h: refs/heads/master
v: v3
  • Loading branch information
Vivek Natarajan authored and John W. Linville committed Aug 20, 2009
1 parent 1a069c2 commit bb89cb6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d340b1f0e5e374fc902a020cb6ef9ebd7fb9f368
refs/heads/master: 08fc5c1ba026de0904aeeba9785f95f6603d58f7
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ struct ath_ani {
/* LED Control */
/********************/

#define ATH_LED_PIN 1
#define ATH_LED_PIN_DEF 1
#define ATH_LED_PIN_9287 8
#define ATH_LED_ON_DURATION_IDLE 350 /* in msecs */
#define ATH_LED_OFF_DURATION_IDLE 250 /* in msecs */

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ struct ath_hw {
u32 originalGain[22];
int initPDADC;
int PDADCdelta;
u8 led_pin;

struct ar5416IniArray iniModes;
struct ar5416IniArray iniCommon;
Expand Down
27 changes: 16 additions & 11 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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++;
Expand Down Expand Up @@ -1062,19 +1062,24 @@ 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)
{
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);

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/ath/ath9k/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int ath_pci_suspend(struct pci_dev *pdev, pm_message_t state)
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;

ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1);
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);

pci_save_state(pdev);
pci_disable_device(pdev);
Expand Down Expand Up @@ -269,9 +269,9 @@ static int ath_pci_resume(struct pci_dev *pdev)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);

/* Enable LED */
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);
ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 1);
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);

return 0;
}
Expand Down

0 comments on commit bb89cb6

Please sign in to comment.