From patchwork Sat Oct 6 12:39:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 1557281 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7DA193FD56 for ; Sat, 6 Oct 2012 12:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755980Ab2JFMkf (ORCPT ); Sat, 6 Oct 2012 08:40:35 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:47220 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755805Ab2JFMkf (ORCPT ); Sat, 6 Oct 2012 08:40:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=k4VNQT4LyowZL7KZQB5qO9U3gTT2RFCce04+3jgL+mA=; b=lFR9BrsEaVkjyq0m/H7HX2Ngo7lwErRiz4O8+XC6LGFRpL1DJ1qhmWCNGznsIUtGo1F58NrBjfG5JiM3xwIJeuTRmEWTA1GWkBRjBmTiPiqiO9EbI83V0zVjRChkUrmxVd9zLE4otmfH3TaW9FKxzGfUk/UR52kWw6yUNo4S3oE=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:39590 helo=rmk-PC.arm.linux.org.uk) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TKTf7-000861-Fn; Sat, 06 Oct 2012 13:39:21 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1TKTf6-0002mO-Oj; Sat, 06 Oct 2012 13:39:20 +0100 In-Reply-To: <20121006123803.GD15246@n2100.arm.linux.org.uk> References: <20121006123803.GD15246@n2100.arm.linux.org.uk> From: Russell King To: Tony Lindgren , Alan Cox , Greg Kroah-Hartman Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-serial@vger.kernel.org Subject: [RFC 01/24] SERIAL: omap: fix set_mctrl() breakage Message-Id: Date: Sat, 06 Oct 2012 13:39:20 +0100 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org c538d20c7f (and maybe previous commits) broke set_mctrl() by making it only capable of setting bits in the MCR register. This prevents software controlled flow control and modem control line manipulation via TIOCMSET/TIOCMBIC from working correctly. Signed-off-by: Russell King --- drivers/tty/serial/omap-serial.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index d3cda0c..0a50669 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -488,7 +488,7 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port) static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) { struct uart_omap_port *up = (struct uart_omap_port *)port; - unsigned char mcr = 0; + unsigned char mcr = 0, old_mcr; dev_dbg(up->port.dev, "serial_omap_set_mctrl+%d\n", up->port.line); if (mctrl & TIOCM_RTS) @@ -503,8 +503,10 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) mcr |= UART_MCR_LOOP; pm_runtime_get_sync(&up->pdev->dev); - up->mcr = serial_in(up, UART_MCR); - up->mcr |= mcr; + old_mcr = serial_in(up, UART_MCR); + old_mcr &= ~(UART_MCR_LOOP | UART_MCR_OUT2 | UART_MCR_OUT1 | + UART_MCR_DTR | UART_MCR_RTS); + up->mcr = old_mcr | mcr; serial_out(up, UART_MCR, up->mcr); pm_runtime_put(&up->pdev->dev); }