Skip to content

Commit efb8d21

Browse files
committed
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (79 commits) TTY: serial_core: Fix crash if DCD drop during suspend tty/serial: atmel_serial: bootconsole removed from auto-enumerates Revert "TTY: call tty_driver_lookup_tty unconditionally" tty/serial: atmel_serial: add device tree support tty/serial: atmel_serial: auto-enumerate ports tty/serial: atmel_serial: whitespace and braces modifications tty/serial: atmel_serial: change platform_data variable name tty/serial: RS485 bindings for device tree TTY: call tty_driver_lookup_tty unconditionally TTY: pty, release tty in all ptmx_open fail paths TTY: make tty_add_file non-failing TTY: drop driver reference in tty_open fail path 8250_pci: Fix kernel panic when pch_uart is disabled h8300: drivers/serial/Kconfig was moved parport_pc: release IO region properly if unsupported ITE887x card is found tty: Support compat_ioctl get/set termios_locked hvc_console: display printk messages on console. TTY: snyclinkmp: forever loop in tx_load_dma_buffer() tty/n_gsm: avoid fifo overflow in gsm_dlci_data_output tty/n_gsm: fix a bug in gsm_dlci_data_output (adaption = 2 case) ... Fix up Conflicts in: - drivers/tty/serial/8250_pci.c Trivial conflict with removed duplicate device ID - drivers/tty/serial/atmel_serial.c Annoying silly conflict between "specify the port num via platform_data" and other changes to atmel_console_init
2 parents 3cb6032 + d208a3b commit efb8d21

110 files changed

Lines changed: 2101 additions & 946 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
* RS485 serial communications
2+
3+
The RTS signal is capable of automatically controlling line direction for
4+
the built-in half-duplex mode.
5+
The properties described hereafter shall be given to a half-duplex capable
6+
UART node.
7+
8+
Required properties:
9+
- rs485-rts-delay: prop-encoded-array <a b> where:
10+
* a is the delay beteween rts signal and beginning of data sent in milliseconds.
11+
it corresponds to the delay before sending data.
12+
* b is the delay between end of data sent and rts signal in milliseconds
13+
it corresponds to the delay after sending data and actual release of the line.
14+
15+
Optional properties:
16+
- linux,rs485-enabled-at-boot-time: empty property telling to enable the rs485
17+
feature at boot time. It can be disabled later with proper ioctl.
18+
- rs485-rx-during-tx: empty property that enables the receiving of data even
19+
whilst sending data.
20+
21+
RS485 example for Atmel USART:
22+
usart0: serial@fff8c000 {
23+
compatible = "atmel,at91sam9260-usart";
24+
reg = <0xfff8c000 0x4000>;
25+
interrupts = <7>;
26+
atmel,use-dma-rx;
27+
atmel,use-dma-tx;
28+
linux,rs485-enabled-at-boot-time;
29+
rs485-rts-delay = <0 200>; // in milliseconds
30+
};
31+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
* Atmel Universal Synchronous Asynchronous Receiver/Transmitter (USART)
2+
3+
Required properties:
4+
- compatible: Should be "atmel,<chip>-usart"
5+
The compatible <chip> indicated will be the first SoC to support an
6+
additional mode or an USART new feature.
7+
- reg: Should contain registers location and length
8+
- interrupts: Should contain interrupt
9+
10+
Optional properties:
11+
- atmel,use-dma-rx: use of PDC or DMA for receiving data
12+
- atmel,use-dma-tx: use of PDC or DMA for transmitting data
13+
14+
<chip> compatible description:
15+
- at91rm9200: legacy USART support
16+
- at91sam9260: generic USART implementation for SAM9 SoCs
17+
18+
Example:
19+
20+
usart0: serial@fff8c000 {
21+
compatible = "atmel,at91sam9260-usart";
22+
reg = <0xfff8c000 0x4000>;
23+
interrupts = <7>;
24+
atmel,use-dma-rx;
25+
atmel,use-dma-tx;
26+
};
27+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
* Synopsys DesignWare ABP UART
2+
3+
Required properties:
4+
- compatible : "snps,dw-apb-uart"
5+
- reg : offset and length of the register set for the device.
6+
- interrupts : should contain uart interrupt.
7+
- clock-frequency : the input clock frequency for the UART.
8+
9+
Optional properties:
10+
- reg-shift : quantity to shift the register offsets by. If this property is
11+
not present then the register offsets are not shifted.
12+
- reg-io-width : the size (in bytes) of the IO accesses that should be
13+
performed on the device. If this property is not present then single byte
14+
accesses are used.
15+
16+
Example:
17+
18+
uart@80230000 {
19+
compatible = "snps,dw-apb-uart";
20+
reg = <0x80230000 0x100>;
21+
clock-frequency = <3686400>;
22+
interrupts = <10>;
23+
reg-shift = <2>;
24+
reg-io-width = <4>;
25+
};

‎Documentation/serial/serial-rs485.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
RS485 communications. This data structure is used to set and configure RS485
2929
parameters in the platform data and in ioctls.
3030

31+
The device tree can also provide RS485 boot time parameters (see [2]
32+
for bindings). The driver is in charge of filling this data structure from
33+
the values given by the device tree.
34+
3135
Any driver for devices capable of working both as RS232 and RS485 should
3236
provide at least the following ioctls:
3337

@@ -104,6 +108,9 @@
104108
rs485conf.flags |= SER_RS485_RTS_AFTER_SEND;
105109
rs485conf.delay_rts_after_send = ...;
106110

111+
/* Set this flag if you want to receive data even whilst sending data */
112+
rs485conf.flags |= SER_RS485_RX_DURING_TX;
113+
107114
if (ioctl (fd, TIOCSRS485, &rs485conf) < 0) {
108115
/* Error handling. See errno. */
109116
}
@@ -118,3 +125,4 @@
118125
5. REFERENCES
119126

120127
[1] include/linux/serial.h
128+
[2] Documentation/devicetree/bindings/serial/rs485.txt

‎arch/arm/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ config ARCH_S3C64XX
727727
select ARCH_REQUIRE_GPIOLIB
728728
select SAMSUNG_CLKSRC
729729
select SAMSUNG_IRQ_VIC_TIMER
730-
select SAMSUNG_IRQ_UART
731730
select S3C_GPIO_TRACK
732731
select S3C_GPIO_PULL_UPDOWN
733732
select S3C_GPIO_CFG_S3C24XX

‎arch/arm/mach-s3c64xx/dev-uart.c‎

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,10 @@ static struct resource s3c64xx_uart0_resource[] = {
3737
.flags = IORESOURCE_MEM,
3838
},
3939
[1] = {
40-
.start = IRQ_S3CUART_RX0,
41-
.end = IRQ_S3CUART_RX0,
40+
.start = IRQ_UART0,
41+
.end = IRQ_UART0,
4242
.flags = IORESOURCE_IRQ,
4343
},
44-
[2] = {
45-
.start = IRQ_S3CUART_TX0,
46-
.end = IRQ_S3CUART_TX0,
47-
.flags = IORESOURCE_IRQ,
48-
49-
},
50-
[3] = {
51-
.start = IRQ_S3CUART_ERR0,
52-
.end = IRQ_S3CUART_ERR0,
53-
.flags = IORESOURCE_IRQ,
54-
}
5544
};
5645

5746
static struct resource s3c64xx_uart1_resource[] = {
@@ -61,19 +50,8 @@ static struct resource s3c64xx_uart1_resource[] = {
6150
.flags = IORESOURCE_MEM,
6251
},
6352
[1] = {
64-
.start = IRQ_S3CUART_RX1,
65-
.end = IRQ_S3CUART_RX1,
66-
.flags = IORESOURCE_IRQ,
67-
},
68-
[2] = {
69-
.start = IRQ_S3CUART_TX1,
70-
.end = IRQ_S3CUART_TX1,
71-
.flags = IORESOURCE_IRQ,
72-
73-
},
74-
[3] = {
75-
.start = IRQ_S3CUART_ERR1,
76-
.end = IRQ_S3CUART_ERR1,
53+
.start = IRQ_UART1,
54+
.end = IRQ_UART1,
7755
.flags = IORESOURCE_IRQ,
7856
},
7957
};
@@ -85,19 +63,8 @@ static struct resource s3c6xx_uart2_resource[] = {
8563
.flags = IORESOURCE_MEM,
8664
},
8765
[1] = {
88-
.start = IRQ_S3CUART_RX2,
89-
.end = IRQ_S3CUART_RX2,
90-
.flags = IORESOURCE_IRQ,
91-
},
92-
[2] = {
93-
.start = IRQ_S3CUART_TX2,
94-
.end = IRQ_S3CUART_TX2,
95-
.flags = IORESOURCE_IRQ,
96-
97-
},
98-
[3] = {
99-
.start = IRQ_S3CUART_ERR2,
100-
.end = IRQ_S3CUART_ERR2,
66+
.start = IRQ_UART2,
67+
.end = IRQ_UART2,
10168
.flags = IORESOURCE_IRQ,
10269
},
10370
};
@@ -109,19 +76,8 @@ static struct resource s3c64xx_uart3_resource[] = {
10976
.flags = IORESOURCE_MEM,
11077
},
11178
[1] = {
112-
.start = IRQ_S3CUART_RX3,
113-
.end = IRQ_S3CUART_RX3,
114-
.flags = IORESOURCE_IRQ,
115-
},
116-
[2] = {
117-
.start = IRQ_S3CUART_TX3,
118-
.end = IRQ_S3CUART_TX3,
119-
.flags = IORESOURCE_IRQ,
120-
121-
},
122-
[3] = {
123-
.start = IRQ_S3CUART_ERR3,
124-
.end = IRQ_S3CUART_ERR3,
79+
.start = IRQ_UART3,
80+
.end = IRQ_UART3,
12581
.flags = IORESOURCE_IRQ,
12682
},
12783
};

‎arch/arm/mach-s3c64xx/include/mach/irqs.h‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,6 @@
2727
#define IRQ_VIC0_BASE S3C_IRQ(0)
2828
#define IRQ_VIC1_BASE S3C_IRQ(32)
2929

30-
/* UART interrupts, each UART has 4 intterupts per channel so
31-
* use the space between the ISA and S3C main interrupts. Note, these
32-
* are not in the same order as the S3C24XX series! */
33-
34-
#define IRQ_S3CUART_BASE0 (16)
35-
#define IRQ_S3CUART_BASE1 (20)
36-
#define IRQ_S3CUART_BASE2 (24)
37-
#define IRQ_S3CUART_BASE3 (28)
38-
39-
#define UART_IRQ_RXD (0)
40-
#define UART_IRQ_ERR (1)
41-
#define UART_IRQ_TXD (2)
42-
#define UART_IRQ_MODEM (3)
43-
44-
#define IRQ_S3CUART_RX0 (IRQ_S3CUART_BASE0 + UART_IRQ_RXD)
45-
#define IRQ_S3CUART_TX0 (IRQ_S3CUART_BASE0 + UART_IRQ_TXD)
46-
#define IRQ_S3CUART_ERR0 (IRQ_S3CUART_BASE0 + UART_IRQ_ERR)
47-
48-
#define IRQ_S3CUART_RX1 (IRQ_S3CUART_BASE1 + UART_IRQ_RXD)
49-
#define IRQ_S3CUART_TX1 (IRQ_S3CUART_BASE1 + UART_IRQ_TXD)
50-
#define IRQ_S3CUART_ERR1 (IRQ_S3CUART_BASE1 + UART_IRQ_ERR)
51-
52-
#define IRQ_S3CUART_RX2 (IRQ_S3CUART_BASE2 + UART_IRQ_RXD)
53-
#define IRQ_S3CUART_TX2 (IRQ_S3CUART_BASE2 + UART_IRQ_TXD)
54-
#define IRQ_S3CUART_ERR2 (IRQ_S3CUART_BASE2 + UART_IRQ_ERR)
55-
56-
#define IRQ_S3CUART_RX3 (IRQ_S3CUART_BASE3 + UART_IRQ_RXD)
57-
#define IRQ_S3CUART_TX3 (IRQ_S3CUART_BASE3 + UART_IRQ_TXD)
58-
#define IRQ_S3CUART_ERR3 (IRQ_S3CUART_BASE3 + UART_IRQ_ERR)
59-
6030
/* VIC based IRQs */
6131

6232
#define S3C64XX_IRQ_VIC0(x) (IRQ_VIC0_BASE + (x))

‎arch/arm/mach-s3c64xx/irq.c‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,6 @@
2525
#include <plat/irq-uart.h>
2626
#include <plat/cpu.h>
2727

28-
static struct s3c_uart_irq uart_irqs[] = {
29-
[0] = {
30-
.regs = S3C_VA_UART0,
31-
.base_irq = IRQ_S3CUART_BASE0,
32-
.parent_irq = IRQ_UART0,
33-
},
34-
[1] = {
35-
.regs = S3C_VA_UART1,
36-
.base_irq = IRQ_S3CUART_BASE1,
37-
.parent_irq = IRQ_UART1,
38-
},
39-
[2] = {
40-
.regs = S3C_VA_UART2,
41-
.base_irq = IRQ_S3CUART_BASE2,
42-
.parent_irq = IRQ_UART2,
43-
},
44-
[3] = {
45-
.regs = S3C_VA_UART3,
46-
.base_irq = IRQ_S3CUART_BASE3,
47-
.parent_irq = IRQ_UART3,
48-
},
49-
};
50-
5128
/* setup the sources the vic should advertise resume for, even though it
5229
* is not doing the wake (set_irq_wake needs to be valid) */
5330
#define IRQ_VIC0_RESUME (1 << (IRQ_RTC_TIC - IRQ_VIC0_BASE))
@@ -67,6 +44,4 @@ void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
6744

6845
/* add the timer sub-irqs */
6946
s3c_init_vic_timer_irq(5, IRQ_TIMER0);
70-
71-
s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
7247
}

‎arch/arm/plat-s5p/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config PLAT_S5P
2222
select PLAT_SAMSUNG
2323
select SAMSUNG_CLKSRC
2424
select SAMSUNG_IRQ_VIC_TIMER
25-
select SAMSUNG_IRQ_UART
2625
help
2726
Base platform code for Samsung's S5P series SoC.
2827

0 commit comments

Comments
 (0)