diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-12-31 11:49:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-07 20:06:18 -0500 |
commit | 71b9e8c6694f5cfe6cd37d53d6c24a33f1f59abd (patch) | |
tree | 41ec75072ca746c29cf629f7a31e6ff2ec596692 /drivers/tty | |
parent | b8c98ae49e8d53344b1d62417eea05ebc3cdbd78 (diff) |
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) | |||
232 | writel_relaxed(ubrlcr, port->membase + UBRLCR_OFFSET); | 232 | writel_relaxed(ubrlcr, port->membase + UBRLCR_OFFSET); |
233 | } | 233 | } |
234 | 234 | ||
235 | static void uart_clps711x_set_ldisc(struct uart_port *port, int ld) | ||
236 | { | ||
237 | if (!port->line) { | ||
238 | struct clps711x_port *s = dev_get_drvdata(port->dev); | ||
239 | |||
240 | regmap_update_bits(s->syscon, SYSCON_OFFSET, SYSCON1_SIREN, | ||
241 | (ld == N_IRDA) ? SYSCON1_SIREN : 0); | ||
242 | } | ||
243 | } | ||
244 | |||
235 | static int uart_clps711x_startup(struct uart_port *port) | 245 | static int uart_clps711x_startup(struct uart_port *port) |
236 | { | 246 | { |
237 | struct clps711x_port *s = dev_get_drvdata(port->dev); | 247 | struct clps711x_port *s = dev_get_drvdata(port->dev); |
@@ -342,6 +352,7 @@ static const struct uart_ops uart_clps711x_ops = { | |||
342 | .stop_rx = uart_clps711x_nop_void, | 352 | .stop_rx = uart_clps711x_nop_void, |
343 | .enable_ms = uart_clps711x_nop_void, | 353 | .enable_ms = uart_clps711x_nop_void, |
344 | .break_ctl = uart_clps711x_break_ctl, | 354 | .break_ctl = uart_clps711x_break_ctl, |
355 | .set_ldisc = uart_clps711x_set_ldisc, | ||
345 | .startup = uart_clps711x_startup, | 356 | .startup = uart_clps711x_startup, |
346 | .shutdown = uart_clps711x_shutdown, | 357 | .shutdown = uart_clps711x_shutdown, |
347 | .set_termios = uart_clps711x_set_termios, | 358 | .set_termios = uart_clps711x_set_termios, |
@@ -482,15 +493,8 @@ static int uart_clps711x_probe(struct platform_device *pdev) | |||
482 | if (IS_ERR(s->syscon)) | 493 | if (IS_ERR(s->syscon)) |
483 | return PTR_ERR(s->syscon); | 494 | return PTR_ERR(s->syscon); |
484 | 495 | ||
485 | if (!index) { | 496 | if (!index) |
486 | bool use_irda; | ||
487 | |||
488 | s->use_ms = of_property_read_bool(np, "uart-use-ms"); | 497 | s->use_ms = of_property_read_bool(np, "uart-use-ms"); |
489 | use_irda = of_property_read_bool(np, "uart-use-irda"); | ||
490 | regmap_update_bits(s->syscon, SYSCON_OFFSET, | ||
491 | SYSCON1_SIREN, | ||
492 | use_irda ? SYSCON1_SIREN : 0); | ||
493 | } | ||
494 | } | 498 | } |
495 | 499 | ||
496 | s->port.line = index; | 500 | s->port.line = index; |