Skip to content

Commit

Permalink
mt76: mt76x2: fix external LNA gain settings
Browse files Browse the repository at this point in the history
Devices with external LNA need different values for AGC registers 8 and 9

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Mar 3, 2019
1 parent 2ed9382 commit d2c6823
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mt76x2/phy.c
Expand Up @@ -260,10 +260,15 @@ mt76x2_phy_set_gain_val(struct mt76x02_dev *dev)
gain_val[0] = dev->cal.agc_gain_cur[0] - dev->cal.agc_gain_adjust;
gain_val[1] = dev->cal.agc_gain_cur[1] - dev->cal.agc_gain_adjust;

if (dev->mt76.chandef.width >= NL80211_CHAN_WIDTH_40)
val = 0x1836 << 16;
if (!mt76x2_has_ext_lna(dev) &&
dev->mt76.chandef.width >= NL80211_CHAN_WIDTH_40)
val = 0x1e42 << 16;
else
val = 0x1836 << 16;

if (mt76x2_has_ext_lna(dev) &&
dev->mt76.chandef.chan->band == NL80211_BAND_2GHZ &&
dev->mt76.chandef.width < NL80211_CHAN_WIDTH_40)
val = 0x0f36 << 16;

val |= 0xf8;

Expand Down

0 comments on commit d2c6823

Please sign in to comment.