Commit b0297b67 authored by Felix Fietkau's avatar Felix Fietkau

mt76: mt7603: fix reading target tx power from eeprom

For the external PA (TSSI OFF) case, the target power needs to be read
from a different location in EEPROM
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 2dcb79cd
...@@ -69,6 +69,8 @@ enum mt7603_eeprom_field { ...@@ -69,6 +69,8 @@ enum mt7603_eeprom_field {
MT_EE_CP_FT_VERSION = 0x0f0, MT_EE_CP_FT_VERSION = 0x0f0,
MT_EE_TX_POWER_TSSI_OFF = 0x0f2,
MT_EE_XTAL_FREQ_OFFSET = 0x0f4, MT_EE_XTAL_FREQ_OFFSET = 0x0f4,
MT_EE_XTAL_TRIM_2_COMP = 0x0f5, MT_EE_XTAL_TRIM_2_COMP = 0x0f5,
MT_EE_XTAL_TRIM_3_COMP = 0x0f6, MT_EE_XTAL_TRIM_3_COMP = 0x0f6,
......
...@@ -465,9 +465,13 @@ mt7603_init_txpower(struct mt7603_dev *dev, ...@@ -465,9 +465,13 @@ mt7603_init_txpower(struct mt7603_dev *dev,
u8 *eeprom = (u8 *)dev->mt76.eeprom.data; u8 *eeprom = (u8 *)dev->mt76.eeprom.data;
int target_power = eeprom[MT_EE_TX_POWER_0_START_2G + 2] & ~BIT(7); int target_power = eeprom[MT_EE_TX_POWER_0_START_2G + 2] & ~BIT(7);
u8 *rate_power = &eeprom[MT_EE_TX_POWER_CCK]; u8 *rate_power = &eeprom[MT_EE_TX_POWER_CCK];
bool ext_pa = eeprom[MT_EE_NIC_CONF_0 + 1] & BIT(1);
int max_offset, cur_offset; int max_offset, cur_offset;
int i; int i;
if (ext_pa && is_mt7603(dev))
target_power = eeprom[MT_EE_TX_POWER_TSSI_OFF] & ~BIT(7);
if (target_power & BIT(6)) if (target_power & BIT(6))
target_power = -(target_power & GENMASK(5, 0)); target_power = -(target_power & GENMASK(5, 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment