diff options
| -rw-r--r-- | Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt | 1 | ||||
| -rw-r--r-- | drivers/tty/serial/clps711x.c | 20 |
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 | ||
| 10 | Optional properties: | 10 | Optional 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 | ||
| 14 | Note: Each UART port should have an alias correctly numbered | 13 | Note: Each UART port should have an alias correctly numbered |
| 15 | in "aliases" node. | 14 | in "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 | ||
| 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; |
