From 3c0f0f9f7d9b558089ce6701f72a932b63192384 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Wed, 11 Dec 2013 19:52:35 +0400 Subject: serial: clps711x: dts: Add bindings documentation for the CLPS711X UART This patch adds the devicetree documentation for the Cirrus Logic CLPS711X UART. Signed-off-by: Alexander Shiyan Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- .../bindings/serial/cirrus,clps711x-uart.txt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt new file mode 100644 index 00000000000..8bbdd21ed6a --- /dev/null +++ b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt @@ -0,0 +1,29 @@ +* Cirrus Logic CLPS711X Universal Asynchronous Receiver/Transmitter (UART) + +Required properties: +- compatible: Should be "cirrus,clps711x-uart". +- reg: Address and length of the register set for the device. +- interrupts: Should contain UART TX and RX interrupt. +- clocks: Should contain UART core clock number. +- syscon: Phandle to SYSCON node, which contain UART control bits. + +Optional properties: +- uart-use-ms: Indicate the UART has modem signal (DCD, DSR, CTS). +- uart-use-irda: Indicate the UART use IRDA mode. + +Note: Each UART port should have an alias correctly numbered +in "aliases" node. + +Example: + aliases { + serial0 = &uart1; + }; + + uart1: uart@80000480 { + compatible = "cirrus,clps711x-uart"; + reg = <0x80000480 0x80>; + interrupts = <12 13>; + clocks = <&clks 11>; + syscon = <&syscon1>; + uart-use-ms; + }; -- cgit v1.2.3-70-g09d2 From 8be3da65d9222e1e63b7f9d001e872947588946f Mon Sep 17 00:00:00 2001 From: Boris BREZILLON Date: Tue, 17 Dec 2013 17:22:20 +0100 Subject: tty/serial: at91: document clock properties Document the clock properties required by the at91 usart driver. Signed-off-by: Boris BREZILLON Signed-off-by: Greg Kroah-Hartman --- Documentation/devicetree/bindings/serial/atmel-usart.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/serial/atmel-usart.txt b/Documentation/devicetree/bindings/serial/atmel-usart.txt index 2191dcb9f1d..9c5d19ac935 100644 --- a/Documentation/devicetree/bindings/serial/atmel-usart.txt +++ b/Documentation/devicetree/bindings/serial/atmel-usart.txt @@ -6,6 +6,9 @@ Required properties: additional mode or an USART new feature. - reg: Should contain registers location and length - interrupts: Should contain interrupt +- clock-names: tuple listing input clock names. + Required elements: "usart" +- clocks: phandles to input clocks. Optional properties: - atmel,use-dma-rx: use of PDC or DMA for receiving data @@ -26,6 +29,8 @@ Example: compatible = "atmel,at91sam9260-usart"; reg = <0xfff8c000 0x4000>; interrupts = <7>; + clocks = <&usart0_clk>; + clock-names = "usart"; atmel,use-dma-rx; atmel,use-dma-tx; }; @@ -35,6 +40,8 @@ Example: compatible = "atmel,at91sam9260-usart"; reg = <0xf001c000 0x100>; interrupts = <12 4 5>; + clocks = <&usart0_clk>; + clock-names = "usart"; atmel,use-dma-rx; atmel,use-dma-tx; dmas = <&dma0 2 0x3>, -- cgit v1.2.3-70-g09d2 From 71b9e8c6694f5cfe6cd37d53d6c24a33f1f59abd Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 31 Dec 2013 20:49:41 +0400 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- .../bindings/serial/cirrus,clps711x-uart.txt | 1 - drivers/tty/serial/clps711x.c | 20 ++++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt b/Documentation/devicetree/bindings/serial/cirrus,clps711x-uart.txt index 8bbdd21ed6a..12f3cf834de 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: Optional properties: - uart-use-ms: Indicate the UART has modem signal (DCD, DSR, CTS). -- uart-use-irda: Indicate the UART use IRDA mode. Note: Each UART port should have an alias correctly numbered in "aliases" node. diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 4f59f1cb911..5a931f97aa7 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; -- cgit v1.2.3-70-g09d2