ath9k: add a bunch of powersave handling fixes
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 325-ath9k_hw-fix-duplicate-and-partially-wrong-definitio.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Mon, 11 Jul 2016 11:31:39 +0200
3 Subject: [PATCH] ath9k_hw: fix duplicate (and partially wrong) definition
4 of AR_CH0_THERM
5
6 AR_PHY_65NM_CH0_THERM and AR_CH0_THERM were supposed to refer to the
7 same register, however they had different SREV checks.
8
9 Remove the duplicate and use the checks. Since there were other SREV
10 checks present in the only place that uses this, this will probaby not
11 affect runtime behavior.
12
13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 ---
15
16 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
17 +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
18 @@ -689,13 +689,6 @@
19 #define AR_CH0_TOP_XPABIASLVL (AR_SREV_9550(ah) ? 0x3c0 : 0x300)
20 #define AR_CH0_TOP_XPABIASLVL_S (AR_SREV_9550(ah) ? 6 : 8)
21
22 -#define AR_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 : \
23 - ((AR_SREV_9485(ah) ? 0x1628c : 0x16294)))
24 -#define AR_CH0_THERM_XPABIASLVL_MSB 0x3
25 -#define AR_CH0_THERM_XPABIASLVL_MSB_S 0
26 -#define AR_CH0_THERM_XPASHORT2GND 0x4
27 -#define AR_CH0_THERM_XPASHORT2GND_S 2
28 -
29 #define AR_SWITCH_TABLE_COM_ALL (0xffff)
30 #define AR_SWITCH_TABLE_COM_ALL_S (0)
31 #define AR_SWITCH_TABLE_COM_AR9462_ALL (0xffffff)
32 @@ -712,15 +705,17 @@
33 #define AR_SWITCH_TABLE_ALL (0xfff)
34 #define AR_SWITCH_TABLE_ALL_S (0)
35
36 -#define AR_PHY_65NM_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\
37 - ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16294 : 0x1628c))
38 +#define AR_CH0_THERM (AR_SREV_9300(ah) ? 0x16290 :\
39 + ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16294 : 0x1628c))
40 +#define AR_CH0_THERM_XPABIASLVL_MSB 0x3
41 +#define AR_CH0_THERM_XPABIASLVL_MSB_S 0
42 +#define AR_CH0_THERM_XPASHORT2GND 0x4
43 +#define AR_CH0_THERM_XPASHORT2GND_S 2
44
45 -#define AR_PHY_65NM_CH0_THERM_LOCAL 0x80000000
46 -#define AR_PHY_65NM_CH0_THERM_LOCAL_S 31
47 -#define AR_PHY_65NM_CH0_THERM_START 0x20000000
48 -#define AR_PHY_65NM_CH0_THERM_START_S 29
49 -#define AR_PHY_65NM_CH0_THERM_SAR_ADC_OUT 0x0000ff00
50 -#define AR_PHY_65NM_CH0_THERM_SAR_ADC_OUT_S 8
51 +#define AR_CH0_THERM_LOCAL 0x80000000
52 +#define AR_CH0_THERM_START 0x20000000
53 +#define AR_CH0_THERM_SAR_ADC_OUT 0x0000ff00
54 +#define AR_CH0_THERM_SAR_ADC_OUT_S 8
55
56 #define AR_CH0_TOP2 (AR_SREV_9300(ah) ? 0x1628c : \
57 (AR_SREV_9462(ah) ? 0x16290 : 0x16284))