lkml.org 
[lkml]   [2012]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] serial/arc-uart: Add new driver
On Friday 28 September 2012 06:32 PM, Alan Cox wrote:

>> +static void
>> +arc_serial_set_termios(struct uart_port *port, struct ktermios
>> *termios,
>> + struct ktermios *old)
>> +{
>> + struct arc_uart_port *uart = (struct arc_uart_port *)port;
>> + unsigned int baud, uartl, uarth, hw_val;
>> + unsigned long flags;
>> +
> Two things here. Firstly you want to write the actual baud back to the
> termios (tty_termios_encode_baud_rate) unless B0 is set.
>
> Secondly if you don't support hardware flow control, character size
> setting etc then you need to set those bits back so the caller knows.
> Two ways to do that. Either initialise the default termios for the tty
> type to the correct values and use tty_termios_copy_hw() or set them in
> the termios handler.

Just to give you an idea, is something on the lines of following OK for
both the above points above !

- uart_update_timeout(port, termios->c_cflag, baud);
+ new->c_cflag &= ~(CMSPAR|CRTSCTS); /* Don't care for
parity/flow ctrl */
+
+ if (old)
+ tty_termios_copy_hw(new, old);
+
+ /* Don't rewrite B0 */
+ if (tty_termios_baud_rate(new))
+ tty_termios_encode_baud_rate(new, baud, baud);
+
+ uart_update_timeout(port, new->c_cflag, baud);


Respun patch to follow shortly.

Thx,
Vineet


\
 
 \ /
  Last update: 2012-10-02 07:01    [W:0.038 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site