From patchwork Sun Jan 25 19:44:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hurley X-Patchwork-Id: 5705421 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C97AC058D for ; Sun, 25 Jan 2015 19:47:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4941D20131 for ; Sun, 25 Jan 2015 19:47:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81EF520125 for ; Sun, 25 Jan 2015 19:47:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFT8Z-0008RJ-Ur; Sun, 25 Jan 2015 19:46:23 +0000 Received: from mail-qg0-f47.google.com ([209.85.192.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YFT7j-0008C4-Ij for linux-arm-kernel@lists.infradead.org; Sun, 25 Jan 2015 19:45:33 +0000 Received: by mail-qg0-f47.google.com with SMTP id z60so4404284qgd.6 for ; Sun, 25 Jan 2015 11:45:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4ySSiSObbvkQXCI51revCUYQlhRRzrRUJHCckjq9z7w=; b=QXM6xUC1kWXRX6rNukV8+vcUkz0/Xq9n0W+gSOh0ONqD4EBVPsbvSyDFv0tSYYn4TC 7WIloj62/U4ubAK7rvkp+g9012ag3gDbfHDwhTf+Uu97zkHodYycGuuyFCNjOO5It7/D voAv3z95O7/9GSKhzYDCmtgvP4msmdD2lJaggXYi18ekycruQ94O35BXxa68A44PELMq 2nab4/UhvygEtEgqrnTxgk0tgr0PVltKu2jiOWa7OqUp8gZ1+ziXEx1uJ4CpzxAJAK3W yH8tvqgkIo1hnMbjt50blkLksbEcL52luYHFU1b2f/zjxVlrvhbLQkVXbiBX130k8bxK K7Vw== X-Gm-Message-State: ALoCoQm0NEUfnjLMwTDkFomfc2WKUpk5/QlHptYyzgWLntU8vrbVFy6K0ci+KIBf6307UqbyXcuN X-Received: by 10.224.172.198 with SMTP id m6mr35140403qaz.11.1422215107663; Sun, 25 Jan 2015 11:45:07 -0800 (PST) Received: from thor.lan (h96-61-87-245.cntcnh.dsl.dynamic.tds.net. [96.61.87.245]) by mx.google.com with ESMTPSA id g100sm7886794qge.1.2015.01.25.11.45.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Jan 2015 11:45:06 -0800 (PST) From: Peter Hurley To: Greg Kroah-Hartman Subject: [PATCH 2/4] serial: 8250_omap: Use UPSTAT_AUTORTS for RTS handling Date: Sun, 25 Jan 2015 14:44:52 -0500 Message-Id: <1422215094-3216-3-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422215094-3216-1-git-send-email-peter@hurleysoftware.com> References: <1422215094-3216-1-git-send-email-peter@hurleysoftware.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150125_114531_720954_3B979EA6 X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -0.7 (/) Cc: linux-omap@vger.kernel.org, Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, Peter Hurley X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 88838d3112702 ("serial: omap_8250: Fix RTS handling") fixed RTS pin control when in autoRTS mode. New support added in "serial: core: Rework hw-assisted flow control support" enables a much simpler approach; rather than masking out autoRTS whenever writing the EFR register, use the UPSTAT_* mode to determine if autoRTS should be enabled when raising RTS (in omap8250_set_mctrl()). Signed-off-by: Peter Hurley --- drivers/tty/serial/8250/8250_omap.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 4473881..59d6e90 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -120,10 +120,11 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) */ lcr = serial_in(up, UART_LCR); serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); - if (mctrl & TIOCM_RTS) - serial_out(up, UART_EFR, priv->efr); + if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS)) + priv->efr |= UART_EFR_RTS; else - serial_out(up, UART_EFR, priv->efr & ~UART_EFR_RTS); + priv->efr &= ~UART_EFR_RTS; + serial_out(up, UART_EFR, priv->efr); serial_out(up, UART_LCR, lcr); } @@ -272,10 +273,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); serial_dl_write(up, priv->quot); - if (up->port.mctrl & TIOCM_RTS) - serial_out(up, UART_EFR, priv->efr); - else - serial_out(up, UART_EFR, priv->efr & ~UART_EFR_RTS); + serial_out(up, UART_EFR, priv->efr); /* Configure flow control */ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); @@ -424,9 +422,9 @@ static void omap_8250_set_termios(struct uart_port *port, up->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) { - /* Enable AUTORTS and AUTOCTS */ + /* Enable AUTOCTS (autoRTS is enabled when RTS is raised) */ up->port.status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS; - priv->efr |= UART_EFR_CTS | UART_EFR_RTS; + priv->efr |= UART_EFR_CTS; } else if (up->port.flags & UPF_SOFT_FLOW) { /* * IXON Flag: