mac80211: rt2x00: write registers required for reducing power consumption
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / rt2x00 / 980-rt2x00-reduce-power-consumption-on-mt7620.patch
1 From: Tomislav Požega <pozega.tomislav@gmail.com>
2
3 rt2x00: write registers required for reducing power consumption
4
5 Write registers required for reducing power consumption like the vendor
6 driver does when ADJUST_POWER_CONSUMPTION_SUPPORT is set.
7 This helps devices to sync at better TX/RX rates and improves overall
8 performance.
9
10 Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
11 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 [daniel@makrotopia.org: edited commit message]
13 ---
14 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++++++++++++++
15 1 file changed, 18 insertions(+), 0 deletions(-)
16
17 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
18 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
19 @@ -8717,6 +8717,24 @@ static void rt2800_init_rfcsr_6352(struc
20 rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x02);
21 rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xC7);
22
23 + /* reduce power consumption */
24 + rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x53);
25 + rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x53);
26 + rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x53);
27 + rt2800_rfcsr_write_bank(rt2x00dev, 4, 47, 0x24);
28 + rt2800_rfcsr_write_bank(rt2x00dev, 6, 47, 0x64);
29 + rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0x4F);
30 + rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x02);
31 + rt2800_rfcsr_write_bank(rt2x00dev, 4, 55, 0x24);
32 + rt2800_rfcsr_write_bank(rt2x00dev, 6, 55, 0x64);
33 + rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0x4F);
34 + rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x02);
35 + rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27);
36 + rt2800_rfcsr_write_bank(rt2x00dev, 4, 59, 0x24);
37 + rt2800_rfcsr_write_bank(rt2x00dev, 6, 59, 0x64);
38 + rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0x4F);
39 + rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x02);
40 +
41 /* Initialize RF DC calibration register to default value */
42 rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
43 rt2800_rfcsr_write_dccal(rt2x00dev, 1, 0x00);