lkml.org 
[lkml]   [2010]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@linux.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.


\
 
 \ /
  Last update: 2010-03-01 19:19    [W:1.323 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site