From: "Ivan T. Ivanov" <ivan.ivanov@linaro.org>
To: Andy Gross <agross@codeaurora.org>
Cc: David Brown <davidb@codeaurora.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
Frank Rowand <frank.rowand@sonymobile.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
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 [thread overview]
Message-ID: <1442062934-13449-8-git-send-email-ivan.ivanov@linaro.org> (raw)
In-Reply-To: <1442062934-13449-1-git-send-email-ivan.ivanov@linaro.org>
UART controller is capable to perform transfers up to 4 Mbps.
Remove artificial 115.2 Kbps limitation.
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
---
drivers/tty/serial/msm_serial.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
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);
--
1.9.1
next prev parent reply other threads:[~2015-09-12 13:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-12 13:02 [PATCH 0/7] tty: serial: msm: Add DMA support and fix bit definitions Ivan T. Ivanov
2015-09-12 13:02 ` [PATCH 1/7] tty: serial: msm: Add mask value for UART_DM registers Ivan T. Ivanov
2015-09-12 13:02 ` [PATCH 3/7] tty: serial: msm: Fix command Stale Event Enable definition Ivan T. Ivanov
2015-09-18 23:33 ` Stephen Boyd
[not found] ` <20150918233316.GB23081-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-09-19 4:56 ` Ivan T. Ivanov
2015-09-12 13:02 ` [PATCH 6/7] tty: serial: msm: Add RX DMA support Ivan T. Ivanov
2015-09-12 13:02 ` Ivan T. Ivanov [this message]
[not found] ` <1442062934-13449-1-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-12 13:02 ` [PATCH 2/7] tty: serial: msm: replaces (1 << x) with BIT(x) macro Ivan T. Ivanov
2015-09-12 13:02 ` [PATCH 4/7] tty: serial: msm: Add msm prefix to all driver functions Ivan T. Ivanov
[not found] ` <1442062934-13449-5-git-send-email-ivan.ivanov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-18 23:34 ` Stephen Boyd
2015-09-12 13:02 ` [PATCH 5/7] tty: serial: msm: Add TX DMA support Ivan T. Ivanov
2015-09-24 23:27 ` [PATCH 0/7] tty: serial: msm: Add DMA support and fix bit definitions Srinivas Kandagatla
2015-09-28 7:49 ` Ivan T. Ivanov
2015-09-29 11:51 ` Ivan T. Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442062934-13449-8-git-send-email-ivan.ivanov@linaro.org \
--to=ivan.ivanov@linaro.org \
--cc=agross@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=frank.rowand@sonymobile.com \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jslaby@suse.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).