Historical ath9k-devel archives
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH v3 18/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain
Date: Sun, 22 Mar 2015 19:30:03 +0100	[thread overview]
Message-ID: <1427049003-8443-19-git-send-email-linux@rempel-privat.de> (raw)
In-Reply-To: <1427049003-8443-1-git-send-email-linux@rempel-privat.de>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/eeprom_def.c | 34 ++++++++++++-----------------
 1 file 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 0980590..056f516 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,
 				  struct ar5416_eeprom_def *eep,
 				  u8 txRxAttenLocal, int regChainOffset, int i)
 {
+	ENABLE_REG_RMW_BUFFER(ah);
 	if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) {
 		txRxAttenLocal = pModal->txRxAttenCh[i];
 
@@ -483,16 +484,12 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
 			      AR_PHY_GAIN_2GHZ_XATTEN2_DB,
 			      pModal->xatten2Db[i]);
 		} else {
-			REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
-			  (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) &
-			   ~AR_PHY_GAIN_2GHZ_BSW_MARGIN)
-			  | SM(pModal-> bswMargin[i],
-			       AR_PHY_GAIN_2GHZ_BSW_MARGIN));
-			REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
-			  (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) &
-			   ~AR_PHY_GAIN_2GHZ_BSW_ATTEN)
-			  | SM(pModal->bswAtten[i],
-			       AR_PHY_GAIN_2GHZ_BSW_ATTEN));
+			REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
+				SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN),
+				AR_PHY_GAIN_2GHZ_BSW_MARGIN);
+			REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
+				SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN),
+				AR_PHY_GAIN_2GHZ_BSW_ATTEN);
 		}
 	}
 
@@ -504,17 +501,14 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
 		      AR_PHY_RXGAIN + regChainOffset,
 		      AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]);
 	} else {
-		REG_WRITE(ah,
-			  AR_PHY_RXGAIN + regChainOffset,
-			  (REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) &
-			   ~AR_PHY_RXGAIN_TXRX_ATTEN)
-			  | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN));
-		REG_WRITE(ah,
-			  AR_PHY_GAIN_2GHZ + regChainOffset,
-			  (REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) &
-			   ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) |
-			  SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN));
+		REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset,
+			SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN),
+			AR_PHY_RXGAIN_TXRX_ATTEN);
+		REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
+			SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN),
+			AR_PHY_GAIN_2GHZ_RXTX_MARGIN);
 	}
+	REG_RMW_BUFFER_FLUSH(ah);
 }
 
 static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
-- 
1.9.1

  parent reply	other threads:[~2015-03-22 18:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22 18:29 [ath9k-devel] [PATCH v3 00/18] reduce some of ath9k_htc performance problems Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 01/18] ath9k_htc: add new WMI_REG_RMW_CMDID command Oleksij Rempel
2015-03-30  8:32   ` [ath9k-devel] [v3, " Kalle Valo
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 02/18] ath9k: ar9271_hw_pa_cal - use defs instead of magin numbers Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 03/18] ath9k: ar9271_hw_pa_cal: use proper makroses Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 04/18] ath9k: ar9271_hw_pa_cal: use RMW buffer Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 05/18] ath9k: add multi_read to be compatible with ath9k_htc Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 06/18] ath9k: add new function ath9k_hw_read_array Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 07/18] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 08/18] ath9k: use one shot read in ath9k_hw_update_mibstats Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 09/18] ath9k: ath9k_hw_loadnf: use REG_RMW Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 10/18] ath9k: write buffer related optimisation in ar5008_hw_set_channel_regs Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 11/18] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 12/18] ath9k: use rmw buffer in ath9k_hw_set_operating_mode and ath9k_hw_reset Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 13/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-22 18:29 ` [ath9k-devel] [PATCH v3 14/18] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW Oleksij Rempel
2015-03-22 18:30 ` [ath9k-devel] [PATCH v3 15/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-22 18:30 ` [ath9k-devel] [PATCH v3 16/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain Oleksij Rempel
2015-03-22 18:30 ` [ath9k-devel] [PATCH v3 17/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values Oleksij Rempel
2015-03-22 18:30 ` Oleksij Rempel [this message]
2015-03-28 13:54 ` [ath9k-devel] [PATCH v3 00/18] reduce some of ath9k_htc performance problems Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427049003-8443-19-git-send-email-linux@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox