From d345339532b734ddf31a5c634848b1cfc85b7723 Mon Sep 17 00:00:00 2001 From: Chris J Arges Date: Tue, 4 Nov 2008 12:19:06 +0000 Subject: [PATCH] --- yaml --- r: 123023 b: refs/heads/master c: 8c6531868d4917adbd363030f28a734b76c7471a h: refs/heads/master i: 123021: 01b114c7e1a28f0a7b40f15f2441ca518af40302 123019: 23d1ac62f3a065ea230b60e31d6edd242e908461 123015: 8495696164fd7840f581ff66e384759c6306f3c5 123007: d1cac3eddaa20c9dd05f3670b582720daeb8df9f v: v3 --- [refs] | 2 +- trunk/drivers/serial/pmac_zilog.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 95d60c24bef5..63fa1b02b7f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9b82f3e61758ed897200f0244b63a77c1791bcba +refs/heads/master: 8c6531868d4917adbd363030f28a734b76c7471a diff --git a/trunk/drivers/serial/pmac_zilog.c b/trunk/drivers/serial/pmac_zilog.c index 317b061f7641..ad3488504010 100644 --- a/trunk/drivers/serial/pmac_zilog.c +++ b/trunk/drivers/serial/pmac_zilog.c @@ -1383,6 +1383,29 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser) return -EINVAL; } +#ifdef CONFIG_CONSOLE_POLL + +static int pmz_poll_get_char(struct uart_port *port) +{ + struct uart_pmac_port *uap = (struct uart_pmac_port *)port; + + while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) + udelay(5); + return read_zsdata(uap); +} + +static void pmz_poll_put_char(struct uart_port *port, unsigned char c) +{ + struct uart_pmac_port *uap = (struct uart_pmac_port *)port; + + /* Wait for the transmit buffer to empty. */ + while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0) + udelay(5); + write_zsdata(uap, c); +} + +#endif + static struct uart_ops pmz_pops = { .tx_empty = pmz_tx_empty, .set_mctrl = pmz_set_mctrl, @@ -1400,6 +1423,10 @@ static struct uart_ops pmz_pops = { .request_port = pmz_request_port, .config_port = pmz_config_port, .verify_port = pmz_verify_port, +#ifdef CONFIG_CONSOLE_POLL + .poll_get_char = pmz_poll_get_char, + .poll_put_char = pmz_poll_put_char, +#endif }; /*