Skip to content

Commit

Permalink
Merge tag 'tty-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
torvalds committed Sep 1, 2021
2 parents ebf435d + 2e5f3a6 commit 7c314bd
Show file tree
Hide file tree
Showing 86 changed files with 1,411 additions and 1,037 deletions.
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/serial/8250.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ properties:
- const: nuvoton,npcm750-uart
- const: nvidia,tegra20-uart
- const: nxp,lpc3220-uart
- items:
- enum:
- exar,xr16l2552
- exar,xr16l2551
- exar,xr16l2550
- const: ns8250
- items:
- enum:
- altr,16550-FIFO32
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/8250_omap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ properties:
power-domains: true
clock-frequency: true
current-speed: true
overrun-throttle-ms: true

required:
- compatible
Expand Down
27 changes: 0 additions & 27 deletions Documentation/devicetree/bindings/serial/cdns,uart.txt

This file was deleted.

66 changes: 66 additions & 0 deletions Documentation/devicetree/bindings/serial/cdns,uart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/serial/cdns,uart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cadence UART Controller Device Tree Bindings

maintainers:
- Michal Simek <[email protected]>

allOf:
- $ref: /schemas/serial.yaml#

properties:
compatible:
oneOf:
- description: UART controller for Zynq-7xxx SoC
items:
- const: xlnx,xuartps
- const: cdns,uart-r1p8
- description: UART controller for Zynq Ultrascale+ MPSoC
items:
- const: xlnx,zynqmp-uart
- const: cdns,uart-r1p12

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
maxItems: 2

clock-names:
items:
- const: uart_clk
- const: pclk

cts-override:
description: |
Override the CTS modem status signal. This signal will
always be reported as active instead of being obtained
from the modem status register. Define this if your serial
port does not use this pin.
type: boolean

required:
- compatible
- reg
- interrupts
- clocks
- clock-names

unevaluatedProperties: false

examples:
- |
uart0: serial@e0000000 {
compatible = "xlnx,xuartps", "cdns,uart-r1p8";
clocks = <&clkc 23>, <&clkc 40>;
clock-names = "uart_clk", "pclk";
reg = <0xE0000000 0x1000>;
interrupts = <0 27 4>;
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/mtk-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Required properties:
* "mediatek,mt7622-uart" for MT7622 compatible UARTS
* "mediatek,mt7623-uart" for MT7623 compatible UARTS
* "mediatek,mt7629-uart" for MT7629 compatible UARTS
* "mediatek,mt7986-uart", "mediatek,mt6577-uart" for MT7986 compatible UARTS
* "mediatek,mt8127-uart" for MT8127 compatible UARTS
* "mediatek,mt8135-uart" for MT8135 compatible UARTS
* "mediatek,mt8173-uart" for MT8173 compatible UARTS
Expand Down
8 changes: 4 additions & 4 deletions arch/alpha/kernel/srmcons.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ srmcons_init(void)
struct tty_driver *driver;
int err;

driver = alloc_tty_driver(MAX_SRM_CONSOLE_DEVICES);
if (!driver)
return -ENOMEM;
driver = tty_alloc_driver(MAX_SRM_CONSOLE_DEVICES, 0);
if (IS_ERR(driver))
return PTR_ERR(driver);

tty_port_init(&srmcons_singleton.port);

Expand All @@ -221,7 +221,7 @@ srmcons_init(void)
tty_port_link_device(&srmcons_singleton.port, driver, 0);
err = tty_register_driver(driver);
if (err) {
put_tty_driver(driver);
tty_driver_kref_put(driver);
tty_port_destroy(&srmcons_singleton.port);
return err;
}
Expand Down
30 changes: 16 additions & 14 deletions arch/m68k/emu/nfcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,35 +120,37 @@ early_param("debug", nf_debug_setup);

static int __init nfcon_init(void)
{
struct tty_driver *driver;
int res;

stderr_id = nf_get_id("NF_STDERR");
if (!stderr_id)
return -ENODEV;

nfcon_tty_driver = alloc_tty_driver(1);
if (!nfcon_tty_driver)
return -ENOMEM;
driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW);
if (IS_ERR(driver))
return PTR_ERR(driver);

tty_port_init(&nfcon_tty_port);

nfcon_tty_driver->driver_name = "nfcon";
nfcon_tty_driver->name = "nfcon";
nfcon_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
nfcon_tty_driver->subtype = SYSTEM_TYPE_TTY;
nfcon_tty_driver->init_termios = tty_std_termios;
nfcon_tty_driver->flags = TTY_DRIVER_REAL_RAW;
driver->driver_name = "nfcon";
driver->name = "nfcon";
driver->type = TTY_DRIVER_TYPE_SYSTEM;
driver->subtype = SYSTEM_TYPE_TTY;
driver->init_termios = tty_std_termios;

tty_set_operations(nfcon_tty_driver, &nfcon_tty_ops);
tty_port_link_device(&nfcon_tty_port, nfcon_tty_driver, 0);
res = tty_register_driver(nfcon_tty_driver);
tty_set_operations(driver, &nfcon_tty_ops);
tty_port_link_device(&nfcon_tty_port, driver, 0);
res = tty_register_driver(driver);
if (res) {
pr_err("failed to register nfcon tty driver\n");
put_tty_driver(nfcon_tty_driver);
tty_driver_kref_put(driver);
tty_port_destroy(&nfcon_tty_port);
return res;
}

nfcon_tty_driver = driver;

if (!(nf_console.flags & CON_ENABLED))
register_console(&nf_console);

Expand All @@ -159,7 +161,7 @@ static void __exit nfcon_exit(void)
{
unregister_console(&nf_console);
tty_unregister_driver(nfcon_tty_driver);
put_tty_driver(nfcon_tty_driver);
tty_driver_kref_put(nfcon_tty_driver);
tty_port_destroy(&nfcon_tty_port);
}

Expand Down
34 changes: 18 additions & 16 deletions arch/parisc/kernel/pdc_cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ static struct tty_driver *pdc_console_tty_driver;

static int __init pdc_console_tty_driver_init(void)
{
struct tty_driver *driver;
int err;

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

pdc_console_tty_driver = alloc_tty_driver(1);

if (!pdc_console_tty_driver)
return -ENOMEM;
driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW |
TTY_DRIVER_RESET_TERMIOS);
if (IS_ERR(driver))
return PTR_ERR(driver);

tty_port_init(&tty_port);

pdc_console_tty_driver->driver_name = "pdc_cons";
pdc_console_tty_driver->name = "ttyB";
pdc_console_tty_driver->major = MUX_MAJOR;
pdc_console_tty_driver->minor_start = 0;
pdc_console_tty_driver->type = TTY_DRIVER_TYPE_SYSTEM;
pdc_console_tty_driver->init_termios = tty_std_termios;
pdc_console_tty_driver->flags = TTY_DRIVER_REAL_RAW |
TTY_DRIVER_RESET_TERMIOS;
tty_set_operations(pdc_console_tty_driver, &pdc_console_tty_ops);
tty_port_link_device(&tty_port, pdc_console_tty_driver, 0);

err = tty_register_driver(pdc_console_tty_driver);
driver->driver_name = "pdc_cons";
driver->name = "ttyB";
driver->major = MUX_MAJOR;
driver->minor_start = 0;
driver->type = TTY_DRIVER_TYPE_SYSTEM;
driver->init_termios = tty_std_termios;
tty_set_operations(driver, &pdc_console_tty_ops);
tty_port_link_device(&tty_port, driver, 0);

err = tty_register_driver(driver);
if (err) {
printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
tty_port_destroy(&tty_port);
tty_driver_kref_put(driver);
return err;
}

pdc_console_tty_driver = driver;

return 0;
}
device_initcall(pdc_console_tty_driver_init);
Expand Down
13 changes: 7 additions & 6 deletions arch/um/drivers/line.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,22 +538,23 @@ int register_lines(struct line_driver *line_driver,
const struct tty_operations *ops,
struct line *lines, int nlines)
{
struct tty_driver *driver = alloc_tty_driver(nlines);
struct tty_driver *driver;
int err;
int i;

if (!driver)
return -ENOMEM;
driver = tty_alloc_driver(nlines, TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV);
if (IS_ERR(driver))
return PTR_ERR(driver);

driver->driver_name = line_driver->name;
driver->name = line_driver->device_name;
driver->major = line_driver->major;
driver->minor_start = line_driver->minor_start;
driver->type = line_driver->type;
driver->subtype = line_driver->subtype;
driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
driver->init_termios = tty_std_termios;

for (i = 0; i < nlines; i++) {
tty_port_init(&lines[i].port);
lines[i].port.ops = &line_port_ops;
Expand All @@ -567,7 +568,7 @@ int register_lines(struct line_driver *line_driver,
if (err) {
printk(KERN_ERR "register_lines : can't register %s driver\n",
line_driver->name);
put_tty_driver(driver);
tty_driver_kref_put(driver);
for (i = 0; i < nlines; i++)
tty_port_destroy(&lines[i].port);
return err;
Expand Down
45 changes: 29 additions & 16 deletions arch/xtensa/platforms/iss/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,36 +136,49 @@ static const struct tty_operations serial_ops = {

static int __init rs_init(void)
{
tty_port_init(&serial_port);
struct tty_driver *driver;
int ret;

driver = tty_alloc_driver(SERIAL_MAX_NUM_LINES, TTY_DRIVER_REAL_RAW);
if (IS_ERR(driver))
return PTR_ERR(driver);

serial_driver = alloc_tty_driver(SERIAL_MAX_NUM_LINES);
tty_port_init(&serial_port);

/* Initialize the tty_driver structure */

serial_driver->driver_name = "iss_serial";
serial_driver->name = "ttyS";
serial_driver->major = TTY_MAJOR;
serial_driver->minor_start = 64;
serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
serial_driver->subtype = SERIAL_TYPE_NORMAL;
serial_driver->init_termios = tty_std_termios;
serial_driver->init_termios.c_cflag =
driver->driver_name = "iss_serial";
driver->name = "ttyS";
driver->major = TTY_MAJOR;
driver->minor_start = 64;
driver->type = TTY_DRIVER_TYPE_SERIAL;
driver->subtype = SERIAL_TYPE_NORMAL;
driver->init_termios = tty_std_termios;
driver->init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
serial_driver->flags = TTY_DRIVER_REAL_RAW;

tty_set_operations(serial_driver, &serial_ops);
tty_port_link_device(&serial_port, serial_driver, 0);
tty_set_operations(driver, &serial_ops);
tty_port_link_device(&serial_port, driver, 0);

ret = tty_register_driver(driver);
if (ret) {
pr_err("Couldn't register serial driver\n");
tty_driver_kref_put(driver);
tty_port_destroy(&serial_port);

return ret;
}

serial_driver = driver;

if (tty_register_driver(serial_driver))
panic("Couldn't register serial driver\n");
return 0;
}


static __exit void rs_exit(void)
{
tty_unregister_driver(serial_driver);
put_tty_driver(serial_driver);
tty_driver_kref_put(serial_driver);
tty_port_destroy(&serial_port);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,7 @@ static int __init synclink_cs_init(void)
err_unreg_tty:
tty_unregister_driver(serial_driver);
err_put_tty:
put_tty_driver(serial_driver);
tty_driver_kref_put(serial_driver);
err:
return rc;
}
Expand All @@ -2850,7 +2850,7 @@ static void __exit synclink_cs_exit(void)
{
pcmcia_unregister_driver(&mgslpc_driver);
tty_unregister_driver(serial_driver);
put_tty_driver(serial_driver);
tty_driver_kref_put(serial_driver);
}

module_init(synclink_cs_init);
Expand Down
Loading

0 comments on commit 7c314bd

Please sign in to comment.