bcm63xx: Add support for the T-Com Speedport W 500V.
[openwrt.git] / package / mac80211 / patches / 409-ath9k_platform_settings.patch
1 --- a/drivers/net/wireless/ath/ath9k/init.c
2 +++ b/drivers/net/wireless/ath/ath9k/init.c
3 @@ -535,8 +535,15 @@ static int ath9k_init_softc(u16 devid, s
4 ah->hw_version.subsysid = subsysid;
5 sc->sc_ah = ah;
6
7 - if (!sc->dev->platform_data)
8 + if (!sc->dev->platform_data) {
9 ah->ah_flags |= AH_USE_EEPROM;
10 + sc->sc_ah->led_pin = -1;
11 + } else {
12 + pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
13 + sc->sc_ah->gpio_mask = pdata->gpio_mask;
14 + sc->sc_ah->gpio_val = pdata->gpio_val;
15 + sc->sc_ah->led_pin = pdata->led_pin;
16 + }
17
18 common = ath9k_hw_common(ah);
19 common->ops = &ath9k_common_ops;
20 --- a/drivers/net/wireless/ath/ath9k/hw.h
21 +++ b/drivers/net/wireless/ath/ath9k/hw.h
22 @@ -788,7 +788,7 @@ struct ath_hw {
23 u32 originalGain[22];
24 int initPDADC;
25 int PDADCdelta;
26 - u8 led_pin;
27 + int led_pin;
28 u32 gpio_mask;
29 u32 gpio_val;
30
31 --- a/drivers/net/wireless/ath/ath9k/gpio.c
32 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
33 @@ -147,10 +147,12 @@ void ath_init_leds(struct ath_softc *sc)
34 if (AR_SREV_9100(sc->sc_ah))
35 return;
36
37 - if (AR_SREV_9287(sc->sc_ah))
38 - sc->sc_ah->led_pin = ATH_LED_PIN_9287;
39 - else
40 - sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
41 + if (sc->sc_ah->led_pin < 0) {
42 + if (AR_SREV_9287(sc->sc_ah))
43 + sc->sc_ah->led_pin = ATH_LED_PIN_9287;
44 + else
45 + sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
46 + }
47
48 /* Configure gpio 1 for output */
49 ath9k_hw_cfg_output(sc->sc_ah, sc->sc_ah->led_pin,
50 --- a/include/linux/ath9k_platform.h
51 +++ b/include/linux/ath9k_platform.h
52 @@ -24,6 +24,10 @@
53 struct ath9k_platform_data {
54 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
55 u8 *macaddr;
56 +
57 + int led_pin;
58 + u32 gpio_mask;
59 + u32 gpio_val;
60 };
61
62 #endif /* _LINUX_ATH9K_PLATFORM_H */
This page took 0.04264 seconds and 5 git commands to generate.