Skip to content

Commit 7c314bd

Browse files
committed
Merge tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty / serial updates from Greg KH: "Here is the "big" set of tty/serial driver patches for 5.15-rc1 Nothing major in here at all, just some driver updates and more cleanups on old tty apis and code that needed it that includes: - tty.h cleanup of things that didn't belong in it - other tty cleanups by Jiri - driver cleanups - rs485 support added to amba-pl011 driver - dts updates - stm32 serial driver updates - other minor fixes and driver updates All have been in linux-next for a while with no reported problems" * tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (83 commits) tty: serial: uartlite: Use read_poll_timeout for a polling loop tty: serial: uartlite: Use constants in early_uartlite_putc tty: Fix data race between tiocsti() and flush_to_ldisc() serial: vt8500: Use of_device_get_match_data serial: tegra: Use of_device_get_match_data serial: 8250_ingenic: Use of_device_get_match_data tty: serial: linflexuart: Remove redundant check to simplify the code tty: serial: fsl_lpuart: do software reset for imx7ulp and imx8qxp tty: serial: fsl_lpuart: enable two stop bits for lpuart32 tty: serial: fsl_lpuart: fix the wrong mapbase value mxser: use semi-colons instead of commas tty: moxa: use semi-colons instead of commas tty: serial: fsl_lpuart: check dma_tx_in_progress in tx dma callback tty: replace in_irq() with in_hardirq() serial: sh-sci: fix break handling for sysrq serial: stm32: use devm_platform_get_and_ioremap_resource() serial: stm32: use the defined variable to simplify code Revert "arm pl011 serial: support multi-irq request" tty: serial: samsung: Add Exynos850 SoC data tty: serial: samsung: Fix driver data macros style ...
2 parents ebf435d + 2e5f3a6 commit 7c314bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1411
-1037
lines changed

Documentation/devicetree/bindings/serial/8250.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ properties:
6464
- const: nuvoton,npcm750-uart
6565
- const: nvidia,tegra20-uart
6666
- const: nxp,lpc3220-uart
67+
- items:
68+
- enum:
69+
- exar,xr16l2552
70+
- exar,xr16l2551
71+
- exar,xr16l2550
72+
- const: ns8250
6773
- items:
6874
- enum:
6975
- altr,16550-FIFO32

Documentation/devicetree/bindings/serial/8250_omap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ properties:
7979
power-domains: true
8080
clock-frequency: true
8181
current-speed: true
82+
overrun-throttle-ms: true
8283

8384
required:
8485
- compatible

Documentation/devicetree/bindings/serial/cdns,uart.txt

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/serial/cdns,uart.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Cadence UART Controller Device Tree Bindings
8+
9+
maintainers:
10+
- Michal Simek <[email protected]>
11+
12+
allOf:
13+
- $ref: /schemas/serial.yaml#
14+
15+
properties:
16+
compatible:
17+
oneOf:
18+
- description: UART controller for Zynq-7xxx SoC
19+
items:
20+
- const: xlnx,xuartps
21+
- const: cdns,uart-r1p8
22+
- description: UART controller for Zynq Ultrascale+ MPSoC
23+
items:
24+
- const: xlnx,zynqmp-uart
25+
- const: cdns,uart-r1p12
26+
27+
reg:
28+
maxItems: 1
29+
30+
interrupts:
31+
maxItems: 1
32+
33+
clocks:
34+
maxItems: 2
35+
36+
clock-names:
37+
items:
38+
- const: uart_clk
39+
- const: pclk
40+
41+
cts-override:
42+
description: |
43+
Override the CTS modem status signal. This signal will
44+
always be reported as active instead of being obtained
45+
from the modem status register. Define this if your serial
46+
port does not use this pin.
47+
type: boolean
48+
49+
required:
50+
- compatible
51+
- reg
52+
- interrupts
53+
- clocks
54+
- clock-names
55+
56+
unevaluatedProperties: false
57+
58+
examples:
59+
- |
60+
uart0: serial@e0000000 {
61+
compatible = "xlnx,xuartps", "cdns,uart-r1p8";
62+
clocks = <&clkc 23>, <&clkc 40>;
63+
clock-names = "uart_clk", "pclk";
64+
reg = <0xE0000000 0x1000>;
65+
interrupts = <0 27 4>;
66+
};

Documentation/devicetree/bindings/serial/mtk-uart.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Required properties:
1515
* "mediatek,mt7622-uart" for MT7622 compatible UARTS
1616
* "mediatek,mt7623-uart" for MT7623 compatible UARTS
1717
* "mediatek,mt7629-uart" for MT7629 compatible UARTS
18+
* "mediatek,mt7986-uart", "mediatek,mt6577-uart" for MT7986 compatible UARTS
1819
* "mediatek,mt8127-uart" for MT8127 compatible UARTS
1920
* "mediatek,mt8135-uart" for MT8135 compatible UARTS
2021
* "mediatek,mt8173-uart" for MT8173 compatible UARTS

arch/alpha/kernel/srmcons.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ srmcons_init(void)
204204
struct tty_driver *driver;
205205
int err;
206206

207-
driver = alloc_tty_driver(MAX_SRM_CONSOLE_DEVICES);
208-
if (!driver)
209-
return -ENOMEM;
207+
driver = tty_alloc_driver(MAX_SRM_CONSOLE_DEVICES, 0);
208+
if (IS_ERR(driver))
209+
return PTR_ERR(driver);
210210

211211
tty_port_init(&srmcons_singleton.port);
212212

@@ -221,7 +221,7 @@ srmcons_init(void)
221221
tty_port_link_device(&srmcons_singleton.port, driver, 0);
222222
err = tty_register_driver(driver);
223223
if (err) {
224-
put_tty_driver(driver);
224+
tty_driver_kref_put(driver);
225225
tty_port_destroy(&srmcons_singleton.port);
226226
return err;
227227
}

arch/m68k/emu/nfcon.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,35 +120,37 @@ early_param("debug", nf_debug_setup);
120120

121121
static int __init nfcon_init(void)
122122
{
123+
struct tty_driver *driver;
123124
int res;
124125

125126
stderr_id = nf_get_id("NF_STDERR");
126127
if (!stderr_id)
127128
return -ENODEV;
128129

129-
nfcon_tty_driver = alloc_tty_driver(1);
130-
if (!nfcon_tty_driver)
131-
return -ENOMEM;
130+
driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW);
131+
if (IS_ERR(driver))
132+
return PTR_ERR(driver);
132133

133134
tty_port_init(&nfcon_tty_port);
134135

135-
nfcon_tty_driver->driver_name = "nfcon";
136-
nfcon_tty_driver->name = "nfcon";
137-
nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
138-
nfcon_tty_driver->subtype = SYSTEM_TYPE_TTY;
139-
nfcon_tty_driver->init_termios = tty_std_termios;
140-
nfcon_tty_driver->flags = TTY_DRIVER_REAL_RAW;
136+
driver->driver_name = "nfcon";
137+
driver->name = "nfcon";
138+
driver->type = TTY_DRIVER_TYPE_SYSTEM;
139+
driver->subtype = SYSTEM_TYPE_TTY;
140+
driver->init_termios = tty_std_termios;
141141

142-
tty_set_operations(nfcon_tty_driver, &nfcon_tty_ops);
143-
tty_port_link_device(&nfcon_tty_port, nfcon_tty_driver, 0);
144-
res = tty_register_driver(nfcon_tty_driver);
142+
tty_set_operations(driver, &nfcon_tty_ops);
143+
tty_port_link_device(&nfcon_tty_port, driver, 0);
144+
res = tty_register_driver(driver);
145145
if (res) {
146146
pr_err("failed to register nfcon tty driver\n");
147-
put_tty_driver(nfcon_tty_driver);
147+
tty_driver_kref_put(driver);
148148
tty_port_destroy(&nfcon_tty_port);
149149
return res;
150150
}
151151

152+
nfcon_tty_driver = driver;
153+
152154
if (!(nf_console.flags & CON_ENABLED))
153155
register_console(&nf_console);
154156

@@ -159,7 +161,7 @@ static void __exit nfcon_exit(void)
159161
{
160162
unregister_console(&nf_console);
161163
tty_unregister_driver(nfcon_tty_driver);
162-
put_tty_driver(nfcon_tty_driver);
164+
tty_driver_kref_put(nfcon_tty_driver);
163165
tty_port_destroy(&nfcon_tty_port);
164166
}
165167

arch/parisc/kernel/pdc_cons.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ static struct tty_driver *pdc_console_tty_driver;
138138

139139
static int __init pdc_console_tty_driver_init(void)
140140
{
141+
struct tty_driver *driver;
141142
int err;
142143

143144
/* Check if the console driver is still registered.
@@ -160,31 +161,32 @@ static int __init pdc_console_tty_driver_init(void)
160161
printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n");
161162
pdc_cons.flags &= ~CON_BOOT;
162163

163-
pdc_console_tty_driver = alloc_tty_driver(1);
164-
165-
if (!pdc_console_tty_driver)
166-
return -ENOMEM;
164+
driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW |
165+
TTY_DRIVER_RESET_TERMIOS);
166+
if (IS_ERR(driver))
167+
return PTR_ERR(driver);
167168

168169
tty_port_init(&tty_port);
169170

170-
pdc_console_tty_driver->driver_name = "pdc_cons";
171-
pdc_console_tty_driver->name = "ttyB";
172-
pdc_console_tty_driver->major = MUX_MAJOR;
173-
pdc_console_tty_driver->minor_start = 0;
174-
pdc_console_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
175-
pdc_console_tty_driver->init_termios = tty_std_termios;
176-
pdc_console_tty_driver->flags = TTY_DRIVER_REAL_RAW |
177-
TTY_DRIVER_RESET_TERMIOS;
178-
tty_set_operations(pdc_console_tty_driver, &pdc_console_tty_ops);
179-
tty_port_link_device(&tty_port, pdc_console_tty_driver, 0);
180-
181-
err = tty_register_driver(pdc_console_tty_driver);
171+
driver->driver_name = "pdc_cons";
172+
driver->name = "ttyB";
173+
driver->major = MUX_MAJOR;
174+
driver->minor_start = 0;
175+
driver->type = TTY_DRIVER_TYPE_SYSTEM;
176+
driver->init_termios = tty_std_termios;
177+
tty_set_operations(driver, &pdc_console_tty_ops);
178+
tty_port_link_device(&tty_port, driver, 0);
179+
180+
err = tty_register_driver(driver);
182181
if (err) {
183182
printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
184183
tty_port_destroy(&tty_port);
184+
tty_driver_kref_put(driver);
185185
return err;
186186
}
187187

188+
pdc_console_tty_driver = driver;
189+
188190
return 0;
189191
}
190192
device_initcall(pdc_console_tty_driver_init);

arch/um/drivers/line.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,22 +538,23 @@ int register_lines(struct line_driver *line_driver,
538538
const struct tty_operations *ops,
539539
struct line *lines, int nlines)
540540
{
541-
struct tty_driver *driver = alloc_tty_driver(nlines);
541+
struct tty_driver *driver;
542542
int err;
543543
int i;
544544

545-
if (!driver)
546-
return -ENOMEM;
545+
driver = tty_alloc_driver(nlines, TTY_DRIVER_REAL_RAW |
546+
TTY_DRIVER_DYNAMIC_DEV);
547+
if (IS_ERR(driver))
548+
return PTR_ERR(driver);
547549

548550
driver->driver_name = line_driver->name;
549551
driver->name = line_driver->device_name;
550552
driver->major = line_driver->major;
551553
driver->minor_start = line_driver->minor_start;
552554
driver->type = line_driver->type;
553555
driver->subtype = line_driver->subtype;
554-
driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
555556
driver->init_termios = tty_std_termios;
556-
557+
557558
for (i = 0; i < nlines; i++) {
558559
tty_port_init(&lines[i].port);
559560
lines[i].port.ops = &line_port_ops;
@@ -567,7 +568,7 @@ int register_lines(struct line_driver *line_driver,
567568
if (err) {
568569
printk(KERN_ERR "register_lines : can't register %s driver\n",
569570
line_driver->name);
570-
put_tty_driver(driver);
571+
tty_driver_kref_put(driver);
571572
for (i = 0; i < nlines; i++)
572573
tty_port_destroy(&lines[i].port);
573574
return err;

arch/xtensa/platforms/iss/console.c

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,36 +136,49 @@ static const struct tty_operations serial_ops = {
136136

137137
static int __init rs_init(void)
138138
{
139-
tty_port_init(&serial_port);
139+
struct tty_driver *driver;
140+
int ret;
141+
142+
driver = tty_alloc_driver(SERIAL_MAX_NUM_LINES, TTY_DRIVER_REAL_RAW);
143+
if (IS_ERR(driver))
144+
return PTR_ERR(driver);
140145

141-
serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES);
146+
tty_port_init(&serial_port);
142147

143148
/* Initialize the tty_driver structure */
144149

145-
serial_driver->driver_name = "iss_serial";
146-
serial_driver->name = "ttyS";
147-
serial_driver->major = TTY_MAJOR;
148-
serial_driver->minor_start = 64;
149-
serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
150-
serial_driver->subtype = SERIAL_TYPE_NORMAL;
151-
serial_driver->init_termios = tty_std_termios;
152-
serial_driver->init_termios.c_cflag =
150+
driver->driver_name = "iss_serial";
151+
driver->name = "ttyS";
152+
driver->major = TTY_MAJOR;
153+
driver->minor_start = 64;
154+
driver->type = TTY_DRIVER_TYPE_SERIAL;
155+
driver->subtype = SERIAL_TYPE_NORMAL;
156+
driver->init_termios = tty_std_termios;
157+
driver->init_termios.c_cflag =
153158
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
154-
serial_driver->flags = TTY_DRIVER_REAL_RAW;
155159

156-
tty_set_operations(serial_driver, &serial_ops);
157-
tty_port_link_device(&serial_port, serial_driver, 0);
160+
tty_set_operations(driver, &serial_ops);
161+
tty_port_link_device(&serial_port, driver, 0);
162+
163+
ret = tty_register_driver(driver);
164+
if (ret) {
165+
pr_err("Couldn't register serial driver\n");
166+
tty_driver_kref_put(driver);
167+
tty_port_destroy(&serial_port);
168+
169+
return ret;
170+
}
171+
172+
serial_driver = driver;
158173

159-
if (tty_register_driver(serial_driver))
160-
panic("Couldn't register serial driver\n");
161174
return 0;
162175
}
163176

164177

165178
static __exit void rs_exit(void)
166179
{
167180
tty_unregister_driver(serial_driver);
168-
put_tty_driver(serial_driver);
181+
tty_driver_kref_put(serial_driver);
169182
tty_port_destroy(&serial_port);
170183
}
171184

0 commit comments

Comments
 (0)