Re: [PATCH v1] serial: core: support more baud rates when serial console setup

2015-12-09 Thread One Thousand Gnomes
On Wed,  9 Dec 2015 15:07:58 +0800
Jeffy Chen  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 


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v1] serial: core: support more baud rates when serial console setup

2015-12-08 Thread 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 

---

 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__
+   { 400, B400 },
+   { 350, B350 },
+   { 300, B300 },
+   { 250, B250 },
+   { 200, B200 },
+   { 150, B150 },
+   { 1152000, B1152000 },
+   { 100, B100 },
+#endif
{ 921600, B921600 },
{ 460800, B460800 },
{ 230400, B230400 },
-- 
2.1.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/