aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-12-31 11:49:41 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-07 20:06:18 -0500
commit71b9e8c6694f5cfe6cd37d53d6c24a33f1f59abd (patch)
tree41ec75072ca746c29cf629f7a31e6ff2ec596692
parentb8c98ae49e8d53344b1d62417eea05ebc3cdbd78 (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>
-rw-r--r--Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt1
-rw-r--r--drivers/tty/serial/clps711x.c20
2 files changed, 12 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt
index 8bbdd21ed6ac..12f3cf834deb 100644
--- a/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt
+++ b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt
@@ -9,7 +9,6 @@ Required properties:
9 9
10Optional properties: 10Optional properties:
11- uart-use-ms: Indicate the UART has modem signal (DCD, DSR, CTS). 11- uart-use-ms: Indicate the UART has modem signal (DCD, DSR, CTS).
12- uart-use-irda: Indicate the UART use IRDA mode.
13 12
14Note: Each UART port should have an alias correctly numbered 13Note: Each UART port should have an alias correctly numbered
15in "aliases" node. 14in "aliases" node.
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
235static 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
235static int uart_clps711x_startup(struct uart_port *port) 245static 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;