aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/Makefile2
-rw-r--r--drivers/tty/serial/altera_uart.c24
2 files changed, 25 insertions, 1 deletions
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 1997ad4a39a6..50d279000e79 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -75,12 +75,12 @@ obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
75obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o 75obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
76obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o 76obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
77obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o 77obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o
78obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
78obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o 79obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
79obj-$(CONFIG_SERIAL_QE) += ucc_uart.o 80obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
80obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o 81obj-$(CONFIG_SERIAL_TIMBERDALE) += timbuart.o
81obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o 82obj-$(CONFIG_SERIAL_GRLIB_GAISLER_APBUART) += apbuart.o
82obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o 83obj-$(CONFIG_SERIAL_ALTERA_JTAGUART) += altera_jtaguart.o
83obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o
84obj-$(CONFIG_SERIAL_VT8500) += vt8500_serial.o 84obj-$(CONFIG_SERIAL_VT8500) += vt8500_serial.o
85obj-$(CONFIG_SERIAL_MRST_MAX3110) += mrst_max3110.o 85obj-$(CONFIG_SERIAL_MRST_MAX3110) += mrst_max3110.o
86obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o 86obj-$(CONFIG_SERIAL_MFD_HSU) += mfd.o
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 217833e94b5b..e7903751e058 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -377,6 +377,26 @@ static int altera_uart_verify_port(struct uart_port *port,
377 return 0; 377 return 0;
378} 378}
379 379
380#ifdef CONFIG_CONSOLE_POLL
381static int altera_uart_poll_get_char(struct uart_port *port)
382{
383 while (!(altera_uart_readl(port, ALTERA_UART_STATUS_REG) &
384 ALTERA_UART_STATUS_RRDY_MSK))
385 cpu_relax();
386
387 return altera_uart_readl(port, ALTERA_UART_RXDATA_REG);
388}
389
390static void altera_uart_poll_put_char(struct uart_port *port, unsigned char c)
391{
392 while (!(altera_uart_readl(port, ALTERA_UART_STATUS_REG) &
393 ALTERA_UART_STATUS_TRDY_MSK))
394 cpu_relax();
395
396 altera_uart_writel(port, c, ALTERA_UART_TXDATA_REG);
397}
398#endif
399
380/* 400/*
381 * Define the basic serial functions we support. 401 * Define the basic serial functions we support.
382 */ 402 */
@@ -397,6 +417,10 @@ static struct uart_ops altera_uart_ops = {
397 .release_port = altera_uart_release_port, 417 .release_port = altera_uart_release_port,
398 .config_port = altera_uart_config_port, 418 .config_port = altera_uart_config_port,
399 .verify_port = altera_uart_verify_port, 419 .verify_port = altera_uart_verify_port,
420#ifdef CONFIG_CONSOLE_POLL
421 .poll_get_char = altera_uart_poll_get_char,
422 .poll_put_char = altera_uart_poll_put_char,
423#endif
400}; 424};
401 425
402static struct altera_uart altera_uart_ports[CONFIG_SERIAL_ALTERA_UART_MAXPORTS]; 426static struct altera_uart altera_uart_ports[CONFIG_SERIAL_ALTERA_UART_MAXPORTS];