Skip to content

Commit

Permalink
mt76: fix OTP based tx power data override for group 0
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
Felix Fietkau committed Sep 25, 2015
1 parent a1767dd commit d99eddb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ mt76_apply_cal_free_data(struct mt76_dev *dev, u8 *efuse)
MT_EE_RF_5G_GRP4_5_RX_HIGH_GAIN + 1,
};
u8 *eeprom = dev->eeprom.data;
u8 prev_grp0[4] = {
eeprom[MT_EE_TX_POWER_0_START_5G],
eeprom[MT_EE_TX_POWER_0_START_5G + 1],
eeprom[MT_EE_TX_POWER_1_START_5G],
eeprom[MT_EE_TX_POWER_1_START_5G + 1]
};
u16 val;
int i;

Expand All @@ -168,6 +174,11 @@ mt76_apply_cal_free_data(struct mt76_dev *dev, u8 *efuse)
eeprom[offset] = efuse[offset];
}

if (!(efuse[MT_EE_TX_POWER_0_START_5G] | efuse[MT_EE_TX_POWER_0_START_5G + 1]))
memcpy(eeprom + MT_EE_TX_POWER_0_START_5G, prev_grp0, 2);
if (!(efuse[MT_EE_TX_POWER_1_START_5G] | efuse[MT_EE_TX_POWER_1_START_5G + 1]))
memcpy(eeprom + MT_EE_TX_POWER_1_START_5G, prev_grp0 + 2, 2);

val = get_unaligned_le16(efuse + MT_EE_BT_RCAL_RESULT);
if (val != 0xffff)
eeprom[MT_EE_BT_RCAL_RESULT] = val & 0xff;
Expand Down

0 comments on commit d99eddb

Please sign in to comment.