aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2015-03-22 14:30:03 -0400
committerKalle Valo <kvalo@codeaurora.org>2015-03-30 04:31:43 -0400
commiteaa4059d56fdbeb1633c94e82d54849688d96777 (patch)
tree9bb0d5966026fec4410845f1a1be89aa1446b02c
parentb1c1a26461a79a289e08d0c04bf8520e305bf05d (diff)
ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 098059039351..056f516bf017 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -466,6 +466,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
466 struct ar5416_eeprom_def *eep, 466 struct ar5416_eeprom_def *eep,
467 u8 txRxAttenLocal, int regChainOffset, int i) 467 u8 txRxAttenLocal, int regChainOffset, int i)
468{ 468{
469 ENABLE_REG_RMW_BUFFER(ah);
469 if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { 470 if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) {
470 txRxAttenLocal = pModal->txRxAttenCh[i]; 471 txRxAttenLocal = pModal->txRxAttenCh[i];
471 472
@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
483 AR_PHY_GAIN_2GHZ_XATTEN2_DB, 484 AR_PHY_GAIN_2GHZ_XATTEN2_DB,
484 pModal->xatten2Db[i]); 485 pModal->xatten2Db[i]);
485 } else { 486 } else {
486 REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, 487 REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
487 (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & 488 SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN),
488 ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) 489 AR_PHY_GAIN_2GHZ_BSW_MARGIN);
489 | SM(pModal-> bswMargin[i], 490 REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
490 AR_PHY_GAIN_2GHZ_BSW_MARGIN)); 491 SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN),
491 REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, 492 AR_PHY_GAIN_2GHZ_BSW_ATTEN);
492 (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) &
493 ~AR_PHY_GAIN_2GHZ_BSW_ATTEN)
494 | SM(pModal->bswAtten[i],
495 AR_PHY_GAIN_2GHZ_BSW_ATTEN));
496 } 493 }
497 } 494 }
498 495
@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
504 AR_PHY_RXGAIN + regChainOffset, 501 AR_PHY_RXGAIN + regChainOffset,
505 AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]); 502 AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]);
506 } else { 503 } else {
507 REG_WRITE(ah, 504 REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset,
508 AR_PHY_RXGAIN + regChainOffset, 505 SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN),
509 (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & 506 AR_PHY_RXGAIN_TXRX_ATTEN);
510 ~AR_PHY_RXGAIN_TXRX_ATTEN) 507 REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
511 | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); 508 SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN),
512 REG_WRITE(ah, 509 AR_PHY_GAIN_2GHZ_RXTX_MARGIN);
513 AR_PHY_GAIN_2GHZ + regChainOffset,
514 (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) &
515 ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) |
516 SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN));
517 } 510 }
511 REG_RMW_BUFFER_FLUSH(ah);
518} 512}
519 513
520static void ath9k_hw_def_set_board_values(struct ath_hw *ah, 514static void ath9k_hw_def_set_board_values(struct ath_hw *ah,