aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-04 16:07:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-10 13:49:28 -0400
commit733aec6a5bd39ba34ddd0568b7f7394aec2541fb (patch)
tree5420bcbfc5ef5ba038a60b00d87db0c615871d46 /drivers/net/wireless/rt2x00
parent271f1a4d70c34ff1ff7a9e3b1fd56068757f24b1 (diff)
rt2x00: rt2800lib: fix default VGC values for RT3572 for the 5GHz band
The rt2x00 driver uses 0x22 as a default VGC value in VGC adjustment for the RT3572 chipset. In the Ralink DPO_RT5572_LinuxSTA_2.6.1.3_20121022 driver, this value is only used for initialization. During VGC adjustment, the reference driver uses different values. Update the 'rt2800_get_default_vgc' function to synchronize the values with the reference driver. Also add the missing AGC initialization code into the 'rt2800_config_channel' function. References: RT35xx_SetAGCInitValue in chip/rt35xx.c RT35xx_ChipAGCAdjust in chip/rt35xx.c Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 47ef81ba605d..3ea1b96204fa 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3310,9 +3310,18 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
3310 3310
3311 rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin); 3311 rt2800_register_write(rt2x00dev, TX_PIN_CFG, tx_pin);
3312 3312
3313 if (rt2x00_rt(rt2x00dev, RT3572)) 3313 if (rt2x00_rt(rt2x00dev, RT3572)) {
3314 rt2800_rfcsr_write(rt2x00dev, 8, 0x80); 3314 rt2800_rfcsr_write(rt2x00dev, 8, 0x80);
3315 3315
3316 /* AGC init */
3317 if (rf->channel <= 14)
3318 reg = 0x1c + (2 * rt2x00dev->lna_gain);
3319 else
3320 reg = 0x22 + ((rt2x00dev->lna_gain * 5) / 3);
3321
3322 rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
3323 }
3324
3316 if (rt2x00_rt(rt2x00dev, RT3593)) { 3325 if (rt2x00_rt(rt2x00dev, RT3593)) {
3317 rt2800_register_read(rt2x00dev, GPIO_CTRL, &reg); 3326 rt2800_register_read(rt2x00dev, GPIO_CTRL, &reg);
3318 3327
@@ -4421,9 +4430,7 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev)
4421 else 4430 else
4422 vgc = 0x2e + rt2x00dev->lna_gain; 4431 vgc = 0x2e + rt2x00dev->lna_gain;
4423 } else { /* 5GHZ band */ 4432 } else { /* 5GHZ band */
4424 if (rt2x00_rt(rt2x00dev, RT3572)) 4433 if (rt2x00_rt(rt2x00dev, RT3593))
4425 vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3;
4426 else if (rt2x00_rt(rt2x00dev, RT3593))
4427 vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3; 4434 vgc = 0x20 + (rt2x00dev->lna_gain * 5) / 3;
4428 else if (rt2x00_rt(rt2x00dev, RT5592)) 4435 else if (rt2x00_rt(rt2x00dev, RT5592))
4429 vgc = 0x24 + (2 * rt2x00dev->lna_gain); 4436 vgc = 0x24 + (2 * rt2x00dev->lna_gain);