Skip to content

Commit 2cbbefd

Browse files
StanleyYP Wangnbd168
authored andcommitted
wifi: mt76: mt7996: support mt7992 eeprom loading
Add the default eeprom and 0x7992 check to mt7996_check_eeprom(). This is a preliminary patch for mt7992 chipsets support. Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 50fbebf commit 2cbbefd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,24 @@ static int mt7996_check_eeprom(struct mt7996_dev *dev)
1414

1515
switch (val) {
1616
case 0x7990:
17-
return 0;
17+
return is_mt7996(&dev->mt76) ? 0 : -EINVAL;
18+
case 0x7992:
19+
return is_mt7992(&dev->mt76) ? 0 : -EINVAL;
1820
default:
1921
return -EINVAL;
2022
}
2123
}
2224

2325
static char *mt7996_eeprom_name(struct mt7996_dev *dev)
2426
{
25-
/* reserve for future variants */
26-
return MT7996_EEPROM_DEFAULT;
27+
switch (mt76_chip(&dev->mt76)) {
28+
case 0x7990:
29+
return MT7996_EEPROM_DEFAULT;
30+
case 0x7992:
31+
return MT7992_EEPROM_DEFAULT;
32+
default:
33+
return MT7996_EEPROM_DEFAULT;
34+
}
2735
}
2836

2937
static int

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#define MT7992_ROM_PATCH "mediatek/mt7996/mt7992_rom_patch.bin"
4040

4141
#define MT7996_EEPROM_DEFAULT "mediatek/mt7996/mt7996_eeprom.bin"
42+
#define MT7992_EEPROM_DEFAULT "mediatek/mt7996/mt7992_eeprom.bin"
4243
#define MT7996_EEPROM_SIZE 7680
4344
#define MT7996_EEPROM_BLOCK_SIZE 16
4445
#define MT7996_TOKEN_SIZE 16384

0 commit comments

Comments
 (0)