From patchwork Wed Aug 30 15:05:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Howell X-Patchwork-Id: 718934 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 8BF72C83F1D for ; Wed, 30 Aug 2023 18:38:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233604AbjH3Sil (ORCPT ); Wed, 30 Aug 2023 14:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245300AbjH3PGB (ORCPT ); Wed, 30 Aug 2023 11:06:01 -0400 Received: from CY4PR02CU007.outbound.protection.outlook.com (mail-westcentralusazon11011000.outbound.protection.outlook.com [40.93.199.0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0BBAC for ; Wed, 30 Aug 2023 08:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UozuLXmGWQf7Zp1x5EuQkLuqrF0K5kUrS29JRa7kdU4pvvlAaGhhkk6v3UDIjBEE108z5ZKcKmWUZnORKJjWdOJS+NW/f4GpWopDFfFg7pPdr2nNwVDjusPoKsxb6IoukHQDE2ZY7kVzB0S68YJmYido5cCqH5C14iVoCXfzGdySWlxMLwIIGczyxl6ZDe3/tPFhYFZltVOrtQ+HdoiJWpXETIpsTiZkzCcKkIBM23d53O4qbteZf9Sj80D7NmwmJ095W83GplxhY51BvH3tS9wQ/JtKiZBiTNVa8Dbn1DAP12zeUXa38GctKEt097EwsHa513Rrbl+F4sU0YcVa+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jJVy2iJ+L1kYIu1EQmCly+qY8u35DNnIQ/nh7FvkJ8Q=; b=M0mjkOMbnVfolyArbEa/SV7kkD7rRhb79AM/ReDP5y4EIKdR4Bsk7H99ZVIFYTXkM+WCVebDTWbqyLeaoXqrZTyZwhy9v0s4vrd5+GTOT3EcjkxIjJGqoY+Yyb0K6n29bPbyfBk2SA5G+mCCOyFv1v5QQqaTOAc8P8guEwhAyVjFznpzOzpeEaeTbuveGFdeCHaYVwoYBn94zF6AOdPXDbsWEY5bf8YitmGWR1dpH/30HE7CbBiT2bQ/3sNs/z5rxcPiK8bHC8/VmoOBdqz/Bl58G+jd9qmDa18H12Ac1N7DMrRtCyZrh2Z4gs+n8sgiLB9cVQCuKShVFEr0o/0Z7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sealevel.com; dmarc=pass action=none header.from=sealevel.com; dkim=pass header.d=sealevel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sealevel.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jJVy2iJ+L1kYIu1EQmCly+qY8u35DNnIQ/nh7FvkJ8Q=; b=lDuy4DVGyIMOoB9AavxlR99MLNSd6F4CEoMxorkv+zLMSWFTwGso6kjHBrfIYstMTzb/AojIsFY9URaWFOW8bF4GP7RODypk9oxMUrjxe70mnY3IariClUSR7Tn8o1ArHhb02/vLN53rFOrvHsPT1DxZNN8YNKmiKugK6XgLwOJiwVuzCZIXZlLxkLlZZH5bfPuE2ewk/49i7wXhRCIHaTukZ74xn9ozaWEsFYfwX+R/YxFj0+AygYIrWtlmILEnInzivzk8/+UDE4p3uuhBx+F0cnSo6rEIjE2GRurEyQujWKlIXvXb4+SFAGnFNSQG91psEB1JNMovGFlzVyXUCw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=sealevel.com; Received: from CO1PR05MB8426.namprd05.prod.outlook.com (2603:10b6:303:e5::11) by PH7PR05MB9978.namprd05.prod.outlook.com (2603:10b6:510:1b9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.18; Wed, 30 Aug 2023 15:05:54 +0000 Received: from CO1PR05MB8426.namprd05.prod.outlook.com ([fe80::2d74:e628:e394:6669]) by CO1PR05MB8426.namprd05.prod.outlook.com ([fe80::2d74:e628:e394:6669%4]) with mapi id 15.20.6699.035; Wed, 30 Aug 2023 15:05:54 +0000 Date: Wed, 30 Aug 2023 11:05:51 -0400 (EDT) From: Matthew Howell To: gregkh@linuxfoundation.org cc: linux-serial@vger.kernel.org, jeff.baldwin@sealevel.com, james.olson@sealevel.com, ryan.wenglarz@sealevel.com, darren.beeson@sealevel.com, matthew.howell@sealevel.com Subject: [PATCH V2 1/2] serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" Message-ID: X-ClientProxiedBy: BN9PR03CA0127.namprd03.prod.outlook.com (2603:10b6:408:fe::12) To CO1PR05MB8426.namprd05.prod.outlook.com (2603:10b6:303:e5::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR05MB8426:EE_|PH7PR05MB9978:EE_ X-MS-Office365-Filtering-Correlation-Id: 788894f5-4f03-4e13-a9cf-08dba96a9b58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XekguSIOOsc6Cb74twSeZlCGuOLsUI7YMHi21SZ2rJKbHfrgv88gGDeKd0R+cbbNcTU3xs5NlmaCbFDt+P4ocpIStbHtkQCbDV99uvNHhfMUP2ACaDb5r0bRVc3WvPpgXNUfkGdCqnyiaNAO0iduRRHDNcJrPg4AQiDlL6GS01HgsPOR4JjS9V8mwf24f/ZuXdr8sZyRK2fg5QHN8F5oMr8b07ltx4HI2igIf0ourKvCZ68u3wDHnCMZCvEsZpyM5hMmYIv9SW+oskk3OgPz0lLhHDUJhCHXdUQHhvpoXDX0woF6k1dmtjiK8ueCjFZF0DVlwlrabOI16ZOkRzObY0SoVDXtUNzwDZuFDhpXD9UkH6QhQXTLU6NK5deDU1zYxZcqO1weK+VXtNOcr2jFauvXdI8fA7w/TtsilZdcUv+xnDqEUBqVt0hgfzs1mwW9JzGSDdNOhrXpUxqkpWsrzlU5Nhjw3adc7oWpa9SjATj5VCFyNbyEW6ER4tY0bIX8KPePD/FLZpaojFbnhS+rq5nF1xT4UeCAYcRy8Xh5HySQIbw5NfvahI3ePFKqEjGm3Ust2cpw58Cj9yR645pZ69fyJSq6uz/+fVVYEoY8qhE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR05MB8426.namprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(136003)(366004)(376002)(39850400004)(186009)(1800799009)(451199024)(8936002)(6666004)(478600001)(66946007)(66556008)(66476007)(6486002)(6506007)(966005)(6512007)(6916009)(316002)(41300700001)(38100700002)(36756003)(8676002)(26005)(44832011)(5660300002)(2616005)(86362001)(107886003)(2906002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gcwBUZph38uFqqwmxrssZMumZoA4k5H4vQ6yRS9N6chHJ5JkRLJB/thmhduiVGFMonS7y+HFJDXtgce21Kmdeow54pesZOE25CKc6I4QfqkRYPIDCFNWZ2Yi/bfq1/ietd19k4j/cQ+Mls1uZbSiil2ul7kJNlzy+/9iK2H71p847tFZ2PEZGcUHNUrQo3eRG7Uk2HBZL/vZjJ1fy8x3kp9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rHD0GDcv0G4D3up9hBJ6aZCFGe18sw+CDZHWppnys4vgrKP1GqsFwmOm9fXKd6/qzu4opUKzT++dQ8rjgU0cwx+1F1L4SrSuiupCp9OlBx5rMQcz1pQxN1jQjaZzscLcwwWn6fnecxEEZHvqDhALykMotJu1Wk4TBMF4f4/i3GuFzZmeYP/i7o6XBminWKHM9VHofvOTUZbxAdD8S+lMP0kw5O7jpqnvs9jpUdiHsZzdj+I0PliIhjSTqORtTlj/5a3C29bPfz7llSp0oMBEhsnpU919TLu3bmsg7nMb9SCcxcHxhWqfDP0Dy+6A== X-OriginatorOrg: sealevel.com X-MS-Exchange-CrossTenant-Network-Message-Id: 788894f5-4f03-4e13-a9cf-08dba96a9b58 X-MS-Exchange-CrossTenant-AuthSource: CO1PR05MB8426.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 15:05:54.3180 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e34c5615-b4e3-481c-abc8-602581f2e735 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b4uBFpV5Y+0zI7xuD5MApgf45a7AD4/ZVR5FBj+FxgqQ0BgkfzJYdf7PGJy8HJZKR0k6aoio5ufFuqpXgBGGWD3n60Y24BJii4oELdZXJ+A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR05MB9978 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Matthew Howell Hardware ID of Sealevel 7xxxC cards changed prior to release, rendering the previous commit redundant. Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" This reverts commit 14ee78d5932afeb710c8305196a676a715bfdea8. Link: https://lore.kernel.org/linux-serial/687157c-3d18-e18b-1936-f3f5b98ae760@sealevel.com/ Fixes: 14ee78d5932a ("Add support for Sealevel 7xxxC serial cards") Signed-off-by: Matthew Howell diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 077c3ba3539e..3886f78ecbbf 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -47,12 +47,6 @@ #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 -#define PCI_DEVICE_ID_SEALEVEL_780xC 0x1008 -#define PCI_DEVICE_ID_SEALEVEL_716xC 0x1010 - #define UART_EXAR_INT0 0x80 #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */ #define UART_EXAR_SLEEP 0x8b /* Sleep mode */ @@ -652,8 +646,6 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1); else if (board->num_ports) nr_ports = board->num_ports; - else if (pcidev->vendor == PCI_VENDOR_ID_SEALEVEL) - nr_ports = pcidev->device & 0xff; else nr_ports = pcidev->device & 0x0f; @@ -893,12 +885,6 @@ static const struct pci_device_id exar_pci_tbl[] = { 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), { 0, } }; MODULE_DEVICE_TABLE(pci, exar_pci_tbl); From patchwork Wed Aug 30 15:08:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Howell X-Patchwork-Id: 718935 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 216B4C83F26 for ; Wed, 30 Aug 2023 18:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbjH3Sif (ORCPT ); Wed, 30 Aug 2023 14:38:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245313AbjH3PIi (ORCPT ); Wed, 30 Aug 2023 11:08:38 -0400 Received: from CY4PR02CU008.outbound.protection.outlook.com (mail-westcentralusazhn15012016.outbound.protection.outlook.com [52.102.133.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C60E8 for ; Wed, 30 Aug 2023 08:08:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CGvbk2b4ujIfrAiWm5SWTJ6F29gC3H0sWgr3IGgwORoSGfGg3KLV29sBtkkrA0t7WKAoqbeGs8vfCy95qRl9UMTRulFHlwf21s0HeRClP00urSHdS6yUHcZQhO/okdZkqRsHl3kPabvh1MeBIR2ym2oaEifhiSvoSZLddMl9//CWazTeHHUzE7aavSV3LKcRD64RnXC2eirwAW1DJACOmLUxWQVlPqD8VSq1pFHurWvEfDqALZBdZ3hmMmkr1kx0gGfZIx/hDK3F0lA49OtJSNorXY4m5eNFQa1xCeLmY4/rn4aV237RaZt/hyD/aM/FXbDCJXJ6shiXBl13TiKfGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lEtkzRpj2y6mfzf1UqF92+KHLCnmECGv8pA/H4BJ7yY=; b=CjeE5yP6oayB64zvHcR64Kbu0aZU7j4QzOUGmyIwxYdrM2D6LaeIVYlPzBdhbRHva2qAYbllHQSyFq5uRQXEle2DXb6LGqDtRn9pdhcOZaq8zPoifhEWyJxj0Huq1f2SUQH/ZhTzWC3FJrGf+l5qX4l7NR3pDhascmI60XKF83uxO8t3d1w0TtrF8wavRndTLF2FsT1Lw5IOUdCRL50gSd6D1SLTvZ1nRKj2jincm/45q2lWaNPHkOvpCBOrca80OZX/HLWpj6yF7eT2SrkoH9k3+vtXmgqXqfwzPepqPeV0sbkdoUqHv/fe7U1k4iJPDDcY4gc+eaNOyAchDTrD5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=sealevel.com; dmarc=pass action=none header.from=sealevel.com; dkim=pass header.d=sealevel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sealevel.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lEtkzRpj2y6mfzf1UqF92+KHLCnmECGv8pA/H4BJ7yY=; b=i/bcL9GhuhsUPALUSWj2VCVt2BGbii1YgXujVbBkSFlX+2bPCMWduZFm+Apz48Fc6t/pEDNvhioCg+NaIrEU6+6cWRKAneYKWMfvAG0hLiyABRZkCt1wNqMdI55CA0+zUblnDyn27HOjSfe2qdSCOlfX9VRGyNMiCnav1pgM1hoBze6bHRCUop388ZvoforIqLtLqARNYkmzwp0DYNBMlXDu/7mVhpzV22eEh12dekHw6us+ZbQM0lwLH862IHV7SiSFD3tAERbjPLEYZ4fFaLZt0tP4rkUIYPGM2HiBbRFtU8uqam7d/RarZih2ICZlOs0vnMCxQmAWDCqEmvBXeg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=sealevel.com; Received: from CO1PR05MB8426.namprd05.prod.outlook.com (2603:10b6:303:e5::11) by BY3PR05MB7986.namprd05.prod.outlook.com (2603:10b6:a03:367::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.20; Wed, 30 Aug 2023 15:08:31 +0000 Received: from CO1PR05MB8426.namprd05.prod.outlook.com ([fe80::2d74:e628:e394:6669]) by CO1PR05MB8426.namprd05.prod.outlook.com ([fe80::2d74:e628:e394:6669%4]) with mapi id 15.20.6699.035; Wed, 30 Aug 2023 15:08:31 +0000 Date: Wed, 30 Aug 2023 11:08:28 -0400 (EDT) From: Matthew Howell To: Matthew Howell cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, jeff.baldwin@sealevel.com, james.olson@sealevel.com, ryan.wenglarz@sealevel.com, darren.beeson@sealevel.com, ilpo.jarvinen@linux.intel.com Subject: [PATCH V2 2/2] serial: exar: Add RS-485 support for Sealevel XR17V35X based cards In-Reply-To: Message-ID: <9fcbbcb5-5e54-d3b7-3d28-7b50215a580@sealevel.com> References: X-ClientProxiedBy: BN0PR04CA0124.namprd04.prod.outlook.com (2603:10b6:408:ed::9) To CO1PR05MB8426.namprd05.prod.outlook.com (2603:10b6:303:e5::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR05MB8426:EE_|BY3PR05MB7986:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f8d1c14-6969-4539-e34c-08dba96af915 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: txFSKOzaqEZ5/W0vC9OmtB/iVgCYQxfqNikxBQJ3OxiDoTYKfIggISO0AO8NLLTAc6wXMaA3tQ9vfI8c1v2vwH7mrn0u6EpLWd5t1zKcBgOpG43t3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:CO1PR05MB8426.namprd05.prod.outlook.com; PTR:; CAT:OSPM; SFS:(13230031)(136003)(366004)(376002)(346002)(396003)(39850400004)(186009)(451199024)(1800799009)(66556008)(66476007)(37006003)(316002)(66946007)(478600001)(38100700002)(2906002)(86362001)(6200100001)(8936002)(6862004)(41300700001)(4326008)(5660300002)(44832011)(2616005)(83380400001)(8676002)(6512007)(6486002)(6666004)(26005)(6506007)(36756003)(58440200007)(45980500001); DIR:OUT; SFP:1501; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E6+lEtugx0E74/P3KSTPOiXiOKvPSllU9mMTmZCwkmewnaoGfNdLXj5AXqIOyQhge8cobfS9lyWWfv2zcOUrxxu8mXKS55jcOFEKhXwW+pFTNT6SbKq7l7J4E/YGaUcQuXlO+TwdT7w1oIFbWJzZRXu0pLiM9uMlgdFDTTxHkEptXo8/Z/n/mQeB7EGfQr/D7huzX9ExBPeH0xr4FyXb46coYVtmrwXMxAoeohXozk3jiL+Fi/dUo9jNiZtatQRmLQdZTxwy6nvm3OuE/pruhuFbXHd/WaOjTlHPwzlKZ7gYdz9yIzzQyYo8wRicjPsoJN1tUxBlzRJrvibs6NhIGTXaPu+REH8TO3CCorRjwsrJcOUIg/NGCMkcaEX98i8rejHqSlf6+4FGY6s5r5QNYxEfo4y+CqagcqBQT7c+mVbMtR9yOXlO8+CMqDZ1RF0tDcZ5vzMG/vfUW4qVxc5kZUKJtLIRzCaapu34QnJnHozyJRX6ihdyJ2MeijxqGW+YV2OYiVaKTNZqhL8EbLftkdfYK3N3CfTATMAcWUxQNf8aqviaItaEUeuuU0A6DWd6babOVbmHsQmnTTMRAAWq3vs3IO6q9xainHTJmqC/9atA6icoTpqzmYxiEPIscQt96uCff6cf66yxsjTtNb4lnj59A+tNpmTjlGgFoINxDKwuSEj3IAMhZYbyp5CDAnDImx4RovAltmMcJfNHfy4njGrBcUiQO/wU3t7PrVKBCZ4gqb2xxCdgd5VEmWXI5+8XAOu6zjFe5PH5ILDaZALaoHHdptzT374BDq+BQ01kz69KP2JLQ/zaw3z+o2dzl6Noug4CqYPwJqoAAAhyAZAZqVzy7JRfmUbCIEFTc5/V1P7yj+nt5hFcL7d1h1Fjh+tZzP+3MSWLvLmnK7WjzLheLH2LiH/7eqmqhEvHT5Nnw8gu3vLGDzMjhCWCKvQ4rm6s9AVWenYmLXtVs1hT0Vb4bXJb+WI1LgQOWR1REvydko+LQhIO2kABqhtFblO28cYLlW1ixGR30Fe3O/LW1QwVSdCYNxsmWfSYjIeZs651c+IDBAgS40pzxi6Fx/uiuatA+Zb8oO0ZnYUK1Ic5zZMPq/orRQUpLxPYp+Vwq8d1J3Er1zfQj/udELKRVHcLkreU3nNFP3iGqHjKoUI5OZo5OFt+nBGEF4gzwngVdnYszvoUBwgjxEj/cU9SG7UZTcQmOb8ReZz5n3d3NZ0zVVPKSRmQvjlqnYOARUDYONZE47UBQyjMkooTx0ghmOzFYNHmN2HH1UxLvpVabCTtOGHVZRssMefoguWBofMKNUN40IeAF2TxSg05BdqwLSXvCEcb3+rE3ndV021ABEyssZJxcD70WWDVTzg1+gzLp9vjDX38aJEoyH2YGxtGaS3CaBbHMeZlPW7GPyY7iCj+cvmBMxD5EyVkDVpsK7KSw5+kv97s8U7m7ScgLEBZ28sSb0KN27IxbI13W4IBEkbBnDmUI+QNcyxzCmHG6BWQ5QkLu8ArJulNsSl5LselxK4OcQUrOqPCJ1gzHM/g7Nbe2uzT8Xknr0ubsZPyrBd2GWpYVVg0j1T7xGLHOjsNJwxXfDcFnddxFtEg0QDbO8wuYAJXsw== X-OriginatorOrg: sealevel.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f8d1c14-6969-4539-e34c-08dba96af915 X-MS-Exchange-CrossTenant-AuthSource: CO1PR05MB8426.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 15:08:31.4917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e34c5615-b4e3-481c-abc8-602581f2e735 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XM+qZF388qNEtxyK0S2ZhTJGL0CpaJH1lQkm5I73TbNUjZzZm/JVVOf9poS0G4Zvfs+oQkgoaNC5ZNOYEfXfgu96zQQ4zRjkEi7XKWvYpeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR05MB7986 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Matthew Howell Sealevel XR1735X based cards utilize DTR to control RS-485 Enable, but the current implementation of 8250_exar uses RTS for the auto-RS485-Enable mode of the XR17V35X UARTs. This patch applies a new sealevel_rs485_config function to configure the XR17V35X of Sealevel cards for DTR control of RS485 Enable. Based on feedback from the first submission I replaced the hex values with defines and fixed up various format issues. I couldn't find an existing define for the DLD register or its RS485 Polarity bit so I created a new define. I tried to follow the format of the other defines in serial_reg.h. Signed-off-by: Matthew Howell diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 3886f78ecbbf..2fd2bbf9364f 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -439,6 +439,35 @@ static int generic_rs485_config(struct uart_port *port, struct ktermios *termios return 0; } +static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termios, + struct serial_rs485 *rs485) +{ + bool is_rs485 = !!(rs485->flags & SER_RS485_ENABLED); + u8 __iomem *p = port->membase; + u8 old_lcr; + + generic_rs485_config(port, termios, rs485); + + if (is_rs485) { + // Set EFR[4]=1 to enable enhanced feature registers + writeb(readb(p + UART_XR_EFR) | UART_EFR_ECB, p + UART_XR_EFR); + + // Set MCR to use DTR as Auto-RS485 Enable signal + writeb(UART_MCR_OUT1, p + UART_MCR); + + // Store original LCR and set LCR[7]=1 to enable access to DLD register + old_lcr = readb(p + UART_LCR); + writeb(old_lcr | UART_LCR_DLAB, p + UART_LCR); + + // Set DLD[7]=1 for inverted RS485 Enable logic + writeb(readb(p + UART_DLD) | UART_DLD_485_POLARITY, p + UART_DLD); + + writeb(old_lcr, p + UART_LCR); + } + + return 0; + } + static const struct serial_rs485 generic_rs485_supported = { .flags = SER_RS485_ENABLED, }; @@ -744,6 +773,19 @@ static int __maybe_unused exar_resume(struct device *dev) return 0; } +static int pci_sealevel_setup(struct exar8250 *priv, struct pci_dev *pcidev, + struct uart_8250_port *port, int idx) +{ + int ret = pci_xr17v35x_setup(priv, pcidev, port, idx); + + if (ret) + return ret; + + port->port.rs485_config = sealevel_rs485_config; + + return ret; +} + static SIMPLE_DEV_PM_OPS(exar_pci_pm, exar_suspend, exar_resume); static const struct exar8250_board pbn_fastcom335_2 = { @@ -809,6 +851,17 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { .exit = pci_xr17v35x_exit, }; +static const struct exar8250_board pbn_sealevel = { + .setup = pci_sealevel_setup, + .exit = pci_xr17v35x_exit, +}; + +static const struct exar8250_board pbn_sealevel_16 = { + .num_ports = 16, + .setup = pci_sealevel_setup, + .exit = pci_xr17v35x_exit, +}; + #define CONNECT_DEVICE(devid, sdevid, bd) { \ PCI_DEVICE_SUB( \ PCI_VENDOR_ID_EXAR, \ @@ -838,6 +891,15 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { (kernel_ulong_t)&bd \ } +#define SEALEVEL_DEVICE(devid, bd) { \ + PCI_DEVICE_SUB( \ + PCI_VENDOR_ID_EXAR, \ + PCI_DEVICE_ID_EXAR_##devid, \ + PCI_VENDOR_ID_SEALEVEL, \ + PCI_ANY_ID), 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), @@ -860,6 +922,12 @@ static const struct pci_device_id exar_pci_tbl[] = { CONNECT_DEVICE(XR17C154, UART_4_485, pbn_connect), CONNECT_DEVICE(XR17C158, UART_8_485, pbn_connect), + SEALEVEL_DEVICE(XR17V352, pbn_sealevel), + SEALEVEL_DEVICE(XR17V354, pbn_sealevel), + SEALEVEL_DEVICE(XR17V358, pbn_sealevel), + SEALEVEL_DEVICE(XR17V4358, pbn_sealevel_16), + SEALEVEL_DEVICE(XR17V8358, pbn_sealevel_16), + IBM_DEVICE(XR17C152, SATURN_SERIAL_ONE_PORT, pbn_exar_ibm_saturn), /* USRobotics USR298x-OEM PCI Modems */ @@ -885,6 +953,7 @@ static const struct pci_device_id exar_pci_tbl[] = { EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4), EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4), EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8), + { 0, } }; MODULE_DEVICE_TABLE(pci, exar_pci_tbl); diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h index 08b3527e1b93..188c5032f218 100644 --- a/include/uapi/linux/serial_reg.h +++ b/include/uapi/linux/serial_reg.h @@ -164,6 +164,8 @@ */ #define UART_DLL 0 /* Out: Divisor Latch Low */ #define UART_DLM 1 /* Out: Divisor Latch High */ +#define UART_DLD 2 /* Divisor Fractional */ +#define UART_DLD_485_POLARITY 0x80 /* RS-485 Enable Signal Polarity */ #define UART_DIV_MAX 0xFFFF /* Max divisor value */ /*