[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Feb 2016 18:19:35 +0000
From: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To: Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc: Jason Cooper <jason@...edaemon.net>, Andrew Lunn <andrew@...n.ch>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
arm@...nel.org, Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Jonathan Corbet <corbet@....net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>, linux-serial@...r.kernel.org,
Tejun Heo <tj@...nel.org>, Hans de Goede <hdegoede@...hat.com>,
linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
Mark Rutland <mark.rutland@....com>,
devicetree@...r.kernel.org,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
linux-arm-kernel@...ts.infradead.org,
Wilson Ding <dingwei@...vell.com>,
Nadav Haklai <nadavh@...vell.com>
Subject: Re: [PATCH 01/10] serial: mvebu-uart: initial support for
Armada-3700 serial port
> +static void mvebu_uart_set_termios(struct uart_port *port,
> + struct ktermios *termios,
> + struct ktermios *old)
> +{
> + unsigned long flags;
> + unsigned int baud;
> +
> + spin_lock_irqsave(&port->lock, flags);
> +
> + port->read_status_mask = STAT_RX_RDY | STAT_OVR_ERR |
> + STAT_TX_RDY | STAT_TX_FIFO_FUL;
> +
> + if (termios->c_iflag & INPCK)
> + port->read_status_mask |= STAT_FRM_ERR | STAT_PAR_ERR;
> +
> + port->ignore_status_mask = 0;
> + if (termios->c_iflag & IGNPAR)
> + port->ignore_status_mask |=
> + STAT_FRM_ERR | STAT_PAR_ERR | STAT_OVR_ERR;
> +
> + if ((termios->c_cflag & CREAD) == 0)
> + port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR;
If you don't support parity or charactive size then you should be forcing
those bits in the tty->termios so that the caller sees what settings they
get. tty_termios_copy_hw is close to what you need except that you can
support IGNPAR.
You also want to provide the actual baud rate chosen (see how 8250.c does
it using tty_termios_encode_baud_rate().
> +static struct uart_driver mvebu_uart_driver = {
> + .owner = THIS_MODULE,
> + .driver_name = "serial",
> + .dev_name = "ttyS",
> + .major = TTY_MAJOR,
> + .minor = 64,
NAK
TTY_MAJOR 64+ is the 8250 driver and ttyS is the 8250 driver name. You
should be using a dynamic major (0) for all new drivers and you need to
pick a different and unused ttyXXX format name.
Alan
Powered by blists - more mailing lists