rt2800: 5592: add AGC init
authorStanislaw Gruszka <stf_xl@wp.pl>
Sat, 16 Mar 2013 18:19:48 +0000 (19:19 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 18 Mar 2013 20:38:34 +0000 (16:38 -0400)
Based on:
RT5592_RTMPAGCInit()

from:
DPO_RT5572_LinuxSTA_2.6.1.3_20121022/chips/rt5592.c

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c

index 9fa10b0359685cc98a6df6d6f011658bd24f3b63..f2446ded2a04038dc561bde8775ee1a968bfd39a 100644 (file)
@@ -2658,7 +2658,10 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
                rt2800_bbp_write(rt2x00dev, 195, 141);
                rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a);
 
-               /* TODO AGC adjust */
+               /* AGC init */
+               reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain;
+               rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
+
                rt2800_iq_calibrate(rt2x00dev, rf->channel);
        }