Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3838642pxj; Tue, 11 May 2021 13:03:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCIBgw8ZbreiCnbbjHG5fj+8t7GhKGuLO9RdkzucS+jhcm7uVqcErXfP3Ih50aeg2a6Is4 X-Received: by 2002:aa7:c2cc:: with SMTP id m12mr38723610edp.1.1620763434960; Tue, 11 May 2021 13:03:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620763434; cv=none; d=google.com; s=arc-20160816; b=ZKeDuUVL5neapD+FPXBFBaPBgmp/D2m5Gaqf9k7/Kd1+bwFix/d4j4XB8JvXdbEO46 /sWy7guVb8BzXSS7aylX92CsnZ/Sq5Qk+PjWuV4k4tGDRosGAn36R0se+gRTLjsjFWxm Nj65+pALTmzMoX2awvs4lUW0ZA/5qbXHXrBI+TOOfKX5dMdJF/w6bTYUrv/CUC6+deM7 q7Q4HP/Bx9bShNYayoAPchqIVyetw0nzNaKSsE26GOl64KbJraWdAYBG7oYtXuOz9BX2 fyBUXt0sFxMt2VKWOxC9nxdU64Auw8NxNV6K7fxnRQovMuKjEVcunLD2VFPyuikQQcLh n5RA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VZTjCem//lORsrW2aZZoL2zcRsJc/XV9BfrVa5PsRBI=; b=RosI9y68H2ewySfZm61qUofAKhWgEYO8TcgfhazyrclI1XMTXU0oRUdWA4RtoZtiY9 +XIaTs9VfUJ5Flf4cJTNOtPCyDydS4rXQgfXpBx3JCsTIBAuO98QJDhD8S/0TmYzh3mQ 0ILmsSZ15yT+4eHY52N1NKmRZb8quBpZW91Ydu2XvHzw4yN16GO4OTr2dTnPlGVojg2X 6rdG9uYc0pHa64gF+HVNWOEx0Sim+owW0InKqQsHSUFyVcaBPf8uZ94keNZuttXMeBMt u3WUDmClGtcqjjjvoPjfy7wu6xm4XHlY/coElqB8Ro9yG7zFovVc5H/i6RQwCsMb/6Gq M6Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=hHxWv6YV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si21669154ejj.74.2021.05.11.13.03.31; Tue, 11 May 2021 13:03:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=hHxWv6YV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbhEKUDX (ORCPT + 99 others); Tue, 11 May 2021 16:03:23 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:41649 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbhEKUDM (ORCPT ); Tue, 11 May 2021 16:03:12 -0400 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 60FA722276; Tue, 11 May 2021 22:02:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620763324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VZTjCem//lORsrW2aZZoL2zcRsJc/XV9BfrVa5PsRBI=; b=hHxWv6YV92fZn+rC9QP1lob/Jr3OhT3DhKB9PJTedMG8bOi/Ohjpz3W/ufXDDewjVeGvVI q4n7fUlaUOEnv3qgVR/FzDjqb7KZDBRP1mI8Zxc3QlOKFqWx5WVGQPOKn4HXMobUtRF3uA efLbbWb1nSQ5oBUNHfd8FUBfOcRTBR4= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Fugang Duan , Philippe Schenker , Michael Walle Subject: [PATCH 6/8] serial: fsl_lpuart: remove manual RTSCTS control from 8-bit LPUART Date: Tue, 11 May 2021 22:01:46 +0200 Message-Id: <20210511200148.11934-7-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210511200148.11934-1-michael@walle.cc> References: <20210511200148.11934-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The LPUART doesn't have the ability to control the RTS or CTS line manually. Instead it will set it automatically when data is send or handle it when data is received. Thus drop the wrong code in set_mctrl. For the 32 bit version this was already done in the commit 2b30efe2e88a ("tty: serial: lpuart: Remove unnecessary code from set_mctrl"). Keep the 8-bit version in sync and remove it there, too. Signed-off-by: Michael Walle --- drivers/tty/serial/fsl_lpuart.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 74c04dba02d4..19714047d571 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1403,17 +1403,7 @@ static int lpuart32_config_rs485(struct uart_port *port, static unsigned int lpuart_get_mctrl(struct uart_port *port) { - unsigned int temp = 0; - unsigned char reg; - - reg = readb(port->membase + UARTMODEM); - if (reg & UARTMODEM_TXCTSE) - temp |= TIOCM_CTS; - - if (reg & UARTMODEM_RXRTSE) - temp |= TIOCM_RTS; - - return temp; + return 0; } static unsigned int lpuart32_get_mctrl(struct uart_port *port) @@ -1423,23 +1413,7 @@ static unsigned int lpuart32_get_mctrl(struct uart_port *port) static void lpuart_set_mctrl(struct uart_port *port, unsigned int mctrl) { - unsigned char temp; - struct lpuart_port *sport = container_of(port, - struct lpuart_port, port); - - /* Make sure RXRTSE bit is not set when RS485 is enabled */ - if (!(sport->port.rs485.flags & SER_RS485_ENABLED)) { - temp = readb(sport->port.membase + UARTMODEM) & - ~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE); - - if (mctrl & TIOCM_RTS) - temp |= UARTMODEM_RXRTSE; - if (mctrl & TIOCM_CTS) - temp |= UARTMODEM_TXCTSE; - - writeb(temp, port->membase + UARTMODEM); - } } static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl) -- 2.20.1