]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7925: add MT7927 USB support
authorSean Wang <sean.wang@mediatek.com>
Sat, 25 Apr 2026 19:50:11 +0000 (14:50 -0500)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jun 2026 10:15:21 +0000 (10:15 +0000)
Add the MT7927 USB device ID and normalize the raw 0x6639 CHIPID to
MT7927 so the shared mt7925u code can use the proper chip-specific paths.

Restore the required band setup after USB MAC reset before restarting
the device.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260425195011.790265-22-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/usb.c
drivers/net/wireless/mediatek/mt76/usb.c

index 7071b6c93d14ba3e45795a6616c9a3be1e38689f..caacc54be71d3035c2b928869abde00bb1e2c2e8 100644 (file)
@@ -10,6 +10,8 @@
 #include "mac.h"
 
 static const struct usb_device_id mt7925u_device_table[] = {
+       { USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x6639, 0xff, 0xff, 0xff),
+               .driver_info = (kernel_ulong_t)MT7925_FIRMWARE_WM },
        { USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7925, 0xff, 0xff, 0xff),
                .driver_info = (kernel_ulong_t)MT7925_FIRMWARE_WM },
        /* Netgear, Inc. A8500 */
@@ -123,6 +125,12 @@ static int mt7925u_mac_reset(struct mt792x_dev *dev)
        if (err)
                goto out;
 
+       if (is_mt7927(&dev->mt76)) {
+               err = mt7925_mcu_set_dbdc(&dev->mphy, true);
+               if (err)
+                       goto out;
+       }
+
        err = __mt7925_start(&dev->phy);
 out:
        clear_bit(MT76_RESET, &dev->mphy.state);
@@ -200,6 +208,13 @@ static int mt7925u_probe(struct usb_interface *usb_intf,
                    (mt76_rr(dev, MT_HW_REV) & 0xff);
        dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
 
+       if (mt76_chip(mdev) == 0x6639) {
+               dev_dbg(mdev->dev,
+                       "MT7927 raw CHIPID=0x%04x, forcing chip=0x7927\n",
+                       mt76_chip(mdev));
+               mdev->rev = (0x7927 << 16) | (mdev->rev & 0xff);
+       }
+
        if (mt76_get_field(dev, MT_CONN_ON_MISC, MT_TOP_MISC2_FW_N9_RDY)) {
                ret = mt792xu_wfsys_reset(dev);
                if (ret)
index 632ae755c7a6e5edbf8a6bd69c399049269a8dae..9bd61c9e94ed941c1e508b55b377ea20b384d0f5 100644 (file)
@@ -925,6 +925,7 @@ mt76u_ac_to_hwq(struct mt76_dev *dev, struct mt76_queue *q, u8 qid)
                q->ep = q->hw_idx + 1;
                break;
        }
+       case 0x6639:
        case 0x7961:
        case 0x7925:
                q->hw_idx = mt76_ac_to_hwq(ac);