aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r--drivers/serial/serial_core.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index eab032733790..42d2e108b679 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1165,6 +1165,15 @@ out:
1165 return ret; 1165 return ret;
1166} 1166}
1167 1167
1168static void uart_set_ldisc(struct tty_struct *tty)
1169{
1170 struct uart_state *state = tty->driver_data;
1171 struct uart_port *port = state->port;
1172
1173 if (port->ops->set_ldisc)
1174 port->ops->set_ldisc(port);
1175}
1176
1168static void uart_set_termios(struct tty_struct *tty, 1177static void uart_set_termios(struct tty_struct *tty,
1169 struct ktermios *old_termios) 1178 struct ktermios *old_termios)
1170{ 1179{
@@ -1982,7 +1991,9 @@ struct uart_match {
1982static int serial_match_port(struct device *dev, void *data) 1991static int serial_match_port(struct device *dev, void *data)
1983{ 1992{
1984 struct uart_match *match = data; 1993 struct uart_match *match = data;
1985 dev_t devt = MKDEV(match->driver->major, match->driver->minor) + match->port->line; 1994 struct tty_driver *tty_drv = match->driver->tty_driver;
1995 dev_t devt = MKDEV(tty_drv->major, tty_drv->minor_start) +
1996 match->port->line;
1986 1997
1987 return dev->devt == devt; /* Actually, only one tty per port */ 1998 return dev->devt == devt; /* Actually, only one tty per port */
1988} 1999}
@@ -2054,6 +2065,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
2054int uart_resume_port(struct uart_driver *drv, struct uart_port *port) 2065int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2055{ 2066{
2056 struct uart_state *state = drv->state + port->line; 2067 struct uart_state *state = drv->state + port->line;
2068 struct device *tty_dev;
2069 struct uart_match match = {port, drv};
2057 2070
2058 mutex_lock(&state->mutex); 2071 mutex_lock(&state->mutex);
2059 2072
@@ -2063,7 +2076,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2063 return 0; 2076 return 0;
2064 } 2077 }
2065 2078
2066 if (!port->suspended) { 2079 tty_dev = device_find_child(port->dev, &match, serial_match_port);
2080 if (!port->suspended && device_may_wakeup(tty_dev)) {
2067 disable_irq_wake(port->irq); 2081 disable_irq_wake(port->irq);
2068 mutex_unlock(&state->mutex); 2082 mutex_unlock(&state->mutex);
2069 return 0; 2083 return 0;
@@ -2285,6 +2299,7 @@ static const struct tty_operations uart_ops = {
2285 .unthrottle = uart_unthrottle, 2299 .unthrottle = uart_unthrottle,
2286 .send_xchar = uart_send_xchar, 2300 .send_xchar = uart_send_xchar,
2287 .set_termios = uart_set_termios, 2301 .set_termios = uart_set_termios,
2302 .set_ldisc = uart_set_ldisc,
2288 .stop = uart_stop, 2303 .stop = uart_stop,
2289 .start = uart_start, 2304 .start = uart_start,
2290 .hangup = uart_hangup, 2305 .hangup = uart_hangup,