]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
usb: cdns3: Synchronise PCI IDs via common data base
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 Nov 2024 16:01:25 +0000 (18:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Nov 2024 06:16:31 +0000 (07:16 +0100)
There are a few places in the kernel where PCI IDs for different Cadence
USB controllers are being used. Besides different naming, they duplicate
each other. Make this all in order by providing common definitions via
PCI IDs database and use in all users. While doing that, rename
definitions as Roger suggested.

Suggested-by: Roger Quadros <rogerq@kernel.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20241112160125.2340972-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/cdns3/cdns3-pci-wrap.c
drivers/usb/cdns3/cdnsp-pci.c
drivers/usb/gadget/udc/cdns2/cdns2-pci.c
drivers/usb/host/xhci-pci.c
include/linux/pci_ids.h

index 591d149de8f3d9f509dfbecc3e92fc924a41ffa9..3b3b3dc75f359018bf22d1d5fadfe25eb2f03351 100644 (file)
@@ -37,8 +37,6 @@ struct cdns3_wrap {
 #define PCI_DRIVER_NAME                "cdns3-pci-usbss"
 #define PLAT_DRIVER_NAME       "cdns-usb3"
 
-#define PCI_DEVICE_ID_CDNS_USB3        0x0100
-
 static struct pci_dev *cdns3_get_second_fun(struct pci_dev *pdev)
 {
        struct pci_dev *func;
@@ -189,7 +187,7 @@ static void cdns3_pci_remove(struct pci_dev *pdev)
 }
 
 static const struct pci_device_id cdns3_pci_ids[] = {
-       { PCI_VDEVICE(CDNS, PCI_DEVICE_ID_CDNS_USB3) },
+       { PCI_VDEVICE(CDNS, PCI_DEVICE_ID_CDNS_USBSS) },
        { 0, }
 };
 
index 2d05368a6745a1a4fcc166056c019aa4f151af06..a51144504ff337a5888b75cdd060c432ee3fa395 100644 (file)
 #define PCI_DRIVER_NAME                "cdns-pci-usbssp"
 #define PLAT_DRIVER_NAME       "cdns-usbssp"
 
-#define PCI_DEVICE_ID_CDNS_USB3                0x0100
-#define PCI_DEVICE_ID_CDNS_UDC         0x0200
-
-#define PCI_CLASS_SERIAL_USB_CDNS_USB3 (PCI_CLASS_SERIAL_USB << 8 | 0x80)
-#define PCI_CLASS_SERIAL_USB_CDNS_UDC  PCI_CLASS_SERIAL_USB_DEVICE
-
 static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
 {
        /*
@@ -41,10 +35,10 @@ static struct pci_dev *cdnsp_get_second_fun(struct pci_dev *pdev)
         * Platform has two function. The fist keeps resources for
         * Host/Device while the secon keeps resources for DRD/OTG.
         */
-       if (pdev->device == PCI_DEVICE_ID_CDNS_UDC)
-               return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_USB3, NULL);
-       if (pdev->device == PCI_DEVICE_ID_CDNS_USB3)
-               return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_UDC, NULL);
+       if (pdev->device == PCI_DEVICE_ID_CDNS_USBSSP)
+               return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_USBSS, NULL);
+       if (pdev->device == PCI_DEVICE_ID_CDNS_USBSS)
+               return pci_get_device(pdev->vendor, PCI_DEVICE_ID_CDNS_USBSSP, NULL);
 
        return NULL;
 }
@@ -221,12 +215,12 @@ static const struct dev_pm_ops cdnsp_pci_pm_ops = {
 };
 
 static const struct pci_device_id cdnsp_pci_ids[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC),
-         .class = PCI_CLASS_SERIAL_USB_CDNS_UDC },
-       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_UDC),
-         .class = PCI_CLASS_SERIAL_USB_CDNS_USB3 },
-       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USB3),
-         .class = PCI_CLASS_SERIAL_USB_CDNS_USB3 },
+       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USBSSP),
+         .class = PCI_CLASS_SERIAL_USB_DEVICE },
+       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USBSSP),
+         .class = PCI_CLASS_SERIAL_USB_CDNS },
+       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USBSS),
+         .class = PCI_CLASS_SERIAL_USB_CDNS },
        { 0, }
 };
 
index b1a8f772467c0d6cf4188bfc937d05b8676570af..e589593b4cbf89783108ad8721624b72ea8ef3db 100644 (file)
@@ -15,7 +15,6 @@
 #include "cdns2-gadget.h"
 
 #define PCI_DRIVER_NAME                "cdns-pci-usbhs"
-#define PCI_DEVICE_ID_CDNS_USB2        0x0120
 #define PCI_BAR_DEV            0
 #define PCI_DEV_FN_DEVICE      0
 
@@ -113,7 +112,7 @@ static const struct dev_pm_ops cdns2_pci_pm_ops = {
 };
 
 static const struct pci_device_id cdns2_pci_ids[] = {
-       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USB2),
+       { PCI_DEVICE(PCI_VENDOR_ID_CDNS, PCI_DEVICE_ID_CDNS_USB),
          .class = PCI_CLASS_SERIAL_USB_DEVICE },
        { 0, }
 };
index 47c4f70793e49e11ca02b4f9f2e1e6e7c5698c07..b21474e81482865241a674d2e4f82647d92063aa 100644 (file)
@@ -82,8 +82,6 @@
 #define PCI_DEVICE_ID_ASMEDIA_3042_XHCI                        0x3042
 #define PCI_DEVICE_ID_ASMEDIA_3242_XHCI                        0x3242
 
-#define PCI_DEVICE_ID_CDNS_SSP                         0x0200
-
 static const char hcd_name[] = "xhci_hcd";
 
 static struct hc_driver __read_mostly xhci_pci_hc_driver;
@@ -475,8 +473,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
                if (pdev->device == 0x9203)
                        xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH;
        }
+
        if (pdev->vendor == PCI_VENDOR_ID_CDNS &&
-           pdev->device == PCI_DEVICE_ID_CDNS_SSP)
+           pdev->device == PCI_DEVICE_ID_CDNS_USBSSP)
                xhci->quirks |= XHCI_CDNS_SCTX_QUIRK;
 
        /* xHC spec requires PCI devices to support D3hot and D3cold */
index 4cf6aaed5f35db0bbafb8ec94a729a21fe2d29e5..eff9eccc52fcad4eb6b7c6d71191ba9d2004e59c 100644 (file)
 #define PCI_CLASS_SERIAL_USB_OHCI      0x0c0310
 #define PCI_CLASS_SERIAL_USB_EHCI      0x0c0320
 #define PCI_CLASS_SERIAL_USB_XHCI      0x0c0330
+#define PCI_CLASS_SERIAL_USB_CDNS      0x0c0380
 #define PCI_CLASS_SERIAL_USB_DEVICE    0x0c03fe
 #define PCI_CLASS_SERIAL_FIBER         0x0c04
 #define PCI_CLASS_SERIAL_SMBUS         0x0c05
 #define PCI_VENDOR_ID_QCOM             0x17cb
 
 #define PCI_VENDOR_ID_CDNS             0x17cd
+#define PCI_DEVICE_ID_CDNS_USBSS       0x0100
+#define PCI_DEVICE_ID_CDNS_USB         0x0120
+#define PCI_DEVICE_ID_CDNS_USBSSP      0x0200
 
 #define PCI_VENDOR_ID_ARECA            0x17d3
 #define PCI_DEVICE_ID_ARECA_1110       0x1110