diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 22:59:04 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 22:59:04 -0400 |
| commit | 73ecf3a6e3f0206bf56a0fefe3b3eda042fb7034 (patch) | |
| tree | 866f0ebb2b148479e93b5ac955097b1cc94ceb4e /drivers/serial/uartlite.c | |
| parent | b9da0571050c09863e59f94d0b8594a290d61b88 (diff) | |
| parent | cd3ecad19aea8debae9a48b53de2ec7a571f24e9 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (49 commits)
serial8250: ratelimit "too much work" error
serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
serial: abstraction for 8250 legacy ports
serial/imx: check that the buffer is non-empty before sending it out
serial: mfd: add more baud rates support
jsm: Remove the uart port on errors
Alchemy: Add UART PM methods.
8250: allow platforms to override PM hook.
altera_uart: Don't use plain integer as NULL pointer
altera_uart: Fix missing prototype for registering an early console
altera_uart: Fixup type usage of port flags
altera_uart: Make it possible to use Altera UART and 8250 ports together
altera_uart: Add support for different address strides
altera_uart: Add support for getting mapbase and IRQ from resources
altera_uart: Add support for polling mode (IRQ-less)
serial: Factor out uart_poll_timeout() from 8250 driver
serial: mark the 8250 driver as maintained
serial: 8250: Don't delay after transmitter is ready.
tty: MAINTAINERS: add drivers/serial/jsm/ as maintained driver
vcs: invoke the vt update callback when /dev/vcs* is written to
...
Diffstat (limited to 'drivers/serial/uartlite.c')
| -rw-r--r-- | drivers/serial/uartlite.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 9b03d7b3e456..c4bf54bb3fc7 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
| @@ -322,6 +322,26 @@ static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
| 322 | return -EINVAL; | 322 | return -EINVAL; |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | #ifdef CONFIG_CONSOLE_POLL | ||
| 326 | static int ulite_get_poll_char(struct uart_port *port) | ||
| 327 | { | ||
| 328 | if (!(ioread32be(port->membase + ULITE_STATUS) | ||
| 329 | & ULITE_STATUS_RXVALID)) | ||
| 330 | return NO_POLL_CHAR; | ||
| 331 | |||
| 332 | return ioread32be(port->membase + ULITE_RX); | ||
| 333 | } | ||
| 334 | |||
| 335 | static void ulite_put_poll_char(struct uart_port *port, unsigned char ch) | ||
| 336 | { | ||
| 337 | while (ioread32be(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL) | ||
| 338 | cpu_relax(); | ||
| 339 | |||
| 340 | /* write char to device */ | ||
| 341 | iowrite32be(ch, port->membase + ULITE_TX); | ||
| 342 | } | ||
| 343 | #endif | ||
| 344 | |||
| 325 | static struct uart_ops ulite_ops = { | 345 | static struct uart_ops ulite_ops = { |
| 326 | .tx_empty = ulite_tx_empty, | 346 | .tx_empty = ulite_tx_empty, |
| 327 | .set_mctrl = ulite_set_mctrl, | 347 | .set_mctrl = ulite_set_mctrl, |
| @@ -338,7 +358,11 @@ static struct uart_ops ulite_ops = { | |||
| 338 | .release_port = ulite_release_port, | 358 | .release_port = ulite_release_port, |
| 339 | .request_port = ulite_request_port, | 359 | .request_port = ulite_request_port, |
| 340 | .config_port = ulite_config_port, | 360 | .config_port = ulite_config_port, |
| 341 | .verify_port = ulite_verify_port | 361 | .verify_port = ulite_verify_port, |
| 362 | #ifdef CONFIG_CONSOLE_POLL | ||
| 363 | .poll_get_char = ulite_get_poll_char, | ||
| 364 | .poll_put_char = ulite_put_poll_char, | ||
| 365 | #endif | ||
| 342 | }; | 366 | }; |
| 343 | 367 | ||
| 344 | /* --------------------------------------------------------------------- | 368 | /* --------------------------------------------------------------------- |
