2023-10-25 23:35:08

by Ryder Lee

[permalink] [raw]
Subject: [PATCH 2/2] wifi: mt76: mt7915: fix missing CH144 support for mt7915 pre-calibration

Sync from MTK SDK. The current mt7915 pre-calibration data lacks CH144@BW20
so we fallback to apply adjacent channel's data as an alternative.

Fixes: 495184ac91bb ("mt76: mt7915: add support for applying pre-calibration data")
Signed-off-by: Ryder Lee <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index da3ee9f91704..01f208fec73e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -2990,6 +2990,8 @@ static int mt7915_dpd_freq_idx(struct mt7915_dev *dev, u16 freq, u8 bw)
if (is_mt7915(&dev->mt76)) {
freq_list = freq_list_v1;
n_freqs = ARRAY_SIZE(freq_list_v1);
+ /* NOTE: apply adjacent channel data for the missing ch144 */
+ freq = (freq == 5720) ? 5700: freq;
} else {
freq_list = freq_list_v2;
n_freqs = ARRAY_SIZE(freq_list_v2);
--
2.39.0