From 1942651fdfd1223c378f7aa07c45773d51cce0ae Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: May 25 2023 07:19:37 +0000 Subject: serial: 8250_exar: Add support for USR298x PCI Modems (git-fixes). --- diff --git a/patches.suse/serial-8250_exar-Add-support-for-USR298x-PCI-Modems.patch b/patches.suse/serial-8250_exar-Add-support-for-USR298x-PCI-Modems.patch new file mode 100644 index 0000000..4944279 --- /dev/null +++ b/patches.suse/serial-8250_exar-Add-support-for-USR298x-PCI-Modems.patch @@ -0,0 +1,79 @@ +From 95d698869b404772cc8b72560df71548491c10bc Mon Sep 17 00:00:00 2001 +From: Andrew Davis +Date: Thu, 20 Apr 2023 11:02:09 -0500 +Subject: [PATCH] serial: 8250_exar: Add support for USR298x PCI Modems +Git-commit: 95d698869b404772cc8b72560df71548491c10bc +Patch-mainline: v6.4-rc3 +References: git-fixes + +Possibly the last PCI controller-based (i.e. not a soft/winmodem) +dial-up modem one can still buy. + +Looks to have a stock XR17C154 PCI UART chip for communication, but for +some reason when provisioning the PCI IDs they swapped the vendor and +subvendor IDs. Otherwise this card would have worked out of the box. + +Searching online, some folks seem to not have this issue and others do, +so it is possible only some batches of cards have this error. + +Create a new macro to handle the switched IDs and add support here. + +Signed-off-by: Andrew Davis +Cc: stable +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20230420160209.28221-1-afd@ti.com +Signed-off-by: Greg Kroah-Hartman +Acked-by: Takashi Iwai + +--- + drivers/tty/serial/8250/8250_exar.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c +index 64770c62bbec..b406cba10b0e 100644 +--- a/drivers/tty/serial/8250/8250_exar.c ++++ b/drivers/tty/serial/8250/8250_exar.c +@@ -40,9 +40,13 @@ + #define PCI_DEVICE_ID_COMMTECH_4224PCIE 0x0020 + #define PCI_DEVICE_ID_COMMTECH_4228PCIE 0x0021 + #define PCI_DEVICE_ID_COMMTECH_4222PCIE 0x0022 ++ + #define PCI_DEVICE_ID_EXAR_XR17V4358 0x4358 + #define PCI_DEVICE_ID_EXAR_XR17V8358 0x8358 + ++#define PCI_SUBDEVICE_ID_USR_2980 0x0128 ++#define PCI_SUBDEVICE_ID_USR_2981 0x0129 ++ + #define PCI_DEVICE_ID_SEALEVEL_710xC 0x1001 + #define PCI_DEVICE_ID_SEALEVEL_720xC 0x1002 + #define PCI_DEVICE_ID_SEALEVEL_740xC 0x1004 +@@ -829,6 +833,15 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { + (kernel_ulong_t)&bd \ + } + ++#define USR_DEVICE(devid, sdevid, bd) { \ ++ PCI_DEVICE_SUB( \ ++ PCI_VENDOR_ID_USR, \ ++ PCI_DEVICE_ID_EXAR_##devid, \ ++ PCI_VENDOR_ID_EXAR, \ ++ PCI_SUBDEVICE_ID_USR_##sdevid), 0, 0, \ ++ (kernel_ulong_t)&bd \ ++ } ++ + static const struct pci_device_id exar_pci_tbl[] = { + EXAR_DEVICE(ACCESSIO, COM_2S, pbn_exar_XR17C15x), + EXAR_DEVICE(ACCESSIO, COM_4S, pbn_exar_XR17C15x), +@@ -853,6 +866,10 @@ static const struct pci_device_id exar_pci_tbl[] = { + + IBM_DEVICE(XR17C152, SATURN_SERIAL_ONE_PORT, pbn_exar_ibm_saturn), + ++ /* USRobotics USR298x-OEM PCI Modems */ ++ USR_DEVICE(XR17C152, 2980, pbn_exar_XR17C15x), ++ USR_DEVICE(XR17C152, 2981, pbn_exar_XR17C15x), ++ + /* Exar Corp. XR17C15[248] Dual/Quad/Octal UART */ + EXAR_DEVICE(EXAR, XR17C152, pbn_exar_XR17C15x), + EXAR_DEVICE(EXAR, XR17C154, pbn_exar_XR17C15x), +-- +2.35.3 + diff --git a/series.conf b/series.conf index 3ab48c5..ca9c43d 100644 --- a/series.conf +++ b/series.conf @@ -20164,6 +20164,7 @@ patches.suse/xhci-pci-Only-run-d3cold-avoidance-quirk-for-s2idle.patch patches.suse/xhci-Fix-incorrect-tracking-of-free-space-on-transfe.patch patches.suse/thunderbolt-Clear-registers-properly-when-auto-clear.patch + patches.suse/serial-8250_exar-Add-support-for-USR298x-PCI-Modems.patch patches.suse/serial-arc_uart-fix-of_iomap-leak-in-arc_serial_prob.patch patches.suse/serial-8250_bcm7271-balance-clk_enable-calls.patch patches.suse/serial-8250_bcm7271-fix-leak-in-brcmuart_probe.patch