aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-09-22 06:34:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-27 15:57:41 -0400
commite17f83eafd37129f9e09425136e59bc4333bdb9c (patch)
tree8cbe188c2968cbbfe628d550106e6c659cf93652 /drivers
parent7a37081e2e25e58701b17c41579fd06bc353b392 (diff)
ath9k_hw: simplify revision checks for AR9285
Since AR9285 v1.0 and v1.1 were never sold (and the initvals removed), its revision checks can be simplified similar to AR9280 Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_calib.c11
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h16
6 files changed, 8 insertions, 37 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 9318ae736982..79dfe9dded52 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -701,7 +701,7 @@ static void ar5008_hw_set_channel_regs(struct ath_hw *ah,
701 u32 phymode; 701 u32 phymode;
702 u32 enableDacFifo = 0; 702 u32 enableDacFifo = 0;
703 703
704 if (AR_SREV_9285_10_OR_LATER(ah)) 704 if (AR_SREV_9285_12_OR_LATER(ah))
705 enableDacFifo = (REG_READ(ah, AR_PHY_TURBO) & 705 enableDacFifo = (REG_READ(ah, AR_PHY_TURBO) &
706 AR_PHY_FC_ENABLE_DAC_FIFO); 706 AR_PHY_FC_ENABLE_DAC_FIFO);
707 707
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index dc64afeeaa12..5d0815145b78 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -567,11 +567,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)
567 AR5416_EEP_TXGAIN_HIGH_POWER) 567 AR5416_EEP_TXGAIN_HIGH_POWER)
568 return; 568 return;
569 569
570 if (AR_SREV_9285_11(ah)) {
571 REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14));
572 udelay(10);
573 }
574
575 for (i = 0; i < ARRAY_SIZE(regList); i++) 570 for (i = 0; i < ARRAY_SIZE(regList); i++)
576 regList[i][1] = REG_READ(ah, regList[i][0]); 571 regList[i][1] = REG_READ(ah, regList[i][0]);
577 572
@@ -651,10 +646,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)
651 REG_WRITE(ah, regList[i][0], regList[i][1]); 646 REG_WRITE(ah, regList[i][0], regList[i][1]);
652 647
653 REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, ccomp_org); 648 REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, ccomp_org);
654
655 if (AR_SREV_9285_11(ah))
656 REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT);
657
658} 649}
659 650
660static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset) 651static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset)
@@ -664,7 +655,7 @@ static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset)
664 ar9271_hw_pa_cal(ah, is_reset); 655 ar9271_hw_pa_cal(ah, is_reset);
665 else 656 else
666 ah->pacal_info.skipcount--; 657 ah->pacal_info.skipcount--;
667 } else if (AR_SREV_9285_11_OR_LATER(ah)) { 658 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
668 if (is_reset || !ah->pacal_info.skipcount) 659 if (is_reset || !ah->pacal_info.skipcount)
669 ar9285_hw_pa_cal(ah, is_reset); 660 ar9285_hw_pa_cal(ah, is_reset);
670 else 661 else
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 677e0c9d0481..d6eed1f02e84 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -909,9 +909,6 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
909 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); 909 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
910 REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, 910 REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
911 AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); 911 AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
912
913 if (AR_SREV_9285_11(ah))
914 REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14));
915} 912}
916 913
917/* 914/*
@@ -1109,9 +1106,6 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
1109 } 1106 }
1110 1107
1111 1108
1112 if (AR_SREV_9285_11(ah))
1113 REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT);
1114
1115 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, 1109 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH,
1116 pModal->switchSettling); 1110 pModal->switchSettling);
1117 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, 1111 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index f2255a211637..1f41b4513c52 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1190,7 +1190,7 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
1190 int count = 50; 1190 int count = 50;
1191 u32 reg; 1191 u32 reg;
1192 1192
1193 if (AR_SREV_9285_10_OR_LATER(ah)) 1193 if (AR_SREV_9285_12_OR_LATER(ah))
1194 return true; 1194 return true;
1195 1195
1196 do { 1196 do {
@@ -1787,7 +1787,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1787 regulatory->current_rd = eeval; 1787 regulatory->current_rd = eeval;
1788 1788
1789 eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1); 1789 eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1);
1790 if (AR_SREV_9285_10_OR_LATER(ah)) 1790 if (AR_SREV_9285_12_OR_LATER(ah))
1791 eeval |= AR9285_RDEXT_DEFAULT; 1791 eeval |= AR9285_RDEXT_DEFAULT;
1792 regulatory->current_rd_ext = eeval; 1792 regulatory->current_rd_ext = eeval;
1793 1793
@@ -1893,7 +1893,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1893 pCap->num_gpio_pins = AR9271_NUM_GPIO; 1893 pCap->num_gpio_pins = AR9271_NUM_GPIO;
1894 else if (AR_DEVID_7010(ah)) 1894 else if (AR_DEVID_7010(ah))
1895 pCap->num_gpio_pins = AR7010_NUM_GPIO; 1895 pCap->num_gpio_pins = AR7010_NUM_GPIO;
1896 else if (AR_SREV_9285_10_OR_LATER(ah)) 1896 else if (AR_SREV_9285_12_OR_LATER(ah))
1897 pCap->num_gpio_pins = AR9285_NUM_GPIO; 1897 pCap->num_gpio_pins = AR9285_NUM_GPIO;
1898 else if (AR_SREV_9280_20_OR_LATER(ah)) 1898 else if (AR_SREV_9280_20_OR_LATER(ah))
1899 pCap->num_gpio_pins = AR928X_NUM_GPIO; 1899 pCap->num_gpio_pins = AR928X_NUM_GPIO;
@@ -2075,7 +2075,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)
2075 return MS_REG_READ(AR9271, gpio) != 0; 2075 return MS_REG_READ(AR9271, gpio) != 0;
2076 else if (AR_SREV_9287_10_OR_LATER(ah)) 2076 else if (AR_SREV_9287_10_OR_LATER(ah))
2077 return MS_REG_READ(AR9287, gpio) != 0; 2077 return MS_REG_READ(AR9287, gpio) != 0;
2078 else if (AR_SREV_9285_10_OR_LATER(ah)) 2078 else if (AR_SREV_9285_12_OR_LATER(ah))
2079 return MS_REG_READ(AR9285, gpio) != 0; 2079 return MS_REG_READ(AR9285, gpio) != 0;
2080 else if (AR_SREV_9280_20_OR_LATER(ah)) 2080 else if (AR_SREV_9280_20_OR_LATER(ah))
2081 return MS_REG_READ(AR928X, gpio) != 0; 2081 return MS_REG_READ(AR928X, gpio) != 0;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 7b6f66bf3739..00140489becb 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -455,7 +455,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
455 rfilt |= ATH9K_RX_FILTER_BEACON; 455 rfilt |= ATH9K_RX_FILTER_BEACON;
456 456
457 if ((AR_SREV_9280_20_OR_LATER(sc->sc_ah) || 457 if ((AR_SREV_9280_20_OR_LATER(sc->sc_ah) ||
458 AR_SREV_9285_10_OR_LATER(sc->sc_ah)) && 458 AR_SREV_9285_12_OR_LATER(sc->sc_ah)) &&
459 (sc->sc_ah->opmode == NL80211_IFTYPE_AP) && 459 (sc->sc_ah->opmode == NL80211_IFTYPE_AP) &&
460 (sc->rx.rxfilter & FIF_PSPOLL)) 460 (sc->rx.rxfilter & FIF_PSPOLL))
461 rfilt |= ATH9K_RX_FILTER_PSPOLL; 461 rfilt |= ATH9K_RX_FILTER_PSPOLL;
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index cabfa0356c9c..7ff814d4a792 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -826,22 +826,8 @@
826 826
827#define AR_SREV_9285(_ah) \ 827#define AR_SREV_9285(_ah) \
828 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285)) 828 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285))
829#define AR_SREV_9285_10_OR_LATER(_ah) \
830 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
831#define AR_SREV_9285_11(_ah) \
832 (AR_SREV_9285(ah) && \
833 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11))
834#define AR_SREV_9285_11_OR_LATER(_ah) \
835 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \
836 (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \
837 AR_SREV_REVISION_9285_11)))
838#define AR_SREV_9285_12(_ah) \
839 (AR_SREV_9285(ah) && \
840 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_12))
841#define AR_SREV_9285_12_OR_LATER(_ah) \ 829#define AR_SREV_9285_12_OR_LATER(_ah) \
842 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \ 830 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
843 (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \
844 AR_SREV_REVISION_9285_12)))
845 831
846#define AR_SREV_9287(_ah) \ 832#define AR_SREV_9287(_ah) \
847 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) 833 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287))