From patchwork Thu Apr 13 21:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 673323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 533D6C77B61 for ; Thu, 13 Apr 2023 21:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbjDMVob (ORCPT ); Thu, 13 Apr 2023 17:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDMVob (ORCPT ); Thu, 13 Apr 2023 17:44:31 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6144C40E8; Thu, 13 Apr 2023 14:44:28 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33DLiNDE012174; Thu, 13 Apr 2023 16:44:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681422263; bh=+KwEykf/fDBcG6usYlndFSM6e9C6z2Bqai8vh0oE75o=; h=From:To:CC:Subject:Date; b=RzGr2fm2eelmrGrFPIcllmEkdj7Y1ym4DOBYMiLOFhlcbAvEdzLLE4Oi4ePttW7M9 vXcOXRWcmTKnmZ3153cJekntLBdkyElMOoN4k89zIcoXb9fn3jgOjgONxXG729766X 3UcgfnkiRSZZk9008rqIW2Y6+6UkC3ZEHfixne30= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33DLiNC8086957 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Apr 2023 16:44:23 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 13 Apr 2023 16:44:22 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 13 Apr 2023 16:44:22 -0500 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33DLiMHB125333; Thu, 13 Apr 2023 16:44:22 -0500 From: Andrew Davis To: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko CC: , , Andrew Davis Subject: [PATCH 1/2] serial: 8250_exar: Use PCI_DEVICE_DATA macro directly Date: Thu, 13 Apr 2023 16:44:20 -0500 Message-ID: <20230413214421.6251-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The EXAR_DEVICE macro was converted to use PCI_DEVICE_DATA, having this macro at doesn't add much, remove it. Signed-off-by: Andrew Davis --- drivers/tty/serial/8250/8250_exar.c | 65 +++++++++++++++-------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 64770c62bbec5..878d87f4202bd 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -818,8 +818,6 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { (kernel_ulong_t)&bd \ } -#define EXAR_DEVICE(vend, devid, bd) { PCI_DEVICE_DATA(vend, devid, &bd) } - #define IBM_DEVICE(devid, sdevid, bd) { \ PCI_DEVICE_SUB( \ PCI_VENDOR_ID_EXAR, \ @@ -830,13 +828,14 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { } 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), - EXAR_DEVICE(ACCESSIO, COM_8S, pbn_exar_XR17C15x), - EXAR_DEVICE(ACCESSIO, COM232_8, pbn_exar_XR17C15x), - EXAR_DEVICE(ACCESSIO, COM_2SM, pbn_exar_XR17C15x), - EXAR_DEVICE(ACCESSIO, COM_4SM, pbn_exar_XR17C15x), - EXAR_DEVICE(ACCESSIO, COM_8SM, pbn_exar_XR17C15x), + /* ACCES I/O Products */ + { PCI_DEVICE_DATA(ACCESSIO, COM_2S, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM_4S, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM_8S, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM232_8, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM_2SM, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM_4SM, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(ACCESSIO, COM_8SM, &pbn_exar_XR17C15x) }, CONNECT_DEVICE(XR17C152, UART_2_232, pbn_connect), CONNECT_DEVICE(XR17C154, UART_4_232, pbn_connect), @@ -854,30 +853,34 @@ static const struct pci_device_id exar_pci_tbl[] = { IBM_DEVICE(XR17C152, SATURN_SERIAL_ONE_PORT, pbn_exar_ibm_saturn), /* Exar Corp. XR17C15[248] Dual/Quad/Octal UART */ - EXAR_DEVICE(EXAR, XR17C152, pbn_exar_XR17C15x), - EXAR_DEVICE(EXAR, XR17C154, pbn_exar_XR17C15x), - EXAR_DEVICE(EXAR, XR17C158, pbn_exar_XR17C15x), + { PCI_DEVICE_DATA(EXAR, XR17C152, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(EXAR, XR17C154, &pbn_exar_XR17C15x) }, + { PCI_DEVICE_DATA(EXAR, XR17C158, &pbn_exar_XR17C15x) }, /* Exar Corp. XR17V[48]35[248] Dual/Quad/Octal/Hexa PCIe UARTs */ - EXAR_DEVICE(EXAR, XR17V352, pbn_exar_XR17V35x), - EXAR_DEVICE(EXAR, XR17V354, pbn_exar_XR17V35x), - EXAR_DEVICE(EXAR, XR17V358, pbn_exar_XR17V35x), - EXAR_DEVICE(EXAR, XR17V4358, pbn_exar_XR17V4358), - EXAR_DEVICE(EXAR, XR17V8358, pbn_exar_XR17V8358), - EXAR_DEVICE(COMMTECH, 4222PCIE, pbn_fastcom35x_2), - EXAR_DEVICE(COMMTECH, 4224PCIE, pbn_fastcom35x_4), - EXAR_DEVICE(COMMTECH, 4228PCIE, pbn_fastcom35x_8), - - EXAR_DEVICE(COMMTECH, 4222PCI335, pbn_fastcom335_2), - EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4), - EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4), - EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8), - - EXAR_DEVICE(SEALEVEL, 710xC, pbn_exar_XR17V35x), - EXAR_DEVICE(SEALEVEL, 720xC, pbn_exar_XR17V35x), - EXAR_DEVICE(SEALEVEL, 740xC, pbn_exar_XR17V35x), - EXAR_DEVICE(SEALEVEL, 780xC, pbn_exar_XR17V35x), - EXAR_DEVICE(SEALEVEL, 716xC, pbn_exar_XR17V35x), + { PCI_DEVICE_DATA(EXAR, XR17V352, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(EXAR, XR17V354, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(EXAR, XR17V358, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(EXAR, XR17V4358, &pbn_exar_XR17V4358) }, + { PCI_DEVICE_DATA(EXAR, XR17V8358, &pbn_exar_XR17V8358) }, + + /* Commtech PCIe cards */ + { PCI_DEVICE_DATA(COMMTECH, 4222PCIE, &pbn_fastcom35x_2) }, + { PCI_DEVICE_DATA(COMMTECH, 4224PCIE, &pbn_fastcom35x_4) }, + { PCI_DEVICE_DATA(COMMTECH, 4228PCIE, &pbn_fastcom35x_8) }, + + /* Commtech PCI cards */ + { PCI_DEVICE_DATA(COMMTECH, 4222PCI335, &pbn_fastcom335_2) }, + { PCI_DEVICE_DATA(COMMTECH, 4224PCI335, &pbn_fastcom335_4) }, + { PCI_DEVICE_DATA(COMMTECH, 2324PCI335, &pbn_fastcom335_4) }, + { PCI_DEVICE_DATA(COMMTECH, 2328PCI335, &pbn_fastcom335_8) }, + + /* Sealevel 7xxxC serial cards */ + { PCI_DEVICE_DATA(SEALEVEL, 710xC, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(SEALEVEL, 720xC, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(SEALEVEL, 740xC, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(SEALEVEL, 780xC, &pbn_exar_XR17V35x) }, + { PCI_DEVICE_DATA(SEALEVEL, 716xC, &pbn_exar_XR17V35x) }, { 0, } }; MODULE_DEVICE_TABLE(pci, exar_pci_tbl); From patchwork Thu Apr 13 21:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 673075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0748C77B6E for ; Thu, 13 Apr 2023 21:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbjDMVoh (ORCPT ); Thu, 13 Apr 2023 17:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbjDMVog (ORCPT ); Thu, 13 Apr 2023 17:44:36 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD53A5ED; Thu, 13 Apr 2023 14:44:34 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33DLiNq2101018; Thu, 13 Apr 2023 16:44:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1681422263; bh=QMLoHs3s4zc8lSfEi22hkRinZpYk4eyS952mdBTg8eY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kX4cg9zDIFP0kRugv1VJwo4UuJnY3AGydYrVFQ0CDWU4donMOzJwwSFvFpiczC2Ux qcVLoI6ocAkRommn5xRxQUIkpXXE4vj5Eb2BLNuuQIxuC+iWgMZOuHK6Sf1i5tuK1T QBMpkxZZk/P07/d3sDrzqW7H96BWujmdqJk3mJNU= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33DLiNeQ023452 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Apr 2023 16:44:23 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 13 Apr 2023 16:44:23 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 13 Apr 2023 16:44:23 -0500 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33DLiMHC125333; Thu, 13 Apr 2023 16:44:22 -0500 From: Andrew Davis To: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko CC: , , Andrew Davis Subject: [PATCH 2/2] serial: 8250_exar: Add support for USR298x PCI Modems Date: Thu, 13 Apr 2023 16:44:21 -0500 Message-ID: <20230413214421.6251-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413214421.6251-1-afd@ti.com> References: <20230413214421.6251-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 Reviewed-by: Andy Shevchenko --- 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 878d87f4202bd..9792db550f8cb 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 @@ -827,6 +831,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[] = { /* ACCES I/O Products */ { PCI_DEVICE_DATA(ACCESSIO, COM_2S, &pbn_exar_XR17C15x) }, @@ -852,6 +865,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 */ { PCI_DEVICE_DATA(EXAR, XR17C152, &pbn_exar_XR17C15x) }, { PCI_DEVICE_DATA(EXAR, XR17C154, &pbn_exar_XR17C15x) },