diff options
Diffstat (limited to 'drivers/serial')
| -rw-r--r-- | drivers/serial/8250_pnp.c | 12 | ||||
| -rw-r--r-- | drivers/serial/imx.c | 2 | ||||
| -rw-r--r-- | drivers/serial/pmac_zilog.c | 11 | ||||
| -rw-r--r-- | drivers/serial/serial_core.c | 105 | ||||
| -rw-r--r-- | drivers/serial/serial_cs.c | 4 | ||||
| -rw-r--r-- | drivers/serial/sh-sci.c | 13 |
6 files changed, 75 insertions, 72 deletions
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c index 36ede02ceacf..24485cc62ff8 100644 --- a/drivers/serial/8250_pnp.c +++ b/drivers/serial/8250_pnp.c | |||
| @@ -328,15 +328,7 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
| 328 | /* U.S. Robotics 56K Voice INT PnP*/ | 328 | /* U.S. Robotics 56K Voice INT PnP*/ |
| 329 | { "USR9190", 0 }, | 329 | { "USR9190", 0 }, |
| 330 | /* Wacom tablets */ | 330 | /* Wacom tablets */ |
| 331 | { "WACF004", 0 }, | 331 | { "WACFXXX", 0 }, |
| 332 | { "WACF005", 0 }, | ||
| 333 | { "WACF006", 0 }, | ||
| 334 | { "WACF007", 0 }, | ||
| 335 | { "WACF008", 0 }, | ||
| 336 | { "WACF009", 0 }, | ||
| 337 | { "WACF00A", 0 }, | ||
| 338 | { "WACF00B", 0 }, | ||
| 339 | { "WACF00C", 0 }, | ||
| 340 | /* Compaq touchscreen */ | 332 | /* Compaq touchscreen */ |
| 341 | { "FPI2002", 0 }, | 333 | { "FPI2002", 0 }, |
| 342 | /* Fujitsu Stylistic touchscreens */ | 334 | /* Fujitsu Stylistic touchscreens */ |
| @@ -354,6 +346,8 @@ static const struct pnp_device_id pnp_dev_table[] = { | |||
| 354 | { "FUJ02E5", 0 }, | 346 | { "FUJ02E5", 0 }, |
| 355 | /* Fujitsu P-series tablet PC device */ | 347 | /* Fujitsu P-series tablet PC device */ |
| 356 | { "FUJ02E6", 0 }, | 348 | { "FUJ02E6", 0 }, |
| 349 | /* Fujitsu Wacom 2FGT Tablet PC device */ | ||
| 350 | { "FUJ02E7", 0 }, | ||
| 357 | /* | 351 | /* |
| 358 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in | 352 | * LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in |
| 359 | * disguise) | 353 | * disguise) |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 18130f11238e..60d665a17a88 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
| @@ -1088,7 +1088,7 @@ imx_console_get_options(struct imx_port *sport, int *baud, | |||
| 1088 | int *parity, int *bits) | 1088 | int *parity, int *bits) |
| 1089 | { | 1089 | { |
| 1090 | 1090 | ||
| 1091 | if ( readl(sport->port.membase + UCR1) | UCR1_UARTEN ) { | 1091 | if (readl(sport->port.membase + UCR1) & UCR1_UARTEN) { |
| 1092 | /* ok, the port was enabled */ | 1092 | /* ok, the port was enabled */ |
| 1093 | unsigned int ucr2, ubir,ubmr, uartclk; | 1093 | unsigned int ucr2, ubir,ubmr, uartclk; |
| 1094 | unsigned int baud_raw; | 1094 | unsigned int baud_raw; |
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 0700cd10b97c..683e66f18e8c 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
| @@ -411,6 +411,17 @@ static void pmz_transmit_chars(struct uart_pmac_port *uap) | |||
| 411 | goto ack_tx_int; | 411 | goto ack_tx_int; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | /* Under some circumstances, we see interrupts reported for | ||
| 415 | * a closed channel. The interrupt mask in R1 is clear, but | ||
| 416 | * R3 still signals the interrupts and we see them when taking | ||
| 417 | * an interrupt for the other channel (this could be a qemu | ||
| 418 | * bug but since the ESCC doc doesn't specify precsiely whether | ||
| 419 | * R3 interrup status bits are masked by R1 interrupt enable | ||
| 420 | * bits, better safe than sorry). --BenH. | ||
| 421 | */ | ||
| 422 | if (!ZS_IS_OPEN(uap)) | ||
| 423 | goto ack_tx_int; | ||
| 424 | |||
| 414 | if (uap->port.x_char) { | 425 | if (uap->port.x_char) { |
| 415 | uap->flags |= PMACZILOG_FLAG_TX_ACTIVE; | 426 | uap->flags |= PMACZILOG_FLAG_TX_ACTIVE; |
| 416 | write_zsdata(uap, uap->port.x_char); | 427 | write_zsdata(uap, uap->port.x_char); |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 047530b285bb..7f2830709512 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
| @@ -385,13 +385,20 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, | |||
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | /* | 387 | /* |
| 388 | * As a last resort, if the quotient is zero, | 388 | * As a last resort, if the range cannot be met then clip to |
| 389 | * default to 9600 bps | 389 | * the nearest chip supported rate. |
| 390 | */ | 390 | */ |
| 391 | if (!hung_up) | 391 | if (!hung_up) { |
| 392 | tty_termios_encode_baud_rate(termios, 9600, 9600); | 392 | if (baud <= min) |
| 393 | tty_termios_encode_baud_rate(termios, | ||
| 394 | min + 1, min + 1); | ||
| 395 | else | ||
| 396 | tty_termios_encode_baud_rate(termios, | ||
| 397 | max - 1, max - 1); | ||
| 398 | } | ||
| 393 | } | 399 | } |
| 394 | 400 | /* Should never happen */ | |
| 401 | WARN_ON(1); | ||
| 395 | return 0; | 402 | return 0; |
| 396 | } | 403 | } |
| 397 | 404 | ||
| @@ -2006,12 +2013,6 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) | |||
| 2006 | 2013 | ||
| 2007 | mutex_lock(&port->mutex); | 2014 | mutex_lock(&port->mutex); |
| 2008 | 2015 | ||
| 2009 | if (!console_suspend_enabled && uart_console(uport)) { | ||
| 2010 | /* we're going to avoid suspending serial console */ | ||
| 2011 | mutex_unlock(&port->mutex); | ||
| 2012 | return 0; | ||
| 2013 | } | ||
| 2014 | |||
| 2015 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); | 2016 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); |
| 2016 | if (device_may_wakeup(tty_dev)) { | 2017 | if (device_may_wakeup(tty_dev)) { |
| 2017 | enable_irq_wake(uport->irq); | 2018 | enable_irq_wake(uport->irq); |
| @@ -2019,20 +2020,23 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) | |||
| 2019 | mutex_unlock(&port->mutex); | 2020 | mutex_unlock(&port->mutex); |
| 2020 | return 0; | 2021 | return 0; |
| 2021 | } | 2022 | } |
| 2022 | uport->suspended = 1; | 2023 | if (console_suspend_enabled || !uart_console(uport)) |
| 2024 | uport->suspended = 1; | ||
| 2023 | 2025 | ||
| 2024 | if (port->flags & ASYNC_INITIALIZED) { | 2026 | if (port->flags & ASYNC_INITIALIZED) { |
| 2025 | const struct uart_ops *ops = uport->ops; | 2027 | const struct uart_ops *ops = uport->ops; |
| 2026 | int tries; | 2028 | int tries; |
| 2027 | 2029 | ||
| 2028 | set_bit(ASYNCB_SUSPENDED, &port->flags); | 2030 | if (console_suspend_enabled || !uart_console(uport)) { |
| 2029 | clear_bit(ASYNCB_INITIALIZED, &port->flags); | 2031 | set_bit(ASYNCB_SUSPENDED, &port->flags); |
| 2032 | clear_bit(ASYNCB_INITIALIZED, &port->flags); | ||
| 2030 | 2033 | ||
| 2031 | spin_lock_irq(&uport->lock); | 2034 | spin_lock_irq(&uport->lock); |
| 2032 | ops->stop_tx(uport); | 2035 | ops->stop_tx(uport); |
| 2033 | ops->set_mctrl(uport, 0); | 2036 | ops->set_mctrl(uport, 0); |
| 2034 | ops->stop_rx(uport); | 2037 | ops->stop_rx(uport); |
| 2035 | spin_unlock_irq(&uport->lock); | 2038 | spin_unlock_irq(&uport->lock); |
| 2039 | } | ||
| 2036 | 2040 | ||
| 2037 | /* | 2041 | /* |
| 2038 | * Wait for the transmitter to empty. | 2042 | * Wait for the transmitter to empty. |
| @@ -2047,16 +2051,18 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) | |||
| 2047 | drv->dev_name, | 2051 | drv->dev_name, |
| 2048 | drv->tty_driver->name_base + uport->line); | 2052 | drv->tty_driver->name_base + uport->line); |
| 2049 | 2053 | ||
| 2050 | ops->shutdown(uport); | 2054 | if (console_suspend_enabled || !uart_console(uport)) |
| 2055 | ops->shutdown(uport); | ||
| 2051 | } | 2056 | } |
| 2052 | 2057 | ||
| 2053 | /* | 2058 | /* |
| 2054 | * Disable the console device before suspending. | 2059 | * Disable the console device before suspending. |
| 2055 | */ | 2060 | */ |
| 2056 | if (uart_console(uport)) | 2061 | if (console_suspend_enabled && uart_console(uport)) |
| 2057 | console_stop(uport->cons); | 2062 | console_stop(uport->cons); |
| 2058 | 2063 | ||
| 2059 | uart_change_pm(state, 3); | 2064 | if (console_suspend_enabled || !uart_console(uport)) |
| 2065 | uart_change_pm(state, 3); | ||
| 2060 | 2066 | ||
| 2061 | mutex_unlock(&port->mutex); | 2067 | mutex_unlock(&port->mutex); |
| 2062 | 2068 | ||
| @@ -2073,29 +2079,6 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) | |||
| 2073 | 2079 | ||
| 2074 | mutex_lock(&port->mutex); | 2080 | mutex_lock(&port->mutex); |
| 2075 | 2081 | ||
| 2076 | if (!console_suspend_enabled && uart_console(uport)) { | ||
| 2077 | /* no need to resume serial console, it wasn't suspended */ | ||
| 2078 | /* | ||
| 2079 | * First try to use the console cflag setting. | ||
| 2080 | */ | ||
| 2081 | memset(&termios, 0, sizeof(struct ktermios)); | ||
| 2082 | termios.c_cflag = uport->cons->cflag; | ||
| 2083 | /* | ||
| 2084 | * If that's unset, use the tty termios setting. | ||
| 2085 | */ | ||
| 2086 | if (termios.c_cflag == 0) | ||
| 2087 | termios = *state->port.tty->termios; | ||
| 2088 | else { | ||
| 2089 | termios.c_ispeed = termios.c_ospeed = | ||
| 2090 | tty_termios_input_baud_rate(&termios); | ||
| 2091 | termios.c_ispeed = termios.c_ospeed = | ||
| 2092 | tty_termios_baud_rate(&termios); | ||
| 2093 | } | ||
| 2094 | uport->ops->set_termios(uport, &termios, NULL); | ||
| 2095 | mutex_unlock(&port->mutex); | ||
| 2096 | return 0; | ||
| 2097 | } | ||
| 2098 | |||
| 2099 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); | 2082 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); |
| 2100 | if (!uport->suspended && device_may_wakeup(tty_dev)) { | 2083 | if (!uport->suspended && device_may_wakeup(tty_dev)) { |
| 2101 | disable_irq_wake(uport->irq); | 2084 | disable_irq_wake(uport->irq); |
| @@ -2121,21 +2104,23 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) | |||
| 2121 | spin_lock_irq(&uport->lock); | 2104 | spin_lock_irq(&uport->lock); |
| 2122 | ops->set_mctrl(uport, 0); | 2105 | ops->set_mctrl(uport, 0); |
| 2123 | spin_unlock_irq(&uport->lock); | 2106 | spin_unlock_irq(&uport->lock); |
| 2124 | ret = ops->startup(uport); | 2107 | if (console_suspend_enabled || !uart_console(uport)) { |
| 2125 | if (ret == 0) { | 2108 | ret = ops->startup(uport); |
| 2126 | uart_change_speed(state, NULL); | 2109 | if (ret == 0) { |
| 2127 | spin_lock_irq(&uport->lock); | 2110 | uart_change_speed(state, NULL); |
| 2128 | ops->set_mctrl(uport, uport->mctrl); | 2111 | spin_lock_irq(&uport->lock); |
| 2129 | ops->start_tx(uport); | 2112 | ops->set_mctrl(uport, uport->mctrl); |
| 2130 | spin_unlock_irq(&uport->lock); | 2113 | ops->start_tx(uport); |
| 2131 | set_bit(ASYNCB_INITIALIZED, &port->flags); | 2114 | spin_unlock_irq(&uport->lock); |
| 2132 | } else { | 2115 | set_bit(ASYNCB_INITIALIZED, &port->flags); |
| 2133 | /* | 2116 | } else { |
| 2134 | * Failed to resume - maybe hardware went away? | 2117 | /* |
| 2135 | * Clear the "initialized" flag so we won't try | 2118 | * Failed to resume - maybe hardware went away? |
| 2136 | * to call the low level drivers shutdown method. | 2119 | * Clear the "initialized" flag so we won't try |
| 2137 | */ | 2120 | * to call the low level drivers shutdown method. |
| 2138 | uart_shutdown(state); | 2121 | */ |
| 2122 | uart_shutdown(state); | ||
| 2123 | } | ||
| 2139 | } | 2124 | } |
| 2140 | 2125 | ||
| 2141 | clear_bit(ASYNCB_SUSPENDED, &port->flags); | 2126 | clear_bit(ASYNCB_SUSPENDED, &port->flags); |
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 0ee7239c5d69..95421fa3b304 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
| @@ -146,7 +146,8 @@ static void quirk_wakeup_oxsemi(struct pcmcia_device *link) | |||
| 146 | { | 146 | { |
| 147 | struct serial_info *info = link->priv; | 147 | struct serial_info *info = link->priv; |
| 148 | 148 | ||
| 149 | outb(12, info->c950ctrl + 1); | 149 | if (info->c950ctrl) |
| 150 | outb(12, info->c950ctrl + 1); | ||
| 150 | } | 151 | } |
| 151 | 152 | ||
| 152 | /* request_region? oxsemi branch does no request_region too... */ | 153 | /* request_region? oxsemi branch does no request_region too... */ |
| @@ -757,6 +758,7 @@ static struct pcmcia_device_id serial_ids[] = { | |||
| 757 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "PCMCIAs", "LanModem", 0xdcfe12d3, 0xc67c648f), | 758 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "PCMCIAs", "LanModem", 0xdcfe12d3, 0xc67c648f), |
| 758 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "TDK", "GlobalNetworker 3410/3412", 0x1eae9475, 0xd9a93bed), | 759 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "TDK", "GlobalNetworker 3410/3412", 0x1eae9475, 0xd9a93bed), |
| 759 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "Xircom", "CreditCard Ethernet+Modem II", 0x2e3ee845, 0xeca401bf), | 760 | PCMCIA_PFC_DEVICE_PROD_ID12(1, "Xircom", "CreditCard Ethernet+Modem II", 0x2e3ee845, 0xeca401bf), |
| 761 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0e01), | ||
| 760 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0a05), | 762 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0a05), |
| 761 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x1101), | 763 | PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x1101), |
| 762 | PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0104, 0x0070), | 764 | PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0104, 0x0070), |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 37f0de9dd9ce..42f3333c4ad0 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -1052,7 +1052,18 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
| 1052 | sci_port->port.ops = &sci_uart_ops; | 1052 | sci_port->port.ops = &sci_uart_ops; |
| 1053 | sci_port->port.iotype = UPIO_MEM; | 1053 | sci_port->port.iotype = UPIO_MEM; |
| 1054 | sci_port->port.line = index; | 1054 | sci_port->port.line = index; |
| 1055 | sci_port->port.fifosize = 1; | 1055 | |
| 1056 | switch (p->type) { | ||
| 1057 | case PORT_SCIFA: | ||
| 1058 | sci_port->port.fifosize = 64; | ||
| 1059 | break; | ||
| 1060 | case PORT_SCIF: | ||
| 1061 | sci_port->port.fifosize = 16; | ||
| 1062 | break; | ||
| 1063 | default: | ||
| 1064 | sci_port->port.fifosize = 1; | ||
| 1065 | break; | ||
| 1066 | } | ||
| 1056 | 1067 | ||
| 1057 | if (dev) { | 1068 | if (dev) { |
| 1058 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; | 1069 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; |
