[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100301181920.3952c3e7@lxorguk.ukuu.org.uk>
Date: Mon, 1 Mar 2010 18:19:20 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Tobias Klauser <tklauser@...tanz.ch>
Cc: linux-serial@...r.kernel.org, nios2-dev@...c.et.ntust.edu.tw,
linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 2/2] serial: Add driver for the Altera UART
> + * Some boards implement the DTR/DCD lines using GPIO lines, most don't. Dummy
> + * out the access macros for those that don't. Those that do should define these
> + * macros somewhere in their board specific inlude files.
> + */
> +#if !defined(altera_uart_getppdcd)
> +# define altera_uart_getppdcd(p) (1)
> +#endif
> +#if !defined(altera_uart_getppdtr)
> +# define altera_uart_getppdtr(p) (1)
> +#endif
> +#if !defined(altera_uart_setppdtr)
> +# define altera_uart_setppdtr(p, v) do { } while (0)
> +#endif
Those ought to be in the board stuff only - the problem you have
otherwise is that someone not noticing won't get an error.
> +static void altera_uart_set_termios(struct uart_port *port,
> + struct ktermios *termios,
> + struct ktermios *old)
> +{
> + unsigned long flags;
> + unsigned int baud, baudclk;
> +
> + baud = uart_get_baud_rate(port, termios, old, 0, 4000000);
> + baudclk = port->uartclk / baud;
> +
> + spin_lock_irqsave(&port->lock, flags);
> + writel(baudclk, port->membase + ALTERA_UART_DIVISOR_REG);
> + spin_unlock_irqrestore(&port->lock, flags);
If you only support board setting then copy the old termios back as in
the other driver and the use tty_termios_encode_baud_rate() to report
set the baud rate accordingly.
Acked-by: Alan Cox <alan@...ux.intel.com>
As the oddments that want adjusting can be done post merge and I'd rather
see this in now than later as there are some serial_core changes cooking
that will need to touch all drivers.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists