diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-04-14 12:17:34 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-04-14 12:17:34 +0000 |
commit | cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d (patch) | |
tree | 580c994a8d121e191f2de5383c8de7ea84afb665 /package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch | |
parent | 054044ff91891723025a6b35bd583c98e141ea3d (diff) | |
download | upstream-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.tar.gz upstream-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.tar.bz2 upstream-cd59cb2a4004c0a4bd13ded3c0ee7abf850fda7d.zip |
mac80211: merge a number of upstream driver fixes/improvements
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45432 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch')
-rw-r--r-- | package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch b/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch new file mode 100644 index 0000000000..c4dd1af187 --- /dev/null +++ b/package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch @@ -0,0 +1,89 @@ +From: Oleksij Rempel <linux@rempel-privat.de> +Date: Sun, 22 Mar 2015 19:29:47 +0100 +Subject: [PATCH] ath9k: ar9271_hw_pa_cal - use defs instead of magin + numbers + +This function uses mixed styles for register names/numbers which +is make harder reading and optimisation. + +Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + +--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c ++++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c +@@ -430,22 +430,22 @@ static void ar9271_hw_pa_cal(struct ath_ + u32 regVal; + unsigned int i; + u32 regList[][2] = { +- { 0x786c, 0 }, +- { 0x7854, 0 }, +- { 0x7820, 0 }, +- { 0x7824, 0 }, +- { 0x7868, 0 }, +- { 0x783c, 0 }, +- { 0x7838, 0 } , +- { 0x7828, 0 } , ++ { AR9285_AN_TOP3, 0 }, ++ { AR9285_AN_RXTXBB1, 0 }, ++ { AR9285_AN_RF2G1, 0 }, ++ { AR9285_AN_RF2G2, 0 }, ++ { AR9285_AN_TOP2, 0 }, ++ { AR9285_AN_RF2G8, 0 }, ++ { AR9285_AN_RF2G7, 0 } , ++ { AR9285_AN_RF2G3, 0 } , + }; + + for (i = 0; i < ARRAY_SIZE(regList); i++) + regList[i][1] = REG_READ(ah, regList[i][0]); + +- regVal = REG_READ(ah, 0x7834); ++ regVal = REG_READ(ah, AR9285_AN_RF2G6); + regVal &= (~(0x1)); +- REG_WRITE(ah, 0x7834, regVal); ++ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); + regVal = REG_READ(ah, 0x9808); + regVal |= (0x1 << 27); + REG_WRITE(ah, 0x9808, regVal); +@@ -477,7 +477,7 @@ static void ar9271_hw_pa_cal(struct ath_ + * does not matter since we turn it off + */ + REG_RMW_FIELD(ah, AR9285_AN_RF2G7, AR9285_AN_RF2G7_PADRVGN2TAB0, 0); +- ++ /* 7828, b0-11, ccom=fff */ + REG_RMW_FIELD(ah, AR9285_AN_RF2G3, AR9271_AN_RF2G3_CCOMP, 0xfff); + + /* Set: +@@ -490,15 +490,16 @@ static void ar9271_hw_pa_cal(struct ath_ + + /* find off_6_1; */ + for (i = 6; i > 0; i--) { +- regVal = REG_READ(ah, 0x7834); ++ regVal = REG_READ(ah, AR9285_AN_RF2G6); + regVal |= (1 << (20 + i)); +- REG_WRITE(ah, 0x7834, regVal); ++ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); + udelay(1); + /* regVal = REG_READ(ah, 0x7834); */ + regVal &= (~(0x1 << (20 + i))); +- regVal |= (MS(REG_READ(ah, 0x7840), AR9285_AN_RXTXBB1_SPARE9) ++ regVal |= (MS(REG_READ(ah, AR9285_AN_RF2G9), ++ AR9285_AN_RXTXBB1_SPARE9) + << (20 + i)); +- REG_WRITE(ah, 0x7834, regVal); ++ REG_WRITE(ah, AR9285_AN_RF2G6, regVal); + } + + regVal = (regVal >> 20) & 0x7f; +@@ -517,9 +518,9 @@ static void ar9271_hw_pa_cal(struct ath_ + + ENABLE_REGWRITE_BUFFER(ah); + +- regVal = REG_READ(ah, 0x7834); ++ regVal = REG_READ(ah, AR_AN_RF2G1_CH1); + regVal |= 0x1; +- REG_WRITE(ah, 0x7834, regVal); ++ REG_WRITE(ah, AR_AN_RF2G1_CH1, regVal); + regVal = REG_READ(ah, 0x9808); + regVal &= (~(0x1 << 27)); + REG_WRITE(ah, 0x9808, regVal); |