From patchwork Wed Sep 30 12:27:03 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: 7297531 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: X-Original-To: patchwork-linux-arm-msm@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 37083BEEA4 for ; Wed, 30 Sep 2015 12:29:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56039206DC for ; Wed, 30 Sep 2015 12:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66753206A7 for ; Wed, 30 Sep 2015 12:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932221AbbI3M20 (ORCPT ); Wed, 30 Sep 2015 08:28:26 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:33254 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932880AbbI3M1t (ORCPT ); Wed, 30 Sep 2015 08:27:49 -0400 Received: by wiclk2 with SMTP id lk2so195569703wic.0 for ; Wed, 30 Sep 2015 05:27:48 -0700 (PDT) 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=KMIyJQeCTU1WfoD2hFMsqboAn97gj9ouMeW1yF6njgs=; b=QE0Ov2GqAKnG77l2uxTcvoFFEQfIq6ZIuB4daYx37HGXv6fFsn1TLWx0Q8UNfvOxjp oDMy8K2k2/K1hzHXY05uZH0Xnuf77AZCRF93xavlPb6tquiibHuEAEh0AT3OAu3dO0sE tcIauG/ZHuIc7FmxiAfmq9hRHNgqIaFeeU6t9OGtr0JabCCGtZmzutOFdKIS7KqkCmNN GSNjH78JpxQXjhjkU2BauDfQbzHNXoRD0grrvwonyfDXtZYaSdLmu6HiA3vR7EhS+tsU YSrQzFE4iZPGtSPmcXPmp+xTleXmdscu12M6zgmYfMfW4VO7Pf5H8TqFE3j7ISlrVyJQ 6oKw== X-Gm-Message-State: ALoCoQnXP/n/Kn0OerxVWMEX2Ran8DVHjpCBNLnnlDQEKcY9S4C4EgMwviRzht2FXwjAF6ERyXQI X-Received: by 10.180.198.142 with SMTP id jc14mr4771933wic.32.1443616067992; Wed, 30 Sep 2015 05:27:47 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id fs2sm493029wib.12.2015.09.30.05.27.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Sep 2015 05:27:47 -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 v3 6/6] tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation Date: Wed, 30 Sep 2015 15:27:03 +0300 Message-Id: <1443616023-28625-7-git-send-email-ivan.ivanov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443616023-28625-1-git-send-email-ivan.ivanov@linaro.org> References: <1443616023-28625-1-git-send-email-ivan.ivanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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 3efb80f511db..dcde955475dc 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);