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>
This commit is contained in:
parent
ad10e0d650
commit
2dfc0247f0
|
@ -772,15 +772,14 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
|
||||||
struct ar5416_eeprom_4k *eep,
|
struct ar5416_eeprom_4k *eep,
|
||||||
u8 txRxAttenLocal)
|
u8 txRxAttenLocal)
|
||||||
{
|
{
|
||||||
REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0,
|
ENABLE_REG_RMW_BUFFER(ah);
|
||||||
pModal->antCtrlChain[0]);
|
REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0,
|
||||||
|
pModal->antCtrlChain[0], 0);
|
||||||
|
|
||||||
REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0),
|
REG_RMW(ah, AR_PHY_TIMING_CTRL4(0),
|
||||||
(REG_READ(ah, AR_PHY_TIMING_CTRL4(0)) &
|
|
||||||
~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF |
|
|
||||||
AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) |
|
|
||||||
SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
|
SM(pModal->iqCalICh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
|
||||||
SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF));
|
SM(pModal->iqCalQCh[0], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF),
|
||||||
|
AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF);
|
||||||
|
|
||||||
if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >=
|
if ((eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) >=
|
||||||
AR5416_EEP_MINOR_VER_3) {
|
AR5416_EEP_MINOR_VER_3) {
|
||||||
|
@ -819,6 +818,7 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
|
||||||
AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
|
AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
|
||||||
REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
|
REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
|
||||||
AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
|
AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
|
||||||
|
REG_RMW_BUFFER_FLUSH(ah);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue