From b5073ca2c859fe8763a0717abcfb5f5646d5a543 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 14 Apr 2015 12:17:34 +0000 Subject: mac80211: merge a number of upstream driver fixes/improvements Signed-off-by: Felix Fietkau SVN-Revision: 45432 --- ...1_hw_pa_cal-use-defs-instead-of-magin-num.patch | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch (limited to 'package/kernel/mac80211/patches/320-ath9k-ar9271_hw_pa_cal-use-defs-instead-of-magin-num.patch') 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 +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 +Signed-off-by: Kalle Valo +--- + +--- 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); -- cgit v1.2.3