diff options
Diffstat (limited to 'drivers/serial/atmel_serial.c')
-rw-r--r-- | drivers/serial/atmel_serial.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 9d948bccafaf..2c9bf9b68327 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1213,6 +1213,24 @@ static int atmel_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
1213 | return ret; | 1213 | return ret; |
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | #ifdef CONFIG_CONSOLE_POLL | ||
1217 | static int atmel_poll_get_char(struct uart_port *port) | ||
1218 | { | ||
1219 | while (!(UART_GET_CSR(port) & ATMEL_US_RXRDY)) | ||
1220 | cpu_relax(); | ||
1221 | |||
1222 | return UART_GET_CHAR(port); | ||
1223 | } | ||
1224 | |||
1225 | static void atmel_poll_put_char(struct uart_port *port, unsigned char ch) | ||
1226 | { | ||
1227 | while (!(UART_GET_CSR(port) & ATMEL_US_TXRDY)) | ||
1228 | cpu_relax(); | ||
1229 | |||
1230 | UART_PUT_CHAR(port, ch); | ||
1231 | } | ||
1232 | #endif | ||
1233 | |||
1216 | static struct uart_ops atmel_pops = { | 1234 | static struct uart_ops atmel_pops = { |
1217 | .tx_empty = atmel_tx_empty, | 1235 | .tx_empty = atmel_tx_empty, |
1218 | .set_mctrl = atmel_set_mctrl, | 1236 | .set_mctrl = atmel_set_mctrl, |
@@ -1232,6 +1250,10 @@ static struct uart_ops atmel_pops = { | |||
1232 | .config_port = atmel_config_port, | 1250 | .config_port = atmel_config_port, |
1233 | .verify_port = atmel_verify_port, | 1251 | .verify_port = atmel_verify_port, |
1234 | .pm = atmel_serial_pm, | 1252 | .pm = atmel_serial_pm, |
1253 | #ifdef CONFIG_CONSOLE_POLL | ||
1254 | .poll_get_char = atmel_poll_get_char, | ||
1255 | .poll_put_char = atmel_poll_put_char, | ||
1256 | #endif | ||
1235 | }; | 1257 | }; |
1236 | 1258 | ||
1237 | /* | 1259 | /* |