Re: [PATCH 2/3, try #3] Blackfin: serial driver for Blackfinarchitecture against Linux kernel 2.6.20

From: Russell King
Date: Wed Feb 07 2007 - 14:27:11 EST


On Wed, Feb 07, 2007 at 06:49:58PM +0800, Wu, Bryan wrote:
> Thanks Russell's review, we update the serial core driver according to
> Russell's comments. Here is the change log:
>
> a) use "ttyBF" as blackfin serial name and use new serial major/minor number
> b) can accept command line serial setting like "console=ttyBF0,115200", delete the baud rate setting macros
> c) termios can be changed on the fly

Since you're not implementing the ability to handle INPCK, BRKINT, PARMRK,
IGNPAR and IGNBRK, please arrange for your driver to reflect the real
settings in the termios.

In other words:

> +static void
> +bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios,
> + struct ktermios *old)
> +{
> + struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
> + unsigned long flags;
> + unsigned int baud, quot;
> + unsigned short val, ier, lcr = 0;
> +
> + switch (termios->c_cflag & CSIZE) {
> + case CS8:
> + lcr = WLS(8);
> + break;
> + case CS7:
> + lcr = WLS(7);
> + break;
> + case CS6:
> + lcr = WLS(6);
> + break;
> + case CS5:
> + lcr = WLS(5);
> + break;
> + default:
> + printk(KERN_ERR "%s: word lengh not supported\n",
> + __FUNCTION__);
> + }
> +
> + if (termios->c_cflag & CSTOPB);
> + lcr |= STB;
> + if (termios->c_cflag & PARENB) {
> + lcr |= PEN;
> + if (!(termios->c_cflag & PARODD))
> + lcr |= EPS;
> + }

Insert here:
termios->c_iflag |= INPCK | BRKINT | PARMRK;
termios->c_iflag &= ~(IGNPAR | IGNBRK);

This way applications will know that these controls are not implemented
for this port.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/