From patchwork Sat Sep 12 13:02:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 53512 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 8A22222B26 for ; Sat, 12 Sep 2015 13:03:10 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf32715649lbb.3 for ; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=cSg1CW+OdSy2bN9RWvdMkzFdkgnHcpKEOf+VdVcz4NM=; b=YyK0jtTptOWM3l22Y7P5FK3nXT1cXUB0Zgi/WACyUq0JEGmF348ZKAJhTilWMmKtIK DGGlP6ozHp82uwNwgrKNgla4C/s1PRpRaSnHi1xkDXpRjY7+9fgBjrE+uqp1OzcS+uuW 1tsb76HwgWy/VIwCmD0X0SchCloygyubTs6sPcCKYLW7J3dZ8YAEr/G9ekS/jRwwRzRn 1NQuJtsOrszA4zHnQHqFirQj1rYNn1gKwhXdOT+aK9QVNH+3/Z3i37hEtbQrTLeKnff0 F4sJiEROOmucsylRv1IWScC2T6V3mLBlnHHJwSKxn3Ry973vtPgQQcD/ezXhRybTmjbg 3Ngw== X-Gm-Message-State: ALoCoQkUukpCSewvr9jb1PxV3VRqgOEpkrvH7zuhDU5NabdE7KlCKJXcPNmlSza9cVnVMh4FTJ51 X-Received: by 10.112.130.41 with SMTP id ob9mr218028lbb.17.1442062989586; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.39 with SMTP id s7ls206873lae.15.gmail; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) X-Received: by 10.112.77.68 with SMTP id q4mr3741645lbw.77.1442062989397; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id y4si3264846lag.0.2015.09.12.06.03.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Sep 2015 06:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lanb10 with SMTP id b10so62397542lan.3 for ; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) X-Received: by 10.152.181.37 with SMTP id dt5mr528987lac.86.1442062989272; Sat, 12 Sep 2015 06:03:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp230591lbq; Sat, 12 Sep 2015 06:03:08 -0700 (PDT) X-Received: by 10.107.10.91 with SMTP id u88mr10541649ioi.136.1442062986384; Sat, 12 Sep 2015 06:03:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si2258314ige.76.2015.09.12.06.03.05; Sat, 12 Sep 2015 06:03:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754851AbbILNC7 (ORCPT + 6 others); Sat, 12 Sep 2015 09:02:59 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:37241 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754561AbbILNCq (ORCPT ); Sat, 12 Sep 2015 09:02:46 -0400 Received: by wicfx3 with SMTP id fx3so84610007wic.0 for ; Sat, 12 Sep 2015 06:02:44 -0700 (PDT) X-Received: by 10.194.85.130 with SMTP id h2mr8108790wjz.2.1442062964847; Sat, 12 Sep 2015 06:02:44 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id v6sm5464912wjf.13.2015.09.12.06.02.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Sep 2015 06:02:44 -0700 (PDT) From: "Ivan T. Ivanov" To: Andy Gross Cc: David Brown , Greg Kroah-Hartman , Jiri Slaby , Frank Rowand , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 7/7] tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation Date: Sat, 12 Sep 2015 16:02:14 +0300 Message-Id: <1442062934-13449-8-git-send-email-ivan.ivanov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442062934-13449-1-git-send-email-ivan.ivanov@linaro.org> References: <1442062934-13449-1-git-send-email-ivan.ivanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.ivanov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , UART controller is capable to perform transfers up to 4 Mbps. Remove artificial 115.2 Kbps limitation. Signed-off-by: Ivan T. Ivanov --- drivers/tty/serial/msm_serial.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 3f975392ebc0..223514979685 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -880,6 +880,7 @@ msm_find_best_baud(struct uart_port *port, unsigned int baud) { 3, 0xdd, 8 }, { 2, 0xee, 16 }, { 1, 0xff, 31 }, + { 0, 0xff, 31 }, }; divisor = uart_get_divisor(port, baud); @@ -891,16 +892,29 @@ msm_find_best_baud(struct uart_port *port, unsigned int baud) return entry; /* Default to smallest divider */ } -static int msm_set_baud_rate(struct uart_port *port, unsigned int baud) +static int msm_set_baud_rate(struct uart_port *port, unsigned int baud, + unsigned long *saved_flags) { unsigned int rxstale, watermark, mask; struct msm_port *msm_port = UART_TO_MSM(port); const struct msm_baud_map *entry; + unsigned long flags; entry = msm_find_best_baud(port, baud); msm_write(port, entry->code, UART_CSR); + if (baud > 460800) + port->uartclk = baud * 16; + + flags = *saved_flags; + spin_unlock_irqrestore(&port->lock, flags); + + clk_set_rate(msm_port->clk, port->uartclk); + + spin_lock_irqsave(&port->lock, flags); + *saved_flags = flags; + /* RX stale watermark */ rxstale = entry->rxstale; watermark = UART_IPR_STALE_LSB & rxstale; @@ -1024,8 +1038,8 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios, msm_stop_dma(port, dma); /* calculate and set baud rate */ - baud = uart_get_baud_rate(port, termios, old, 300, 115200); - baud = msm_set_baud_rate(port, baud); + baud = uart_get_baud_rate(port, termios, old, 300, 4000000); + baud = msm_set_baud_rate(port, baud, &flags); if (tty_termios_baud_rate(termios)) tty_termios_encode_baud_rate(termios, baud, baud);