Skip to content

Commit 03e6742

Browse files
Thinh Nguyenbjorn-helgaas
authored andcommitted
PCI: Override Synopsys USB 3.x HAPS device class
Synopsys USB 3.x host HAPS platform has a class code of PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these devices should use dwc3-haps driver. Change these devices' class code to PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming them. Signed-off-by: Thinh Nguyen <thinhn@synopsys.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent b6061b1 commit 03e6742

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/pci/quirks.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,30 @@ static void quirk_amd_nl_class(struct pci_dev *pdev)
618618
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
619619
quirk_amd_nl_class);
620620

621+
/*
622+
* Synopsys USB 3.x host HAPS platform has a class code of
623+
* PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
624+
* devices should use dwc3-haps driver. Change these devices' class code to
625+
* PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
626+
* them.
627+
*/
628+
static void quirk_synopsys_haps(struct pci_dev *pdev)
629+
{
630+
u32 class = pdev->class;
631+
632+
switch (pdev->device) {
633+
case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3:
634+
case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI:
635+
case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31:
636+
pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
637+
pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
638+
class, pdev->class);
639+
break;
640+
}
641+
}
642+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID,
643+
quirk_synopsys_haps);
644+
621645
/*
622646
* Let's make the southbridge information explicit instead of having to
623647
* worry about people probing the ACPI areas, for example.. (Yes, it

0 commit comments

Comments
 (0)