diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2015-03-22 14:30:01 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-03-30 04:31:39 -0400 |
commit | 2dfc0247f0ff755296ab72ab3ddb8309fb35c660 (patch) | |
tree | 5a16625cca80546555b2ac53ede0d10e1402483f | |
parent | ad10e0d65030d39c218e96f7e5269b301913b477 (diff) |
ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain
it is possible to reduce time needed for this function
by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands
in same buffer.
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_4k.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c index 291c1d14403c..38dc965605d8 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c | |||
@@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah, | |||
772 | struct ar5416_eeprom_4k *eep, | 772 | struct ar5416_eeprom_4k *eep, |
773 | u8 txRxAttenLocal) | 773 | u8 txRxAttenLocal) |
774 | { | 774 | { |
775 | REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0, | 775 | ENABLE_REG_RMW_BUFFER(ah); |
776 | pModal->antCtrlChain[0]); | 776 | REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, |
777 | pModal->antCtrlChain[0], 0); | ||
777 | 778 | ||
778 | REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0), | 779 | REG_RMW(ah, AR_PHY_TIMING_CTRL4(0), |
779 | (REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) & | 780 | SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | |
780 | ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | | 781 | SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF), |
781 | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | | 782 | AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF); |
782 | SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | | ||
783 | SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); | ||
784 | 783 | ||
785 | if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= | 784 | if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >= |
786 | AR5416_EEP_MINOR_VER_3) { | 785 | AR5416_EEP_MINOR_VER_3) { |
@@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah, | |||
819 | AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); | 818 | AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); |
820 | REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, | 819 | REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, |
821 | AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); | 820 | AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); |
821 | REG_RMW_BUFFER_FLUSH(ah); | ||
822 | } | 822 | } |
823 | 823 | ||
824 | /* | 824 | /* |