diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-06-03 10:18:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-03 11:20:17 -0400 |
commit | 64e9159f5d2c4edf5fa6425031e556f8fddaf7e6 (patch) | |
tree | 77989ed8da4c26be343c1e3e065cdfbb152a44cd /drivers/serial | |
parent | 4b34fe156455d26ee6ed67b61539f136bf4e439c (diff) |
serial_core: uart_set_ldisc infrastructure
The tty layer provides a callback that is used when the line discipline
is changed. Some hardware uses this to configure hardware specific
features such as IrDA mode on serial ports. Unfortunately the serial
layer does not provide this feature or pass it down to drivers.
Blackfin used to hack around this by rewriting the tty ops, but those are
now properly shared and const so the hack fails. Instead provide the
proper operations.
This change plus a follow up from the Blackfin guys is needed to avoid
blackfin losing features in this release.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 53b03c629aff..951a75ea6e3e 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 | ||
1168 | static void uart_set_ldisc(struct tty_struct *tty, int ldisc) | ||
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 | |||
1168 | static void uart_set_termios(struct tty_struct *tty, | 1177 | static void uart_set_termios(struct tty_struct *tty, |
1169 | struct ktermios *old_termios) | 1178 | struct ktermios *old_termios) |
1170 | { | 1179 | { |
@@ -2288,6 +2297,7 @@ static const struct tty_operations uart_ops = { | |||
2288 | .unthrottle = uart_unthrottle, | 2297 | .unthrottle = uart_unthrottle, |
2289 | .send_xchar = uart_send_xchar, | 2298 | .send_xchar = uart_send_xchar, |
2290 | .set_termios = uart_set_termios, | 2299 | .set_termios = uart_set_termios, |
2300 | .set_ldisc = uart_set_ldisc, | ||
2291 | .stop = uart_stop, | 2301 | .stop = uart_stop, |
2292 | .start = uart_start, | 2302 | .start = uart_start, |
2293 | .hangup = uart_hangup, | 2303 | .hangup = uart_hangup, |