]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7925: add MT7927 PCIe support
authorSean Wang <sean.wang@mediatek.com>
Sat, 25 Apr 2026 19:50:10 +0000 (14:50 -0500)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jun 2026 10:15:21 +0000 (10:15 +0000)
Add the missing MT7927 device support in the mt7925 PCI path.
This ensures MT7927 is identified correctly and uses the proper
initialization flow.

Co-developed-by: Javier Tia <floss@jetm.me>
Signed-off-by: Javier Tia <floss@jetm.me>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260425195011.790265-21-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/pci.c

index fd6d0b029ef41b3437f85c83b3e9880f090811d5..ea64303283edbeaf581bcafb7927e2488552b501 100644 (file)
@@ -16,6 +16,12 @@ static const struct pci_device_id mt7925_pci_device_table[] = {
                .driver_data = (kernel_ulong_t)MT7925_FIRMWARE_WM },
        { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0717),
                .driver_data = (kernel_ulong_t)MT7925_FIRMWARE_WM },
+       { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7927),
+               .driver_data = (kernel_ulong_t)MT7927_FIRMWARE_WM },
+       { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x6639),
+               .driver_data = (kernel_ulong_t)MT7927_FIRMWARE_WM },
+       { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0738),
+               .driver_data = (kernel_ulong_t)MT7927_FIRMWARE_WM },
        { },
 };
 
@@ -376,7 +382,8 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
        if (ret)
                goto err_free_pci_vec;
 
-       is_mt7927_hw = (pdev->device == 0x6639 || pdev->device == 0x7927);
+       is_mt7927_hw = (pdev->device == 0x6639 || pdev->device == 0x7927 ||
+                       pdev->device == 0x0738);
 
        /* MT7927: ASPM L1 causes unreliable WFDMA register access */
        if (mt7925_disable_aspm || is_mt7927_hw)
@@ -436,6 +443,13 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
 
        dev_info(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
 
+       if (is_mt7927_hw && mt76_chip(mdev) != 0x7927) {
+               dev_info(mdev->dev,
+                        "MT7927 raw CHIPID=0x%04x, forcing chip=0x7927\n",
+                        mt76_chip(mdev));
+               mdev->rev = (0x7927 << 16) | (mdev->rev & 0xff);
+       }
+
        mt76_rmw_field(dev, MT_HW_EMI_CTL, MT_HW_EMI_CTL_SLPPROT_EN, 1);
 
        ret = mt792x_wfsys_reset(dev);