diff options
author | Daniel Golle <daniel@makrotopia.org> | 2017-04-24 01:38:07 +0200 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2017-04-24 16:33:34 +0200 |
commit | 3d71d1d9a98f55659acbfb8434406636310cb54b (patch) | |
tree | f5acdc6047ebe9fff2d841b4a65ceda5536bf9dd /package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch | |
parent | da352c46235a69d333277b52c1d98fe334b94d9f (diff) | |
download | upstream-3d71d1d9a98f55659acbfb8434406636310cb54b.tar.gz upstream-3d71d1d9a98f55659acbfb8434406636310cb54b.tar.bz2 upstream-3d71d1d9a98f55659acbfb8434406636310cb54b.zip |
mac80211: rt2x00: reorder patches and prepare for MT7620 external PA
Import change to make external PA capability consistent with the
vendor driver instead of having the logic inverted.
While at it, apply patches in the same order as they got merged
upstream.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch')
-rw-r--r-- | package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch b/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch new file mode 100644 index 0000000000..3270ea2c56 --- /dev/null +++ b/package/kernel/mac80211/patches/020-21-rt2800-fix-LNA-gain-assignment-for-MT7620.patch @@ -0,0 +1,54 @@ +From 0109238d62a99ea779a7e28e21868118e7b8d69d Mon Sep 17 00:00:00 2001 +From: Daniel Golle <daniel@makrotopia.org> +Date: Mon, 10 Apr 2017 14:28:14 +0200 +Subject: [PATCH 1/2] rt2800: fix LNA gain assignment for MT7620 +To: Stanislaw Gruszka <sgruszka@redhat.com> +Cc: Helmut Schaa <helmut.schaa@googlemail.com>, + linux-wireless@vger.kernel.org, + Kalle Valo <kvalo@codeaurora.org> + +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> +--- + drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +index ba06ac2d876d..7135519a638c 100644 +--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -3806,11 +3806,25 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, + } + + if (rt2x00_rt(rt2x00dev, RT5592) || rt2x00_rt(rt2x00dev, RT6352)) { ++ reg = 0x10; ++ if (!conf_is_ht40(conf)) { ++ if (rt2x00_rt(rt2x00dev, RT6352) && ++ rt2x00_has_cap_external_lna_bg(rt2x00dev)) { ++ reg |= 0x5; ++ } else { ++ reg |= 0xa; ++ } ++ } + rt2800_bbp_write(rt2x00dev, 195, 141); +- rt2800_bbp_write(rt2x00dev, 196, conf_is_ht40(conf) ? 0x10 : 0x1a); ++ rt2800_bbp_write(rt2x00dev, 196, reg); + + /* AGC init */ +- reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2 * rt2x00dev->lna_gain; ++ if (rt2x00_rt(rt2x00dev, RT6352)) ++ reg = 0x04; ++ else ++ reg = rf->channel <= 14 ? 0x1c : 0x24; ++ ++ reg += 2 * rt2x00dev->lna_gain; + rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg); + + rt2800_iq_calibrate(rt2x00dev, rf->channel); +-- +2.12.2 + |