From patchwork Wed Jan 10 11:11:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manikanta Guntupalli X-Patchwork-Id: 13516015 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97F7CC4707B for ; Wed, 10 Jan 2024 11:27:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/pAqBeapatmJZiQsp9i9kHQ31evHaLSEYq+EnM5Lopk=; b=dX6AB8iokAD/tA D+7m5ALDexojPscn/ed//O70ELyUTI9BSJIBCi7eddcNUTuAMHSEveyvp2KvEVpjnFpK4xNXKOW12 RAw4TLPg9Qtstt0oAvL1xajkMFvUSK1UzUGLoeXd9or0vnU22Y+Xr7UpojKfpPY/DAJIUlZeGZ7b+ +HzcPBsnCsXr5oQ45khD7EAgX7oyWPfJqp6t32F+6R+3upNm5/Nw2Yv/Mnek/8+W3kjth5nuBrWDy W9B+dFtNIaKrgFjsOl4WuAPjG8U2vj762bi0FZ/GOaKvICMqJQsnrvECLLxYEFQVvPYV8+B+JXhN4 vKl0S1UrLveELKse/kMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNWjB-00BHQK-0g; Wed, 10 Jan 2024 11:26:33 +0000 Received: from mail-dm6nam04on20600.outbound.protection.outlook.com ([2a01:111:f403:2409::600] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rNWj5-00BHIp-04 for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 11:26:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBVGXO3fspjm41Oii85eA7cPCOC5r6Ff6XJz5OVjS9riNHet4MQdGwBp2Ibu8o+AfNHrH/HbJPneVLw9QzK6GUFUIKG2JOyX8Mlxd+inzr8Wy7IDCyurwujyGb0KlpV3qoiY6dOoMmPFoReuhOFDB7dPhFHWwnfiSoUJkvLkICluBPeB4IKYvu5ygwb5eubcki5F/eOqRt7yTWfipQLp+pDcSmoz6FquN+YhOJoDFyZiBwnRonQe5nft5Tuci6fyo5xD7sZYsC59CVTElZ6OTPA+kr9N4k2xBS9vdEMrgGyu0mXKj9EoHz1oJYyJMusOldc/PVb+J8DYoZ73PnSR8A== 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=PggO/CIE7RzqqtiQPmq1qBWNVywZYffCBedCKdYKkuo=; b=AosOeqi0tUc9Z3M41DA7tPLzL6bS4e3tHkQU5vX72u0wA3fTipHxafY4wLd8yEvn8+4hjkCAQc8WNS2Tlt2vq3xplMI7cDo+ZnyUxR/PNFjfjdkAUBeAAS7pzJa+RKonJoJBnloU+sEAqprBuTfSefOAi6na/VO127EXllpGXopFDEAntQb+NIQpOYc9KrLIitfGZzoKC8fV/jsFnAOLufxf/f8JsEJRtl9lCGYmw1hMOXio78HMWXRFmTHPs5oLbZQJZOnZHsP7psqHW+hS0tGeL6jcDR6cF6Tww0FRpLV5HhgolglSh3rJFV1eXVFdVOojZrgyk/dT3EtBIQFmhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PggO/CIE7RzqqtiQPmq1qBWNVywZYffCBedCKdYKkuo=; b=zn0iNtWWvNehAyirBDRhn2H7E9sQDQZSn9c2UOwpzaGSJ+uM3ctTENATB271DZnqCG2iGDRvsn5M+VEc0rTjzho9lEaX7xs3LP+9xo4F154Otm+xuQysl0e2owohdbAm2NyTZbXMRW4dKS7UXgg2wtYVybECx+1OEo/IjdG73Pc= Received: from CY5P221CA0125.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:1f::31) by BN9PR12MB5195.namprd12.prod.outlook.com (2603:10b6:408:11c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Wed, 10 Jan 2024 11:11:58 +0000 Received: from CY4PEPF0000E9CE.namprd03.prod.outlook.com (2603:10b6:930:1f:cafe::70) by CY5P221CA0125.outlook.office365.com (2603:10b6:930:1f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17 via Frontend Transport; Wed, 10 Jan 2024 11:11:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9CE.mail.protection.outlook.com (10.167.241.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Wed, 10 Jan 2024 11:11:57 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 05:11:57 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 10 Jan 2024 05:11:56 -0600 Received: from xhdsgoud40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Wed, 10 Jan 2024 05:11:52 -0600 From: Manikanta Guntupalli To: , , , , , , , , , , CC: , , , , Manikanta Guntupalli Subject: [PATCH V8 2/3] tty: serial: uartps: Relocate cdns_uart_tx_empty to facilitate rs485 Date: Wed, 10 Jan 2024 16:41:06 +0530 Message-ID: <20240110111107.3645284-3-manikanta.guntupalli@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240110111107.3645284-1-manikanta.guntupalli@amd.com> References: <20240110111107.3645284-1-manikanta.guntupalli@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CE:EE_|BN9PR12MB5195:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a06ca67-5565-4cde-a2ba-08dc11ccf61a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4w9xn4qfVTtmzTmW9iRMuMFZP0dXeiEQlHJ5Yy7+3LXoCUY3VZvlP4Uu6ChK2gPBx8DJ0BQQkUp0Tw4QAGJgkJOL7ztX5vpHRRWyp9WwRogAa4LyNqmyD4IYZpfiMaumA9Vwcml0+GWQ3dkP9K9qX/7MCJnpoUijXporrvXI+zPcYOK+mnZAqrlHTkVHQ/LcKzZE//ee7yYKYT1g37keThXxwtyHBZckXENmVyjXWJYQTyygvIijw5jUK4pnuwVM7MWgbpHNg5QE7cbWiH+/zH/kVXiZ9G/NCB2xyoY55fU0S1U92ctS1e8Qd8ECdTSt9ZFGZcmpfcU/p9kHgwlFzBQf5W4bhV0/WxvMw+b0kWuaDxOS4ak+5IYmpAu7bDAAOa8cX+PjeEBGosIjkxAn+h/G1zG0UwGfV73Xb0jJBCafcz3AgrMXoXSKKGpeJBEVArxhCvOzepCKLf1wzeO+dIMLjAr5+tk6XUN3k5px0RNbAwB434pRS422TB5NofcgeZtiHpYh6Xo4H30MLsAXijFeLkYGE+Q+0UkWXQXW+VTpVi59zsi11eHhvQg06F7yZtN9MbyV98AQ7XoBUfejpA2+AjNSwWCCbuYhle9A01z8XiMkI1zhHfUhB8KJI3He66cInlFkjYSlqIH58rEcO8ZcQpJJxdgb+VV8i0SNWHrGvMAwJsLz83tCWjLVyMKhCnPsvAAMWUsRAq6alY9socreESOga+eOchQGklQPXyyA/YBN3L1Eg2Stc+9HpizJZB107FeKkZiIP/Tq7mZCsOGYNE57H6hkz1ICNGkyEzg= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(136003)(396003)(346002)(230922051799003)(82310400011)(1800799012)(186009)(64100799003)(451199024)(46966006)(40470700004)(36840700001)(70206006)(70586007)(54906003)(2616005)(40480700001)(40460700003)(26005)(110136005)(316002)(44832011)(8676002)(8936002)(1076003)(4326008)(83380400001)(336012)(426003)(6666004)(5660300002)(2906002)(47076005)(478600001)(7416002)(36860700001)(82740400003)(921011)(86362001)(41300700001)(356005)(81166007)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2024 11:11:57.8615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a06ca67-5565-4cde-a2ba-08dc11ccf61a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9CE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5195 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_032627_100103_B5D2876C X-CRM114-Status: GOOD ( 13.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Relocate cdns_uart_tx_empty function to avoid prototype statement in rs485 changes. Signed-off-by: Manikanta Guntupalli --- Changes since V4: This patch introduced in V4. Changes for V5: None. Changes for V6: None. Changes for V7: None. Changes for V8: None. --- drivers/tty/serial/xilinx_uartps.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 920762d7b4a4..aafcc2179e0e 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -305,6 +305,21 @@ static void cdns_uart_handle_rx(void *dev_id, unsigned int isrstatus) tty_flip_buffer_push(&port->state->port); } +/** + * cdns_uart_tx_empty - Check whether TX is empty + * @port: Handle to the uart port structure + * + * Return: TIOCSER_TEMT on success, 0 otherwise + */ +static unsigned int cdns_uart_tx_empty(struct uart_port *port) +{ + unsigned int status; + + status = readl(port->membase + CDNS_UART_SR); + status &= (CDNS_UART_SR_TXEMPTY | CDNS_UART_SR_TACTIVE); + return (status == CDNS_UART_SR_TXEMPTY) ? TIOCSER_TEMT : 0; +} + /** * cdns_uart_handle_tx - Handle the bytes to be Txed. * @dev_id: Id of the UART port @@ -626,21 +641,6 @@ static void cdns_uart_stop_rx(struct uart_port *port) writel(regval, port->membase + CDNS_UART_CR); } -/** - * cdns_uart_tx_empty - Check whether TX is empty - * @port: Handle to the uart port structure - * - * Return: TIOCSER_TEMT on success, 0 otherwise - */ -static unsigned int cdns_uart_tx_empty(struct uart_port *port) -{ - unsigned int status; - - status = readl(port->membase + CDNS_UART_SR) & - (CDNS_UART_SR_TXEMPTY | CDNS_UART_SR_TACTIVE); - return (status == CDNS_UART_SR_TXEMPTY) ? TIOCSER_TEMT : 0; -} - /** * cdns_uart_break_ctl - Based on the input ctl we have to start or stop * transmitting char breaks