lkml.org 
[lkml]   [2011]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Wrong GIT author ? also bugs: serial: Add uart driver for i.MX23/28
> I don't understand how to do this and didn't find something like that in
> other drivers. (I checked amba-pl011.c and imx.c.) Also
> Documentation/serial/driver doesn't describe this. (It is also silent
> about CMSPAR and doesn't even advise to clear unsupported bits.)
> Can you be a bit more verbose here?

8250.c is the best place to look.

Basically on return from your routine the _hardware_ bits of the termios
struct should be the ones set.

So eg if you only supported 8bit characters you'd wipe the CSx bits and
set CS8.

For the speed there is a helper so you probably want

/* Don't rewrite B0 */
if (tty_termios_baud_rate(termios))
tty_termios_encode_baud_rate(termios, baud, baud);

> @@ -286,6 +283,9 @@ static void mxs_auart_settermios(struct uart_port *u,
> {
> u32 bm, ctrl, ctrl2, div;
> unsigned int cflag, baud;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&u->lock, flags);

Termios you don't need the lock - just the IRQ handler and you still
really want the tty_port_tty_get()/tty_kref_put() if that wasn't already
dealt with.

(You may not need it but its easier to put in than prove with the serial
layer at the moment)


\
 
 \ /
  Last update: 2011-03-29 11:35    [W:0.809 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site