From patchwork Wed Sep 30 12:08:26 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: 54308 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 59C3922E23 for ; Wed, 30 Sep 2015 12:09:25 +0000 (UTC) Received: by wisv5 with SMTP id v5sf21408957wis.0 for ; Wed, 30 Sep 2015 05:09:24 -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=nXn6L22BPOVyddJGUTwk6mcpgRW9A7spJW484V5tyrU=; b=Kkp1GiSuzwmPrXowqrWF4G/dumxBTTqRWAOfNj1AO433FwDUFWoFP7F9OTY5chCfSi x1JH3iNIKBmQPmzkVjZ0jKS+Jdha+I9wvtZ+Ro73G8yPAM/N3cUq1DwS0vXR1QKXhzYo oCNTupXlMMmUrgJipwfQB1xSGOpjf2nsFX/KetwgCjo9XpuFVRZvj0hTBTazq98FtQoT yMFrQ72Emjzr05zz7tiJ6FxGiBn0Ga0FE7OmMsdmb1QYkH+NujwuUIBmauR7GG9xQc4W ZkjQkEAwWIko/h5ps3CJLXcrSx1qStpBZfYPvDGrCR+LOHXiGErBFG6g9x9OtP43a0tU /YMA== X-Gm-Message-State: ALoCoQmo1wLuohnSs5RBpg/J2Z0x1I0okdcC7Cmlzmc58GdW+KI9icepWpYDz05WugJoB9MkQ2sl X-Received: by 10.112.151.9 with SMTP id um9mr482955lbb.19.1443614964664; Wed, 30 Sep 2015 05:09:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.230 with SMTP id e6ls34982lah.66.gmail; Wed, 30 Sep 2015 05:09:24 -0700 (PDT) X-Received: by 10.112.53.68 with SMTP id z4mr999391lbo.4.1443614964463; Wed, 30 Sep 2015 05:09:24 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id od3si132775lbb.76.2015.09.30.05.09.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Sep 2015 05:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laclj5 with SMTP id lj5so43225213lac.3 for ; Wed, 30 Sep 2015 05:09:24 -0700 (PDT) X-Received: by 10.152.28.73 with SMTP id z9mr1051976lag.73.1443614964154; Wed, 30 Sep 2015 05:09:24 -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 w3csp2713715lbq; Wed, 30 Sep 2015 05:09:22 -0700 (PDT) X-Received: by 10.68.57.137 with SMTP id i9mr4483462pbq.101.1443614961314; Wed, 30 Sep 2015 05:09:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8si368094pas.215.2015.09.30.05.09.21; Wed, 30 Sep 2015 05:09:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 S932670AbbI3MJQ (ORCPT + 30 others); Wed, 30 Sep 2015 08:09:16 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33867 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755858AbbI3MJF (ORCPT ); Wed, 30 Sep 2015 08:09:05 -0400 Received: by wicfx3 with SMTP id fx3so193994534wic.1 for ; Wed, 30 Sep 2015 05:09:04 -0700 (PDT) X-Received: by 10.180.211.10 with SMTP id my10mr4594810wic.84.1443614944534; Wed, 30 Sep 2015 05:09:04 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id s1sm17032154wik.16.2015.09.30.05.09.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Sep 2015 05:09:03 -0700 (PDT) From: "Ivan T. Ivanov" To: Andy Gross Cc: David Brown , Srinivas Kandagatla , 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 v2 6/6] tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation Date: Wed, 30 Sep 2015 15:08:26 +0300 Message-Id: <1443614906-2196-7-git-send-email-ivan.ivanov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443614906-2196-1-git-send-email-ivan.ivanov@linaro.org> References: <1443614906-2196-1-git-send-email-ivan.ivanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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.51 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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index fc5f6b3b4bbb..abeb35555d93 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -882,6 +882,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); @@ -893,16 +894,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; @@ -1026,8 +1040,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);