Skip to content

Commit 336722e

Browse files
committed
Merge tag 'tty-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH: "Here is the big tty and serial driver pull request for 4.19-rc1. It's not all that big, just a number of small serial driver updates and fixes, along with some better vt handling for unicode characters for those using braille terminals. All of these patches have been in linux-next for a long time with no reported issues" * tag 'tty-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (73 commits) tty: serial: 8250: Revert NXP SC16C2552 workaround serial: 8250_exar: Read INT0 from slave device, too tty: rocket: Fix possible buffer overwrite on register_PCI serial: 8250_dw: Add ACPI support for uart on Broadcom SoC serial: 8250_dw: always set baud rate in dw8250_set_termios dt-bindings: serial: Add binding for uartlite tty: serial: uartlite: Add support for suspend and resume tty: serial: uartlite: Add clock adaptation tty: serial: uartlite: Add structure for private data serial: sh-sci: Improve support for separate TEI and DRI interrupts serial: sh-sci: Remove SCIx_RZ_SCIFA_REGTYPE serial: sh-sci: Allow for compressed SCIF address serial: sh-sci: Improve interrupts description serial: 8250: Use cached port name directly in messages serial: 8250_exar: Drop unused variable in pci_xr17v35x_setup() vt: drop unused struct vt_struct vt: avoid a VLA in the unicode screen scroll function vt: add /dev/vcsu* to devices.txt vt: coherence validation code for the unicode screen buffer vt: selection: take screen contents from uniscr if available ...
2 parents 5695d5d + 47ac766 commit 336722e

Some content is hidden

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

44 files changed

+1381
-338
lines changed

Documentation/admin-guide/devices.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,18 @@
173173
they are redirected through the parport multiplex layer.
174174

175175
7 char Virtual console capture devices
176-
0 = /dev/vcs Current vc text contents
177-
1 = /dev/vcs1 tty1 text contents
176+
0 = /dev/vcs Current vc text (glyph) contents
177+
1 = /dev/vcs1 tty1 text (glyph) contents
178178
...
179-
63 = /dev/vcs63 tty63 text contents
180-
128 = /dev/vcsa Current vc text/attribute contents
181-
129 = /dev/vcsa1 tty1 text/attribute contents
179+
63 = /dev/vcs63 tty63 text (glyph) contents
180+
64 = /dev/vcsu Current vc text (unicode) contents
181+
65 = /dev/vcsu1 tty1 text (unicode) contents
182182
...
183-
191 = /dev/vcsa63 tty63 text/attribute contents
183+
127 = /dev/vcsu63 tty63 text (unicode) contents
184+
128 = /dev/vcsa Current vc text/attribute (glyph) contents
185+
129 = /dev/vcsa1 tty1 text/attribute (glyph) contents
186+
...
187+
191 = /dev/vcsa63 tty63 text/attribute (glyph) contents
184188

185189
NOTE: These devices permit both read and write access.
186190

Documentation/devicetree/bindings/arm/mediatek.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ compatible: Must contain one of
1111
"mediatek,mt6589"
1212
"mediatek,mt6592"
1313
"mediatek,mt6755"
14+
"mediatek,mt6765"
1415
"mediatek,mt6795"
1516
"mediatek,mt6797"
1617
"mediatek,mt7622"
@@ -41,6 +42,9 @@ Supported boards:
4142
- Evaluation phone for MT6755(Helio P10):
4243
Required root node properties:
4344
- compatible = "mediatek,mt6755-evb", "mediatek,mt6755";
45+
- Evaluation board for MT6765(Helio P22):
46+
Required root node properties:
47+
- compatible = "mediatek,mt6765-evb", "mediatek,mt6765";
4448
- Evaluation board for MT6795(Helio X10):
4549
Required root node properties:
4650
- compatible = "mediatek,mt6795-evb", "mediatek,mt6795";

Documentation/devicetree/bindings/interrupt-controller/mediatek,sysirq.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Required properties:
1111
"mediatek,mt7622-sysirq", "mediatek,mt6577-sysirq": for MT7622
1212
"mediatek,mt6795-sysirq", "mediatek,mt6577-sysirq": for MT6795
1313
"mediatek,mt6797-sysirq", "mediatek,mt6577-sysirq": for MT6797
14+
"mediatek,mt6765-sysirq", "mediatek,mt6577-sysirq": for MT6765
1415
"mediatek,mt6755-sysirq", "mediatek,mt6577-sysirq": for MT6755
1516
"mediatek,mt6592-sysirq", "mediatek,mt6577-sysirq": for MT6592
1617
"mediatek,mt6589-sysirq", "mediatek,mt6577-sysirq": for MT6589

Documentation/devicetree/bindings/serial/fsl-imx-uart.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Optional properties:
99
- fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
1010
in DCE mode by default.
1111
- rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
12-
linux,rs485-enabled-at-boot-time: see rs485.txt
12+
linux,rs485-enabled-at-boot-time: see rs485.txt. Note that for RS485
13+
you must enable either the "uart-has-rtscts" or the "rts-gpios"
14+
properties. In case you use "uart-has-rtscts" the signal that controls
15+
the transceiver is actually CTS_B, not RTS_B. CTS_B is always output,
16+
and RTS_B is input, regardless of dte-mode.
1317

1418
Please check Documentation/devicetree/bindings/serial/serial.txt
1519
for the complete list of generic properties.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
* "mediatek,mt6582-uart" for MT6582 compatible UARTS
99
* "mediatek,mt6589-uart" for MT6589 compatible UARTS
1010
* "mediatek,mt6755-uart" for MT6755 compatible UARTS
11+
* "mediatek,mt6765-uart" for MT6765 compatible UARTS
1112
* "mediatek,mt6795-uart" for MT6795 compatible UARTS
1213
* "mediatek,mt6797-uart" for MT6797 compatible UARTS
1314
* "mediatek,mt7622-uart" for MT7622 compatible UARTS

Documentation/devicetree/bindings/serial/omap_serial.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
OMAP UART controller
22

33
Required properties:
4+
- compatible : should be "ti,am654-uart" for AM654 controllers
45
- compatible : should be "ti,omap2-uart" for OMAP2 controllers
56
- compatible : should be "ti,omap3-uart" for OMAP3 controllers
67
- compatible : should be "ti,omap4-uart" for OMAP4 controllers
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Renesas RZ/N1 UART
2+
3+
This controller is based on the Synopsys DesignWare ABP UART and inherits all
4+
properties defined in snps-dw-apb-uart.txt except for the compatible property.
5+
6+
Required properties:
7+
- compatible : The device specific string followed by the generic RZ/N1 string.
8+
Therefore it must be one of:
9+
"renesas,r9a06g032-uart", "renesas,rzn1-uart"
10+
"renesas,r9a06g033-uart", "renesas,rzn1-uart"

Documentation/devicetree/bindings/serial/renesas,sci-serial.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Required properties:
55
- compatible: Must contain one or more of the following:
66

77
- "renesas,scif-r7s72100" for R7S72100 (RZ/A1H) SCIF compatible UART.
8+
- "renesas,scif-r7s9210" for R7S9210 (RZ/A2) SCIF compatible UART.
89
- "renesas,scifa-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFA compatible UART.
910
- "renesas,scifb-r8a73a4" for R8A73A4 (R-Mobile APE6) SCIFB compatible UART.
1011
- "renesas,scifa-r8a7740" for R8A7740 (R-Mobile A1) SCIFA compatible UART.
@@ -72,7 +73,21 @@ Required properties:
7273
family-specific and/or generic versions.
7374

7475
- reg: Base address and length of the I/O registers used by the UART.
75-
- interrupts: Must contain an interrupt-specifier for the SCIx interrupt.
76+
- interrupts: Must contain one or more interrupt-specifiers for the SCIx.
77+
If a single interrupt is expressed, then all events are
78+
multiplexed into this single interrupt.
79+
80+
If multiple interrupts are provided by the hardware, the order
81+
in which the interrupts are listed must match order below. Note
82+
that some HW interrupt events may be muxed together resulting
83+
in duplicate entries.
84+
The interrupt order is as follows:
85+
1. Error (ERI)
86+
2. Receive buffer full (RXI)
87+
3. Transmit buffer empty (TXI)
88+
4. Break (BRI)
89+
5. Data Ready (DRI)
90+
6. Transmit End (TEI)
7691

7792
- clocks: Must contain a phandle and clock-specifier pair for each entry
7893
in clock-names.
@@ -89,7 +104,7 @@ Required properties:
89104
- "scif_clk" for the optional external clock source for the frequency
90105
divider (SCIF_CLK).
91106

92-
Note: Each enabled SCIx UART should have an alias correctly numbered in the
107+
Note: Each enabled SCIx UART may have an optional "serialN" alias in the
93108
"aliases" node.
94109

95110
Optional properties:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Xilinx Axi Uartlite controller Device Tree Bindings
2+
---------------------------------------------------------
3+
4+
Required properties:
5+
- compatible : Can be either of
6+
"xlnx,xps-uartlite-1.00.a"
7+
"xlnx,opb-uartlite-1.00.b"
8+
- reg : Physical base address and size of the Axi Uartlite
9+
registers map.
10+
- interrupts : Should contain the UART controller interrupt.
11+
12+
Optional properties:
13+
- port-number : Set Uart port number
14+
- clock-names : Should be "s_axi_aclk"
15+
- clocks : Input clock specifier. Refer to common clock bindings.
16+
17+
Example:
18+
serial@800c0000 {
19+
compatible = "xlnx,xps-uartlite-1.00.a";
20+
reg = <0x0 0x800c0000 0x10000>;
21+
interrupts = <0x0 0x6e 0x1>;
22+
port-number = <0>;
23+
};

Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Child nodes should conform to I2C bus binding as described in i2c.txt.
4646
Qualcomm Technologies Inc. GENI Serial Engine based UART Controller
4747

4848
Required properties:
49-
- compatible: Must be "qcom,geni-debug-uart".
49+
- compatible: Must be "qcom,geni-debug-uart" or "qcom,geni-uart".
5050
- reg: Must contain UART register location and length.
5151
- interrupts: Must contain UART core interrupts.
5252
- clock-names: Must contain "se".

drivers/parport/parport_serial.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ enum parport_pc_pci_cards {
5858
timedia_9079c,
5959
wch_ch353_1s1p,
6060
wch_ch353_2s1p,
61+
wch_ch382_0s1p,
6162
wch_ch382_2s1p,
6263
brainboxes_5s1p,
6364
sunix_2s1p,
@@ -147,6 +148,7 @@ static struct parport_pc_pci cards[] = {
147148
/* timedia_9079c */ { 1, { { 2, 3 }, } },
148149
/* wch_ch353_1s1p*/ { 1, { { 1, -1}, } },
149150
/* wch_ch353_2s1p*/ { 1, { { 2, -1}, } },
151+
/* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
150152
/* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
151153
/* brainboxes_5s1p */ { 1, { { 3, -1 }, } },
152154
/* sunix_2s1p */ { 1, { { 3, -1 }, } },
@@ -252,6 +254,7 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
252254
/* WCH CARDS */
253255
{ 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
254256
{ 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
257+
{ 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
255258
{ 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
256259

257260
/* BrainBoxes PX272/PX306 MIO card */
@@ -494,6 +497,12 @@ static struct pciserial_board pci_parport_serial_boards[] = {
494497
.base_baud = 115200,
495498
.uart_offset = 8,
496499
},
500+
[wch_ch382_0s1p] = {
501+
.flags = FL_BASE0,
502+
.num_ports = 0,
503+
.base_baud = 115200,
504+
.uart_offset = 8,
505+
},
497506
[wch_ch382_2s1p] = {
498507
.flags = FL_BASE0,
499508
.num_ports = 2,

drivers/s390/char/keyboard.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,34 @@ static const int kbd_max_vals[] = {
3939
};
4040
static const int KBD_NR_TYPES = ARRAY_SIZE(kbd_max_vals);
4141

42-
static unsigned char ret_diacr[NR_DEAD] = {
43-
'`', '\'', '^', '~', '"', ','
42+
static const unsigned char ret_diacr[NR_DEAD] = {
43+
'`', /* dead_grave */
44+
'\'', /* dead_acute */
45+
'^', /* dead_circumflex */
46+
'~', /* dead_tilda */
47+
'"', /* dead_diaeresis */
48+
',', /* dead_cedilla */
49+
'_', /* dead_macron */
50+
'U', /* dead_breve */
51+
'.', /* dead_abovedot */
52+
'*', /* dead_abovering */
53+
'=', /* dead_doubleacute */
54+
'c', /* dead_caron */
55+
'k', /* dead_ogonek */
56+
'i', /* dead_iota */
57+
'#', /* dead_voiced_sound */
58+
'o', /* dead_semivoiced_sound */
59+
'!', /* dead_belowdot */
60+
'?', /* dead_hook */
61+
'+', /* dead_horn */
62+
'-', /* dead_stroke */
63+
')', /* dead_abovecomma */
64+
'(', /* dead_abovereversedcomma */
65+
':', /* dead_doublegrave */
66+
'n', /* dead_invertedbreve */
67+
';', /* dead_belowcomma */
68+
'$', /* dead_currency */
69+
'@', /* dead_greek */
4470
};
4571

4672
/*

drivers/tty/pty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
625625
if (tty->driver != ptm_driver)
626626
return -EIO;
627627

628-
fd = get_unused_fd_flags(0);
628+
fd = get_unused_fd_flags(flags);
629629
if (fd < 0) {
630630
retval = fd;
631631
goto err;

drivers/tty/rocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,7 @@ static __init int register_PCI(int i, struct pci_dev *dev)
18811881
ByteIO_t UPCIRingInd = 0;
18821882

18831883
if (!dev || !pci_match_id(rocket_pci_ids, dev) ||
1884-
pci_enable_device(dev))
1884+
pci_enable_device(dev) || i >= NUM_BOARDS)
18851885
return 0;
18861886

18871887
rcktpt_io_addr[i] = pci_resource_start(dev, 0);

drivers/tty/serdev/core.c

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <linux/module.h>
1414
#include <linux/of.h>
1515
#include <linux/of_device.h>
16+
#include <linux/pm_domain.h>
17+
#include <linux/pm_runtime.h>
1618
#include <linux/serdev.h>
1719
#include <linux/slab.h>
1820

@@ -143,11 +145,28 @@ EXPORT_SYMBOL_GPL(serdev_device_remove);
143145
int serdev_device_open(struct serdev_device *serdev)
144146
{
145147
struct serdev_controller *ctrl = serdev->ctrl;
148+
int ret;
146149

147150
if (!ctrl || !ctrl->ops->open)
148151
return -EINVAL;
149152

150-
return ctrl->ops->open(ctrl);
153+
ret = ctrl->ops->open(ctrl);
154+
if (ret)
155+
return ret;
156+
157+
ret = pm_runtime_get_sync(&ctrl->dev);
158+
if (ret < 0) {
159+
pm_runtime_put_noidle(&ctrl->dev);
160+
goto err_close;
161+
}
162+
163+
return 0;
164+
165+
err_close:
166+
if (ctrl->ops->close)
167+
ctrl->ops->close(ctrl);
168+
169+
return ret;
151170
}
152171
EXPORT_SYMBOL_GPL(serdev_device_open);
153172

@@ -158,6 +177,8 @@ void serdev_device_close(struct serdev_device *serdev)
158177
if (!ctrl || !ctrl->ops->close)
159178
return;
160179

180+
pm_runtime_put(&ctrl->dev);
181+
161182
ctrl->ops->close(ctrl);
162183
}
163184
EXPORT_SYMBOL_GPL(serdev_device_close);
@@ -330,15 +351,27 @@ EXPORT_SYMBOL_GPL(serdev_device_set_tiocm);
330351
static int serdev_drv_probe(struct device *dev)
331352
{
332353
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
354+
int ret;
355+
356+
ret = dev_pm_domain_attach(dev, true);
357+
if (ret)
358+
return ret;
359+
360+
ret = sdrv->probe(to_serdev_device(dev));
361+
if (ret)
362+
dev_pm_domain_detach(dev, true);
333363

334-
return sdrv->probe(to_serdev_device(dev));
364+
return ret;
335365
}
336366

337367
static int serdev_drv_remove(struct device *dev)
338368
{
339369
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
340370
if (sdrv->remove)
341371
sdrv->remove(to_serdev_device(dev));
372+
373+
dev_pm_domain_detach(dev, true);
374+
342375
return 0;
343376
}
344377

@@ -416,6 +449,9 @@ struct serdev_controller *serdev_controller_alloc(struct device *parent,
416449

417450
dev_set_name(&ctrl->dev, "serial%d", id);
418451

452+
pm_runtime_no_callbacks(&ctrl->dev);
453+
pm_suspend_ignore_children(&ctrl->dev, true);
454+
419455
dev_dbg(&ctrl->dev, "allocated controller 0x%p id %d\n", ctrl, id);
420456
return ctrl;
421457

@@ -547,20 +583,23 @@ int serdev_controller_add(struct serdev_controller *ctrl)
547583
if (ret)
548584
return ret;
549585

586+
pm_runtime_enable(&ctrl->dev);
587+
550588
ret_of = of_serdev_register_devices(ctrl);
551589
ret_acpi = acpi_serdev_register_devices(ctrl);
552590
if (ret_of && ret_acpi) {
553591
dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d\n",
554592
ret_of, ret_acpi);
555593
ret = -ENODEV;
556-
goto out_dev_del;
594+
goto err_rpm_disable;
557595
}
558596

559597
dev_dbg(&ctrl->dev, "serdev%d registered: dev:%p\n",
560598
ctrl->nr, &ctrl->dev);
561599
return 0;
562600

563-
out_dev_del:
601+
err_rpm_disable:
602+
pm_runtime_disable(&ctrl->dev);
564603
device_del(&ctrl->dev);
565604
return ret;
566605
};
@@ -591,6 +630,7 @@ void serdev_controller_remove(struct serdev_controller *ctrl)
591630

592631
dummy = device_for_each_child(&ctrl->dev, NULL,
593632
serdev_remove_device);
633+
pm_runtime_disable(&ctrl->dev);
594634
device_del(&ctrl->dev);
595635
}
596636
EXPORT_SYMBOL_GPL(serdev_controller_remove);

drivers/tty/serial/8250/8250_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static int univ8250_setup_irq(struct uart_8250_port *up)
323323
* the port is opened so this value needs to be preserved.
324324
*/
325325
if (up->bugs & UART_BUG_THRE) {
326-
pr_debug("ttyS%d - using backup timer\n", serial_index(port));
326+
pr_debug("%s - using backup timer\n", port->name);
327327

328328
up->timer.function = serial8250_backup_timeout;
329329
mod_timer(&up->timer, jiffies +
@@ -1023,6 +1023,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
10231023
uart->port.get_mctrl = up->port.get_mctrl;
10241024
if (up->port.set_mctrl)
10251025
uart->port.set_mctrl = up->port.set_mctrl;
1026+
if (up->port.get_divisor)
1027+
uart->port.get_divisor = up->port.get_divisor;
1028+
if (up->port.set_divisor)
1029+
uart->port.set_divisor = up->port.set_divisor;
10261030
if (up->port.startup)
10271031
uart->port.startup = up->port.startup;
10281032
if (up->port.shutdown)

0 commit comments

Comments
 (0)