wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy

MT7902 PCIe requires a different wm2_complete_mask value, so introduce a
mutable per-device copy of the default irq_map and override the field
only for this chip. Other devices continue using the shared const
template.

This is a prerequisite patch before enabling MT7902 PCIe support.

Co-developed-by: Xiong Huang <[email protected]>
Signed-off-by: Xiong Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Sean Wang
2026-02-21 09:29:41 +00:00
committed by Felix Fietkau
parent 95df5c5915
commit c3d742932a
+14
View File
@@ -327,6 +327,20 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
dev->hif_ops = &mt7921_pcie_ops; dev->hif_ops = &mt7921_pcie_ops;
dev->irq_map = &irq_map; dev->irq_map = &irq_map;
mt76_mmio_init(&dev->mt76, regs); mt76_mmio_init(&dev->mt76, regs);
if (id->device == 0x7902) {
struct mt792x_irq_map *map;
/* MT7902 needs a mutable copy because wm2_complete_mask differs */
map = devm_kmemdup(&pdev->dev, &irq_map,
sizeof(irq_map), GFP_KERNEL);
if (!map)
return -ENOMEM;
map->rx.wm2_complete_mask = 0;
dev->irq_map = map;
}
tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev); tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
dev->phy.dev = dev; dev->phy.dev = dev;