diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2018-11-01 16:35:02 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-11-30 12:21:43 +0100 |
commit | 4784a3cc3fffd0ba5ef6c7a23980ae0318fc1369 (patch) | |
tree | f72f58ecaa8b7bf8dafe054e160baf9121c7be8f /drivers/net/wireless/mediatek/mt76/mt76x2 | |
parent | f1b8ee35fec4a070b7760a99709fc98f237c2b86 (diff) | |
download | blackbird-op-linux-4784a3cc3fffd0ba5ef6c7a23980ae0318fc1369.tar.gz blackbird-op-linux-4784a3cc3fffd0ba5ef6c7a23980ae0318fc1369.zip |
mt76x02: assure we update gain after scan
Assure that after we initialize dev->cal.low_gain to -1 this
will cause update gain calibration. Otherwise this might or
might not happen depending on value of second bit of low_gain
and values read from registers in mt76x02_phy_adjust_vga_gain().
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x2')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x2/phy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c index bbeff9c19997..1b85fb415548 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/phy.c @@ -289,7 +289,8 @@ void mt76x2_phy_update_channel_gain(struct mt76x02_dev *dev) low_gain = (dev->cal.avg_rssi_all > mt76x02_get_rssi_gain_thresh(dev)) + (dev->cal.avg_rssi_all > mt76x02_get_low_rssi_gain_thresh(dev)); - gain_change = (dev->cal.low_gain & 2) ^ (low_gain & 2); + gain_change = dev->cal.low_gain < 0 || + (dev->cal.low_gain & 2) ^ (low_gain & 2); dev->cal.low_gain = low_gain; if (!gain_change) { |