summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2018-11-01 16:35:02 +0100
committerFelix Fietkau <nbd@nbd.name>2018-11-30 12:21:43 +0100
commit4784a3cc3fffd0ba5ef6c7a23980ae0318fc1369 (patch)
treef72f58ecaa8b7bf8dafe054e160baf9121c7be8f /drivers/net/wireless/mediatek/mt76/mt76x02_util.c
parentf1b8ee35fec4a070b7760a99709fc98f237c2b86 (diff)
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/mt76x02_util.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index 8a250224fcd7..87ce6a51fb05 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -555,8 +555,11 @@ void mt76x02_sw_scan_complete(struct ieee80211_hw *hw,
if (mt76_is_mmio(dev))
tasklet_enable(&dev->pre_tbtt_tasklet);
- if (dev->cal.gain_init_done)
+ if (dev->cal.gain_init_done) {
+ /* Restore AGC gain and resume calibration after scanning. */
+ dev->cal.low_gain = -1;
ieee80211_queue_delayed_work(hw, &dev->cal_work, 0);
+ }
}
EXPORT_SYMBOL_GPL(mt76x02_sw_scan_complete);