提交 64e9159f 编写于 作者: A Alan Cox 提交者: Linus Torvalds

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: NAlan Cox <alan@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4b34fe15
...@@ -1165,6 +1165,15 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, ...@@ -1165,6 +1165,15 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd,
return ret; return ret;
} }
static void uart_set_ldisc(struct tty_struct *tty, int ldisc)
{
struct uart_state *state = tty->driver_data;
struct uart_port *port = state->port;
if (port->ops->set_ldisc)
port->ops->set_ldisc(port);
}
static void uart_set_termios(struct tty_struct *tty, static void uart_set_termios(struct tty_struct *tty,
struct ktermios *old_termios) struct ktermios *old_termios)
{ {
...@@ -2288,6 +2297,7 @@ static const struct tty_operations uart_ops = { ...@@ -2288,6 +2297,7 @@ static const struct tty_operations uart_ops = {
.unthrottle = uart_unthrottle, .unthrottle = uart_unthrottle,
.send_xchar = uart_send_xchar, .send_xchar = uart_send_xchar,
.set_termios = uart_set_termios, .set_termios = uart_set_termios,
.set_ldisc = uart_set_ldisc,
.stop = uart_stop, .stop = uart_stop,
.start = uart_start, .start = uart_start,
.hangup = uart_hangup, .hangup = uart_hangup,
......
...@@ -192,6 +192,7 @@ struct uart_ops { ...@@ -192,6 +192,7 @@ struct uart_ops {
void (*shutdown)(struct uart_port *); void (*shutdown)(struct uart_port *);
void (*set_termios)(struct uart_port *, struct ktermios *new, void (*set_termios)(struct uart_port *, struct ktermios *new,
struct ktermios *old); struct ktermios *old);
void (*set_ldisc)(struct uart_port *);
void (*pm)(struct uart_port *, unsigned int state, void (*pm)(struct uart_port *, unsigned int state,
unsigned int oldstate); unsigned int oldstate);
int (*set_wake)(struct uart_port *, unsigned int state); int (*set_wake)(struct uart_port *, unsigned int state);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册