diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 14:55:53 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 14:55:53 +0000 |
commit | 4f69a1b3292fcb51a22234af014d11191c456852 (patch) | |
tree | d7632afb57d76212386126584cef9bf85be8e268 /package/mac80211/patches/409-ath9k_platform_settings.patch | |
parent | 65bb54b1e58cdcfdabbe8cd531cb1af13e3fe115 (diff) |
ar71xx: improve the wndr3700 quirks - move most of the code out of ath9k and instead allow the platform device to specify gpio overrides - fixes 5ghz signal strength issues
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23822 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/409-ath9k_platform_settings.patch')
-rw-r--r-- | package/mac80211/patches/409-ath9k_platform_settings.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/package/mac80211/patches/409-ath9k_platform_settings.patch b/package/mac80211/patches/409-ath9k_platform_settings.patch new file mode 100644 index 000000000..3355d955a --- /dev/null +++ b/package/mac80211/patches/409-ath9k_platform_settings.patch @@ -0,0 +1,69 @@ +--- a/drivers/net/wireless/ath/ath9k/init.c ++++ b/drivers/net/wireless/ath/ath9k/init.c +@@ -16,6 +16,7 @@ + + #include <linux/slab.h> + ++#include "linux/ath9k_platform.h" + #include "ath9k.h" + + static char *dev_info = "ath9k"; +@@ -572,8 +573,14 @@ static int ath9k_init_softc(u16 devid, s + sc->sc_ah = ah; + + pdata = (struct ath9k_platform_data *) sc->dev->platform_data; +- if (!pdata) ++ if (!pdata) { + ah->ah_flags |= AH_USE_EEPROM; ++ sc->sc_ah->led_pin = -1; ++ } else { ++ sc->sc_ah->gpio_mask = pdata->gpio_mask; ++ sc->sc_ah->gpio_val = pdata->gpio_val; ++ sc->sc_ah->led_pin = pdata->led_pin; ++ } + + common = ath9k_hw_common(ah); + common->ops = &ath9k_common_ops; +--- a/drivers/net/wireless/ath/ath9k/hw.h ++++ b/drivers/net/wireless/ath/ath9k/hw.h +@@ -742,7 +742,7 @@ struct ath_hw { + u32 originalGain[22]; + int initPDADC; + int PDADCdelta; +- u8 led_pin; ++ int led_pin; + u32 gpio_mask; + u32 gpio_val; + +--- a/drivers/net/wireless/ath/ath9k/gpio.c ++++ b/drivers/net/wireless/ath/ath9k/gpio.c +@@ -147,10 +147,12 @@ void ath_init_leds(struct ath_softc *sc) + if (AR_SREV_9100(sc->sc_ah)) + return; + +- 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; ++ if (sc->sc_ah->led_pin < 0) { ++ 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, sc->sc_ah->led_pin, +--- a/include/linux/ath9k_platform.h ++++ b/include/linux/ath9k_platform.h +@@ -24,6 +24,10 @@ + struct ath9k_platform_data { + u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; + u8 *macaddr; ++ ++ int led_pin; ++ u32 gpio_mask; ++ u32 gpio_val; + }; + + #endif /* _LINUX_ATH9K_PLATFORM_H */ |