From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: linux-serial@vger.kernel.org, nios2-dev@sopc.et.ntust.edu.tw,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 2/2] serial: Add driver for the Altera UART
Date: Mon, 1 Mar 2010 18:19:20 +0000 [thread overview]
Message-ID: <20100301181920.3952c3e7@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <afb4f2a75a6a35853774b10f34635a1d52d4cebd.1267448534.git.klto@zhaw.ch>
> + * 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.
next prev parent reply other threads:[~2010-03-01 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-01 13:31 [PATCHv2 0/2] serial: Drivers for Altera UARTs Tobias Klauser
2010-03-01 13:31 ` [PATCHv2 1/2] serial: Add driver for the Altera JTAG UART Tobias Klauser
2010-03-01 13:31 ` [PATCHv2 2/2] serial: Add driver for the Altera UART Tobias Klauser
2010-03-01 18:19 ` Alan Cox [this message]
2010-03-05 16:54 ` Tobias Klauser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100301181920.3952c3e7@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nios2-dev@sopc.et.ntust.edu.tw \
--cc=tklauser@distanz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®