From patchwork Thu Apr 20 16:02:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 85941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp447852vqo; Thu, 20 Apr 2023 09:07:19 -0700 (PDT) X-Google-Smtp-Source: AKy350a+M/X343w7CeIV1BiAKIeM7fFWfMp23ZxFOmzLj2O2pBCSC9OayS4Ul9E/cj74kUVVNS4G X-Received: by 2002:a17:90a:d34c:b0:246:d13c:c027 with SMTP id i12-20020a17090ad34c00b00246d13cc027mr6133265pjx.24.1682006839429; Thu, 20 Apr 2023 09:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682006839; cv=none; d=google.com; s=arc-20160816; b=tLXRYzVqb8jh1vMHKQ7jxE5ruS51Xd9SE/U+NmUV3NMujVj37ieGIRYhhriOnHsZ01 lYP3Gue5nPlAXrnlAyJLxjMiij2v2Qx24FhlJxexnFHTB70Vospti3wNKuFOyKfmY1F9 5lnRXUA029balMI6h8fLVId7M3QPrrSnnJzScoIMqyBcx5PhTOC5ctKMA+edK7xGY7RO AxVDBv2iD6KeKPj2KWLfVq3Zvq+vJ3/qw5u1J0n5bVFJU1C6u75+5FyVOxNMauHX5p3o 60bV3mTyt3DguxzgTUQrTnGjPGDA8KdsRmS6lZ8oQMJE02+acg8nM7ttXXaa9iTE5MWC E9AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=32rTaG1sMuRUvRiLcC0IxZFq/Gj51HyH/Fwu02QIUCE=; b=TozSvYylzTANVBOYvU2lHtIXkfrjfwSJqrM7JUY1rkfZo+qAGlC8oQ07hQykv8lrxt HifsXqPXuK6EWK9qdnK3NIkUEm7mA5Eaqzxe2d5DsSyZrGEdHrrrgImyvgBOkRq7MX8U T9NHPIaeuA1sWXs1kNMMI83O+8/A+ZBnSHnCODWHvUAjhF1xoiqnidfGw+0AeG2WobaE yOePa8FJ6eOl0zUksBeS9DsdHrEykXXZOfkK0jWK+p2FijaGmg6Z/9ZHXoxv4M8N3QoI 0LULyvTd+1nXerDDXbM37qNY9bKIc5ID4ojqF8y3b+bIFyYbmUmuw7D8jnzadFaSBKY8 L0Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qBEqdpU1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a17090acf0500b00247425ceb4csi4883383pju.165.2023.04.20.09.07.06; Thu, 20 Apr 2023 09:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qBEqdpU1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233092AbjDTQCU (ORCPT + 99 others); Thu, 20 Apr 2023 12:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjDTQCS (ORCPT ); Thu, 20 Apr 2023 12:02:18 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C4C2110; Thu, 20 Apr 2023 09:02:15 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33KG2Ab9077822; Thu, 20 Apr 2023 11:02:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1682006530; bh=32rTaG1sMuRUvRiLcC0IxZFq/Gj51HyH/Fwu02QIUCE=; h=From:To:CC:Subject:Date; b=qBEqdpU1cnTmsVzSP2waazDdib0k6TIuueTGleriAzdaHyZxroCedIYWpS9YNUjEC F2h+dirVAncewIF4pRfl2dPn9mEYN5X1RAx7Qi4azXhz5TWNsqxabIEwywJ1AcBGRw z3sBFEFHyZ8hCvNM+E+R2yBuSlw1lsPTJTJjMq2A= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33KG2Aip074012 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Apr 2023 11:02:10 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 20 Apr 2023 11:02:10 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE107.ent.ti.com (10.64.6.28) 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, 20 Apr 2023 11:02:09 -0500 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33KG29Xn031429; Thu, 20 Apr 2023 11:02:09 -0500 From: Andrew Davis To: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko CC: , , Andrew Davis Subject: [PATCH v2] serial: 8250_exar: Add support for USR298x PCI Modems Date: Thu, 20 Apr 2023 11:02:09 -0500 Message-ID: <20230420160209.28221-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763712003968173374?= X-GMAIL-MSGID: =?utf-8?q?1763712003968173374?= 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 --- Changes from v1: - Removed first patch in series, will convert these all later - Add Reviewed-by tag 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 64770c62bbec5..b406cba10b0eb 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),