diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-03-19 08:55:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-30 14:15:15 -0400 |
commit | 6de66dd963ddd669667a81a2401f2fd6472ff55c (patch) | |
tree | 4ab0cca2a88c388f93c3bfe6af6f022a894af0c5 /drivers/net/wireless/ath/ath9k | |
parent | 6fb1b1e18fe3d141c54182c5d5b3af823bed455f (diff) |
ath9k: add support for overriding LED pin and GPIO settings from platform data
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/gpio.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 8 |
3 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c index 0fb8f8ac275a..44a0a886124d 100644 --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c | |||
@@ -41,12 +41,14 @@ void ath_init_leds(struct ath_softc *sc) | |||
41 | { | 41 | { |
42 | int ret; | 42 | int ret; |
43 | 43 | ||
44 | if (AR_SREV_9287(sc->sc_ah)) | 44 | if (sc->sc_ah->led_pin < 0) { |
45 | sc->sc_ah->led_pin = ATH_LED_PIN_9287; | 45 | if (AR_SREV_9287(sc->sc_ah)) |
46 | else if (AR_SREV_9485(sc->sc_ah)) | 46 | sc->sc_ah->led_pin = ATH_LED_PIN_9287; |
47 | sc->sc_ah->led_pin = ATH_LED_PIN_9485; | 47 | else if (AR_SREV_9485(sc->sc_ah)) |
48 | else | 48 | sc->sc_ah->led_pin = ATH_LED_PIN_9485; |
49 | sc->sc_ah->led_pin = ATH_LED_PIN_DEF; | 49 | else |
50 | sc->sc_ah->led_pin = ATH_LED_PIN_DEF; | ||
51 | } | ||
50 | 52 | ||
51 | /* Configure gpio 1 for output */ | 53 | /* Configure gpio 1 for output */ |
52 | ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin, | 54 | ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin, |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 775c0eb10b95..3d9fc6e391a7 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -798,7 +798,7 @@ struct ath_hw { | |||
798 | u32 originalGain[22]; | 798 | u32 originalGain[22]; |
799 | int initPDADC; | 799 | int initPDADC; |
800 | int PDADCdelta; | 800 | int PDADCdelta; |
801 | u8 led_pin; | 801 | int led_pin; |
802 | u32 gpio_mask; | 802 | u32 gpio_mask; |
803 | u32 gpio_val; | 803 | u32 gpio_val; |
804 | 804 | ||
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index e22e8215d941..cdb0f1c89a0e 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -553,8 +553,14 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
553 | ah->hw_version.subsysid = subsysid; | 553 | ah->hw_version.subsysid = subsysid; |
554 | sc->sc_ah = ah; | 554 | sc->sc_ah = ah; |
555 | 555 | ||
556 | if (!pdata) | 556 | if (!pdata) { |
557 | ah->ah_flags |= AH_USE_EEPROM; | 557 | ah->ah_flags |= AH_USE_EEPROM; |
558 | sc->sc_ah->led_pin = -1; | ||
559 | } else { | ||
560 | sc->sc_ah->gpio_mask = pdata->gpio_mask; | ||
561 | sc->sc_ah->gpio_val = pdata->gpio_val; | ||
562 | sc->sc_ah->led_pin = pdata->led_pin; | ||
563 | } | ||
558 | 564 | ||
559 | common = ath9k_hw_common(ah); | 565 | common = ath9k_hw_common(ah); |
560 | common->ops = &ath9k_common_ops; | 566 | common->ops = &ath9k_common_ops; |