Commit 8acb7afc authored by Felix Fietkau's avatar Felix Fietkau
Browse files

mt76: mt7615: add calibration free support for MT7622



MT7622 uses fewer efuse overrides than MT7615

Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 5dff21ee
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -211,6 +211,26 @@ static void mt7615_apply_cal_free_data(struct mt7615_dev *dev)
		eeprom[ical_nocheck[i]] = otp[ical_nocheck[i]];
}

static void mt7622_apply_cal_free_data(struct mt7615_dev *dev)
{
	static const u16 ical[] = {
		0x53, 0x54, 0x55, 0x56, 0xf4, 0xf7, 0x144, 0x156, 0x15b
	};
	u8 *eeprom = dev->mt76.eeprom.data;
	u8 *otp = dev->mt76.otp.data;
	int i;

	if (!otp)
		return;

	for (i = 0; i < ARRAY_SIZE(ical); i++) {
		if (!otp[ical[i]])
			continue;

		eeprom[ical[i]] = otp[ical[i]];
	}
}

int mt7615_eeprom_init(struct mt7615_dev *dev)
{
	int ret;
@@ -223,6 +243,8 @@ int mt7615_eeprom_init(struct mt7615_dev *dev)
	if (ret && dev->mt76.otp.data)
		memcpy(dev->mt76.eeprom.data, dev->mt76.otp.data,
		       MT7615_EEPROM_SIZE);
	else if (is_mt7622(&dev->mt76))
		mt7622_apply_cal_free_data(dev);
	else
		mt7615_apply_cal_free_data(dev);