All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] serial: core: support more baud rates when serial console setup
@ 2015-12-09  7:07 Jeffy Chen
  2015-12-09 12:05 ` One Thousand Gnomes
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffy Chen @ 2015-12-09  7:07 UTC (permalink / raw)
  To: linux-serial, linux-kernel, jslaby, gregkh; +Cc: rockchip-discuss, Jeffy Chen

Currently, when tring to set up a serial console with a higher
baud rate, it would fallback to 921600.

So, add more baud rates to the baud rate array.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

---

 drivers/tty/serial/serial_core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index def5199..7da1b7e 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1898,6 +1898,16 @@ struct baud_rates {
 };
 
 static const struct baud_rates baud_rates[] = {
+#ifndef __sparc__
+	{ 4000000, B4000000 },
+	{ 3500000, B3500000 },
+	{ 3000000, B3000000 },
+	{ 2500000, B2500000 },
+	{ 2000000, B2000000 },
+	{ 1500000, B1500000 },
+	{ 1152000, B1152000 },
+	{ 1000000, B1000000 },
+#endif
 	{ 921600, B921600 },
 	{ 460800, B460800 },
 	{ 230400, B230400 },
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] serial: core: support more baud rates when serial console setup
  2015-12-09  7:07 [PATCH v1] serial: core: support more baud rates when serial console setup Jeffy Chen
@ 2015-12-09 12:05 ` One Thousand Gnomes
  0 siblings, 0 replies; 2+ messages in thread
From: One Thousand Gnomes @ 2015-12-09 12:05 UTC (permalink / raw)
  To: Jeffy Chen; +Cc: linux-serial, linux-kernel, jslaby, gregkh, rockchip-discuss

On Wed,  9 Dec 2015 15:07:58 +0800
Jeffy Chen <jeffy.chen@rock-chips.com> wrote:

> Currently, when tring to set up a serial console with a higher
> baud rate, it would fallback to 921600.
> 
> So, add more baud rates to the baud rate array.
> 
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>


Far simpler I think would be if we finally lost this old code and just did

	memset(&termios, 0, sizeof(struct termios));
	termios.c_cflag |= CREAD | HUPCL | CLOCAL;
	tty_termios_encode_baud_rate(&termios, baud, baud);


	if (bits == 7)
		..


and just removed the baud_rates table for good. The console drivers now
understand arbitrary rate requests and the core tty code has for years
supported doing the mapping for arbitrary baud rates as well as back
mapping them onto "classic" B9600 type encoding when possible.

That would also various devices with insane baud rates where someone was
too cheap to fit an extra crystal.

Alan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-09 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09  7:07 [PATCH v1] serial: core: support more baud rates when serial console setup Jeffy Chen
2015-12-09 12:05 ` One Thousand Gnomes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.