diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-12-31 20:49:41 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 05:06:18 +0400 |
commit | 71b9e8c6694f5cfe6cd37d53d6c24a33f1f59abd (patch) | |
tree | 41ec75072ca746c29cf629f7a31e6ff2ec596692 /drivers/tty | |
parent | b8c98ae49e8d53344b1d62417eea05ebc3cdbd78 (diff) | |
download | linux-71b9e8c6694f5cfe6cd37d53d6c24a33f1f59abd.tar.xz |
serial: clps711x: Add support for N_IRDA line discipline
This patch replace custom handling of IrDA feature with N_IRDA
line discipline, so IrDA mode can be used with irtty driver.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/clps711x.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 4f59f1cb9116..5a931f97aa7c 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -232,6 +232,16 @@ static void uart_clps711x_break_ctl(struct uart_port *port, int break_state) writel_relaxed(ubrlcr, port->membase + UBRLCR_OFFSET); } +static void uart_clps711x_set_ldisc(struct uart_port *port, int ld) +{ + if (!port->line) { + struct clps711x_port *s = dev_get_drvdata(port->dev); + + regmap_update_bits(s->syscon, SYSCON_OFFSET, SYSCON1_SIREN, + (ld == N_IRDA) ? SYSCON1_SIREN : 0); + } +} + static int uart_clps711x_startup(struct uart_port *port) { struct clps711x_port *s = dev_get_drvdata(port->dev); @@ -342,6 +352,7 @@ static const struct uart_ops uart_clps711x_ops = { .stop_rx = uart_clps711x_nop_void, .enable_ms = uart_clps711x_nop_void, .break_ctl = uart_clps711x_break_ctl, + .set_ldisc = uart_clps711x_set_ldisc, .startup = uart_clps711x_startup, .shutdown = uart_clps711x_shutdown, .set_termios = uart_clps711x_set_termios, @@ -482,15 +493,8 @@ static int uart_clps711x_probe(struct platform_device *pdev) if (IS_ERR(s->syscon)) return PTR_ERR(s->syscon); - if (!index) { - bool use_irda; - + if (!index) s->use_ms = of_property_read_bool(np, "uart-use-ms"); - use_irda = of_property_read_bool(np, "uart-use-irda"); - regmap_update_bits(s->syscon, SYSCON_OFFSET, - SYSCON1_SIREN, - use_irda ? SYSCON1_SIREN : 0); - } } s->port.line = index; |