Skip to content

Commit

Permalink
mt76: mt7615: add support for MT7611N
Browse files Browse the repository at this point in the history
MT7611N is basically the same as MT7615N, except it only supports 5GHz
It is used by some TP-Link and Mercury wireless routers

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
DENG Qingfang authored and Felix Fietkau committed May 28, 2020
1 parent 5e616ad commit e47f224
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ mt7615_eeprom_parse_hw_band_cap(struct mt7615_dev *dev)
return;
}

if (is_mt7611(&dev->mt76)) {
/* 5GHz only */
dev->mt76.cap.has_5ghz = true;
return;
}

val = FIELD_GET(MT_EE_NIC_WIFI_CONF_BAND_SEL,
eeprom[MT_EE_WIFI_CONF]);
switch (val) {
Expand Down Expand Up @@ -310,6 +316,7 @@ static void mt7615_cal_free_data(struct mt7615_dev *dev)
mt7622_apply_cal_free_data(dev);
break;
case 0x7615:
case 0x7611:
mt7615_apply_cal_free_data(dev);
break;
}
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,19 @@ static inline bool is_mt7622(struct mt76_dev *dev)

static inline bool is_mt7615(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7615;
return mt76_chip(dev) == 0x7615 || mt76_chip(dev) == 0x7611;
}

static inline bool is_mt7663(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7663;
}

static inline bool is_mt7611(struct mt76_dev *dev)
{
return mt76_chip(dev) == 0x7611;
}

static inline void mt7615_irq_enable(struct mt7615_dev *dev, u32 mask)
{
mt76_set_irq_mask(&dev->mt76, 0, 0, mask);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/mediatek/mt76/mt7615/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
static const struct pci_device_id mt7615_pci_device_table[] = {
{ PCI_DEVICE(0x14c3, 0x7615) },
{ PCI_DEVICE(0x14c3, 0x7663) },
{ PCI_DEVICE(0x14c3, 0x7611) },
{ },
};

Expand Down

0 comments on commit e47f224

Please sign in to comment.