Skip to content

Commit 225a644

Browse files
dangowrtKalle Valo
authored andcommitted
rt2800: fix LNA gain assignment for MT7620
The base value used for MT7620 differs from Rt5392 which resulted in quite bad RX signal quality. Fix this by using the correct base value as well as the LNA calibration values for HT20. Reported-by: Tom Psyborg <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent 0b16e0e commit 225a644

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

drivers/net/wireless/ralink/rt2x00/rt2800lib.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,11 +3806,25 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
38063806
}
38073807

38083808
if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) {
3809+
reg = 0x10;
3810+
if (!conf_is_ht40(conf)) {
3811+
if (rt2x00_rt(rt2x00dev, RT6352) &&
3812+
rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
3813+
reg |= 0x5;
3814+
} else {
3815+
reg |= 0xa;
3816+
}
3817+
}
38093818
rt2800_bbp_write(rt2x00dev, 195, 141);
3810-
rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a);
3819+
rt2800_bbp_write(rt2x00dev, 196, reg);
38113820

38123821
/* AGC init */
3813-
reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain;
3822+
if (rt2x00_rt(rt2x00dev, RT6352))
3823+
reg = 0x04;
3824+
else
3825+
reg = rf->channel <= 14 ? 0x1c : 0x24;
3826+
3827+
reg += 2 * rt2x00dev->lna_gain;
38143828
rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
38153829

38163830
rt2800_iq_calibrate(rt2x00dev, rf->channel);

0 commit comments

Comments
 (0)