From: Oleksij Rempel <linux@rempel-privat.de>
To: linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
ath9k-devel@lists.ath9k.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH v2 09/18] ath9k: ath9k_hw_loadnf: use REG_RMW
Date: Sat, 21 Mar 2015 09:47:12 +0100 [thread overview]
Message-ID: <1426927641-18474-10-git-send-email-linux@rempel-privat.de> (raw)
In-Reply-To: <1426927641-18474-1-git-send-email-linux@rempel-privat.de>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
drivers/net/wireless/ath/ath9k/calib.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index e200a6e..3e2e24e 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -238,7 +238,6 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
{
struct ath9k_nfcal_hist *h = NULL;
unsigned i, j;
- int32_t val;
u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask;
struct ath_common *common = ath9k_hw_common(ah);
s16 default_nf = ath9k_hw_get_default_nf(ah, chan);
@@ -246,6 +245,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
if (ah->caldata)
h = ah->caldata->nfCalHist;
+ ENABLE_REG_RMW_BUFFER(ah);
for (i = 0; i < NUM_NF_READINGS; i++) {
if (chainmask & (1 << i)) {
s16 nfval;
@@ -258,10 +258,8 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
else
nfval = default_nf;
- val = REG_READ(ah, ah->nf_regs[i]);
- val &= 0xFFFFFE00;
- val |= (((u32) nfval << 1) & 0x1ff);
- REG_WRITE(ah, ah->nf_regs[i], val);
+ REG_RMW(ah, ah->nf_regs[i],
+ (((u32) nfval << 1) & 0x1ff), 0x1ff);
}
}
@@ -274,6 +272,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL,
AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
+ REG_RMW_BUFFER_FLUSH(ah);
/*
* Wait for load to complete, should be fast, a few 10s of us.
@@ -309,19 +308,17 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
* by the median we just loaded. This will be initial (and max) value
* of next noise floor calibration the baseband does.
*/
- ENABLE_REGWRITE_BUFFER(ah);
+ ENABLE_REG_RMW_BUFFER(ah);
for (i = 0; i < NUM_NF_READINGS; i++) {
if (chainmask & (1 << i)) {
if ((i >= AR5416_MAX_CHAINS) && !IS_CHAN_HT40(chan))
continue;
- val = REG_READ(ah, ah->nf_regs[i]);
- val &= 0xFFFFFE00;
- val |= (((u32) (-50) << 1) & 0x1ff);
- REG_WRITE(ah, ah->nf_regs[i], val);
+ REG_RMW(ah, ah->nf_regs[i],
+ (((u32) (-50) << 1) & 0x1ff), 0x1ff);
}
}
- REGWRITE_BUFFER_FLUSH(ah);
+ REG_RMW_BUFFER_FLUSH(ah);
return 0;
}
--
1.9.1
next prev parent reply other threads:[~2015-03-21 8:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-21 8:47 [PATCH v2 00/18] reduce some of ath9k_htc performance problems Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 01/18] ath9k_htc: add new WMI_REG_RMW_CMDID command Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 02/18] ath9k: ar9271_hw_pa_cal - use defs instead of magin numbers Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 03/18] ath9k: ar9271_hw_pa_cal: use proper makroses Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 04/18] ath9k: ar9271_hw_pa_cal: use RMW buffer Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 05/18] ath9k: add multi_read to be compatible with ath9k_htc Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 06/18] ath9k: add new function ath9k_hw_read_array Oleksij Rempel
2015-03-21 10:04 ` Marc Kleine-Budde
2015-03-21 8:47 ` [PATCH v2 07/18] ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 08/18] ath9k: use one shot read in ath9k_hw_update_mibstats Oleksij Rempel
2015-03-21 8:47 ` Oleksij Rempel [this message]
2015-03-21 8:47 ` [PATCH v2 10/18] ath9k: write buffer related optimisation in ar5008_hw_set_channel_regs Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 11/18] ath9k: ath9k_hw_set_4k_power_cal_tabl: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 12/18] ath9k: use rmw buffer in ath9k_hw_set_operating_mode and ath9k_hw_reset Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 13/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 14/18] ath9k: ath9k_hw_analog_shift_rmw: use REG_RMW Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 15/18] ath9k: ath9k_hw_4k_set_board_values: use rmw buffer Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 16/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 17/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values Oleksij Rempel
2015-03-21 8:47 ` [PATCH v2 18/18] ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain 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=1426927641-18474-10-git-send-email-linux@rempel-privat.de \
--to=linux@rempel-privat.de \
--cc=ath9k-devel@lists.ath9k.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).