aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ar9002_hw.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-14 11:40:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-15 13:45:08 -0400
commitaa0e5786b6e0cf2adaa26d72770cb5a0ad263026 (patch)
tree82d2228e82bf27b4efc0fee85949d645c6b62fec /drivers/net/wireless/ath/ath9k/ar9002_hw.c
parentc7d36f9fe73ed29760042276295ac42c17849f32 (diff)
ath9k_hw: remove iniModes_*_tx_gain_9271
Program tx gain through iniModesTxGain like on AR9287 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/ar9002_hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 7098cd8eee6..99d2dd979d1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -39,12 +39,6 @@ static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
39 ARRAY_SIZE(ar9271Modes_9271_1_0_only), 5); 39 ARRAY_SIZE(ar9271Modes_9271_1_0_only), 5);
40 INIT_INI_ARRAY(&ah->iniModes_9271_ANI_reg, ar9271Modes_9271_ANI_reg, 40 INIT_INI_ARRAY(&ah->iniModes_9271_ANI_reg, ar9271Modes_9271_ANI_reg,
41 ARRAY_SIZE(ar9271Modes_9271_ANI_reg), 5); 41 ARRAY_SIZE(ar9271Modes_9271_ANI_reg), 5);
42 INIT_INI_ARRAY(&ah->iniModes_high_power_tx_gain_9271,
43 ar9271Modes_high_power_tx_gain_9271,
44 ARRAY_SIZE(ar9271Modes_high_power_tx_gain_9271), 5);
45 INIT_INI_ARRAY(&ah->iniModes_normal_power_tx_gain_9271,
46 ar9271Modes_normal_power_tx_gain_9271,
47 ARRAY_SIZE(ar9271Modes_normal_power_tx_gain_9271), 5);
48 return; 42 return;
49 } 43 }
50 44
@@ -193,14 +187,10 @@ static void ar9280_20_hw_init_rxgain_ini(struct ath_hw *ah)
193 } 187 }
194} 188}
195 189
196static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah) 190static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type)
197{ 191{
198 u32 txgain_type;
199
200 if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >= 192 if (ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) >=
201 AR5416_EEP_MINOR_VER_19) { 193 AR5416_EEP_MINOR_VER_19) {
202 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
203
204 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) 194 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
205 INIT_INI_ARRAY(&ah->iniModesTxGain, 195 INIT_INI_ARRAY(&ah->iniModesTxGain,
206 ar9280Modes_high_power_tx_gain_9280_2, 196 ar9280Modes_high_power_tx_gain_9280_2,
@@ -216,8 +206,22 @@ static void ar9280_20_hw_init_txgain_ini(struct ath_hw *ah)
216 } 206 }
217} 207}
218 208
209static void ar9271_hw_init_txgain_ini(struct ath_hw *ah, u32 txgain_type)
210{
211 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER)
212 INIT_INI_ARRAY(&ah->iniModesTxGain,
213 ar9271Modes_high_power_tx_gain_9271,
214 ARRAY_SIZE(ar9271Modes_high_power_tx_gain_9271), 5);
215 else
216 INIT_INI_ARRAY(&ah->iniModesTxGain,
217 ar9271Modes_normal_power_tx_gain_9271,
218 ARRAY_SIZE(ar9271Modes_normal_power_tx_gain_9271), 5);
219}
220
219static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah) 221static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
220{ 222{
223 u32 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
224
221 if (AR_SREV_9287_11_OR_LATER(ah)) 225 if (AR_SREV_9287_11_OR_LATER(ah))
222 INIT_INI_ARRAY(&ah->iniModesRxGain, 226 INIT_INI_ARRAY(&ah->iniModesRxGain,
223 ar9287Modes_rx_gain_9287_1_1, 227 ar9287Modes_rx_gain_9287_1_1,
@@ -225,15 +229,15 @@ static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
225 else if (AR_SREV_9280_20(ah)) 229 else if (AR_SREV_9280_20(ah))
226 ar9280_20_hw_init_rxgain_ini(ah); 230 ar9280_20_hw_init_rxgain_ini(ah);
227 231
228 if (AR_SREV_9287_11_OR_LATER(ah)) { 232 if (AR_SREV_9271(ah)) {
233 ar9271_hw_init_txgain_ini(ah, txgain_type);
234 } else if (AR_SREV_9287_11_OR_LATER(ah)) {
229 INIT_INI_ARRAY(&ah->iniModesTxGain, 235 INIT_INI_ARRAY(&ah->iniModesTxGain,
230 ar9287Modes_tx_gain_9287_1_1, 236 ar9287Modes_tx_gain_9287_1_1,
231 ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_1), 5); 237 ARRAY_SIZE(ar9287Modes_tx_gain_9287_1_1), 5);
232 } else if (AR_SREV_9280_20(ah)) { 238 } else if (AR_SREV_9280_20(ah)) {
233 ar9280_20_hw_init_txgain_ini(ah); 239 ar9280_20_hw_init_txgain_ini(ah, txgain_type);
234 } else if (AR_SREV_9285_12_OR_LATER(ah)) { 240 } else if (AR_SREV_9285_12_OR_LATER(ah)) {
235 u32 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
236
237 /* txgain table */ 241 /* txgain table */
238 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) { 242 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) {
239 if (AR_SREV_9285E_20(ah)) { 243 if (AR_SREV_9285E_20(ah)) {