Merge 5.18-rc5 into tty-next
[linux-2.6-microblaze.git] / drivers / tty / serial / 8250 / 8250_pci.c
index a293e9f..9bc79aa 100644 (file)
@@ -3518,6 +3518,12 @@ static struct pciserial_board pci_boards[] = {
        },
 };
 
+#define REPORT_CONFIG(option) \
+       (IS_ENABLED(CONFIG_##option) ? 0 : (kernel_ulong_t)&#option)
+#define REPORT_8250_CONFIG(option) \
+       (IS_ENABLED(CONFIG_SERIAL_8250_##option) ? \
+        0 : (kernel_ulong_t)&"SERIAL_8250_"#option)
+
 static const struct pci_device_id blacklist[] = {
        /* softmodems */
        { PCI_VDEVICE(AL, 0x5457), }, /* ALi Corporation M5457 AC'97 Modem */
@@ -3525,40 +3531,43 @@ static const struct pci_device_id blacklist[] = {
        { PCI_DEVICE(0x1543, 0x3052), }, /* Si3052-based modem, default IDs */
 
        /* multi-io cards handled by parport_serial */
-       { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
-       { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */
-       { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */
+       /* WCH CH353 2S1P */
+       { PCI_DEVICE(0x4348, 0x7053), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
+       /* WCH CH353 1S1P */
+       { PCI_DEVICE(0x4348, 0x5053), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
+       /* WCH CH382 2S1P */
+       { PCI_DEVICE(0x1c00, 0x3250), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
 
        /* Intel platforms with MID UART */
-       { PCI_VDEVICE(INTEL, 0x081b), },
-       { PCI_VDEVICE(INTEL, 0x081c), },
-       { PCI_VDEVICE(INTEL, 0x081d), },
-       { PCI_VDEVICE(INTEL, 0x1191), },
-       { PCI_VDEVICE(INTEL, 0x18d8), },
-       { PCI_VDEVICE(INTEL, 0x19d8), },
+       { PCI_VDEVICE(INTEL, 0x081b), REPORT_8250_CONFIG(MID), },
+       { PCI_VDEVICE(INTEL, 0x081c), REPORT_8250_CONFIG(MID), },
+       { PCI_VDEVICE(INTEL, 0x081d), REPORT_8250_CONFIG(MID), },
+       { PCI_VDEVICE(INTEL, 0x1191), REPORT_8250_CONFIG(MID), },
+       { PCI_VDEVICE(INTEL, 0x18d8), REPORT_8250_CONFIG(MID), },
+       { PCI_VDEVICE(INTEL, 0x19d8), REPORT_8250_CONFIG(MID), },
 
        /* Intel platforms with DesignWare UART */
-       { PCI_VDEVICE(INTEL, 0x0936), },
-       { PCI_VDEVICE(INTEL, 0x0f0a), },
-       { PCI_VDEVICE(INTEL, 0x0f0c), },
-       { PCI_VDEVICE(INTEL, 0x228a), },
-       { PCI_VDEVICE(INTEL, 0x228c), },
-       { PCI_VDEVICE(INTEL, 0x4b96), },
-       { PCI_VDEVICE(INTEL, 0x4b97), },
-       { PCI_VDEVICE(INTEL, 0x4b98), },
-       { PCI_VDEVICE(INTEL, 0x4b99), },
-       { PCI_VDEVICE(INTEL, 0x4b9a), },
-       { PCI_VDEVICE(INTEL, 0x4b9b), },
-       { PCI_VDEVICE(INTEL, 0x9ce3), },
-       { PCI_VDEVICE(INTEL, 0x9ce4), },
+       { PCI_VDEVICE(INTEL, 0x0936), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x0f0a), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x0f0c), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x228a), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x228c), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b96), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b97), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b98), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b99), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b9a), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x4b9b), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x9ce3), REPORT_8250_CONFIG(LPSS), },
+       { PCI_VDEVICE(INTEL, 0x9ce4), REPORT_8250_CONFIG(LPSS), },
 
        /* Exar devices */
-       { PCI_VDEVICE(EXAR, PCI_ANY_ID), },
-       { PCI_VDEVICE(COMMTECH, PCI_ANY_ID), },
+       { PCI_VDEVICE(EXAR, PCI_ANY_ID), REPORT_8250_CONFIG(EXAR), },
+       { PCI_VDEVICE(COMMTECH, PCI_ANY_ID), REPORT_8250_CONFIG(EXAR), },
 
        /* Pericom devices */
-       { PCI_VDEVICE(PERICOM, PCI_ANY_ID), },
-       { PCI_VDEVICE(ACCESSIO, PCI_ANY_ID), },
+       { PCI_VDEVICE(PERICOM, PCI_ANY_ID), REPORT_8250_CONFIG(PERICOM), },
+       { PCI_VDEVICE(ACCESSIO, PCI_ANY_ID), REPORT_8250_CONFIG(PERICOM), },
 
        /* End of the black list */
        { }
@@ -3840,8 +3849,12 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
        board = &pci_boards[ent->driver_data];
 
        exclude = pci_match_id(blacklist, dev);
-       if (exclude)
+       if (exclude) {
+               if (exclude->driver_data)
+                       pci_warn(dev, "ignoring port, enable %s to handle\n",
+                                (const char *)exclude->driver_data);
                return -ENODEV;
+       }
 
        rc = pcim_enable_device(dev);
        pci_save_state(dev);