Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4514812pxj; Wed, 12 May 2021 07:16:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvkJUAUQp+XESekYB51FUQPFe59jGv3q0FZ8oIuA7fU6tHooqqChVRMan2Ze8NcZPqyOFT X-Received: by 2002:a2e:5347:: with SMTP id t7mr22094791ljd.464.1620829016115; Wed, 12 May 2021 07:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620829016; cv=none; d=google.com; s=arc-20160816; b=cRBsdC3+6n437gv9FFtDtSn8j4K9DyTZYOMZ25nEw1mSgxRQbKnzKayjAjvnfpgud5 T35P0U2GU7tLW9Ta+ThxMdqc1mNgkVllGSwRjnSn1U1TVRhiSWG5I6vsjrxLGtUfJ0jv xPc9uEHOJ2YLUbYge7E+o6AKmwkxIyyOeGKlCQ/kryqc5cS1Ph0ijpPUtqt5mXCaB81N Xq2VaWsEa7OdOo192rbLjQXDAB83+V7NQlTKFisOnwqeUw6Y1mFdhFwVgd3S+DX1G4nl rIZMHdvI2Ir7oxPhoeXrfhDK5nk/yU24zsaSdJqra6vuZXqLUNMKRYkNSJlelrpPBYls q1XA== 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=Sewi2+aBhItqdGTW2X5Wm+o52DKdoIQIptJXp+P4NDg=; b=sYlWtDuxrnSQrdtZ2YKh1kPq4+b+4bwrBMyKBFTO8yzQQZCxnaQ5qI1OVjJUd44AqR RJVIecdDKSenO3FOOyO4kDCRuiH7go5tjVjJdHkN3cp4rYb9MfW2R6e+Kr2aOYzumF+0 ggaPfwZvSDVDyJa3e22Y5j8DNLYUurhAl1azhAnJJ2zEzdfFB7cuMxzOtpLaDUxJz30A ofeC2cHKGg2aBvIXXAECziSdCW7O/6Y0PB/33uu7vZhQF7GpzLDakD3Z6E5p4d/+GQDY OhbXXmWzuHuji4NIM3+TH/nPCA2L4F0jBh5+q+Xp5lGfbuE/vWMu9Ntrujzzqx1sqQF0 MF+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=g8MjIef7; 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 u12si22434lfi.306.2021.05.12.07.16.25; Wed, 12 May 2021 07:16:56 -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=g8MjIef7; 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 S231236AbhELOP0 (ORCPT + 99 others); Wed, 12 May 2021 10:15:26 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:38565 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbhELOOR (ORCPT ); Wed, 12 May 2021 10:14:17 -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 3A6942226E; Wed, 12 May 2021 16:13:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620828788; 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=Sewi2+aBhItqdGTW2X5Wm+o52DKdoIQIptJXp+P4NDg=; b=g8MjIef7zy3QYjj7eVHEjTm8d0m4PvBAlVT/94kQhXJZcvuvRHUZES2zSDysi0iSz/C2B2 O6Bj5Zh7qZod3WQusG0NRaEtced3C6g22pxqSSFKS/h44H++VZTtDzcveAG6zUyIrB33hg Fsv7jomHSE9tlAMQTPmOP3xQ5Z1ctME= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Johan Hovold , Philippe Schenker , Michael Walle Subject: [PATCH v2 7/9] serial: fsl_lpuart: remove manual RTSCTS control from 8-bit LPUART Date: Wed, 12 May 2021 16:12:53 +0200 Message-Id: <20210512141255.18277-8-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512141255.18277-1-michael@walle.cc> References: <20210512141255.18277-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 5b32d48bee56..ad1fe8cf63f2 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