Skip to content

Commit aa6085a

Browse files
committed
Merge tag 'tty-6.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver fixes from Greg KH: "Here are some small tty and serial driver fixes for reported issues. Included in here are: - sh-sci serial driver fixes - 8250_dw and _mtk driver fixes - sc16is7xx driver bugfix - new 8250_exar device ids added All of these have been in linux-next this past week with no reported issues" * tag 'tty-6.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_mtk: Enable baud clock and manage in runtime PM serial: 8250_dw: handle reset control deassert error dt-bindings: serial: sh-sci: Fix r8a78000 interrupts serial: sc16is7xx: remove useless enable of enhanced features serial: 8250_exar: add support for Advantech 2 port card with Device ID 0x0018 tty: serial: sh-sci: fix RSCI FIFO overrun handling
2 parents 6190d0f + d518314 commit aa6085a

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

Documentation/devicetree/bindings/serial/renesas,scif.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ allOf:
197197
- renesas,rcar-gen2-scif
198198
- renesas,rcar-gen3-scif
199199
- renesas,rcar-gen4-scif
200+
- renesas,rcar-gen5-scif
200201
then:
201202
properties:
202203
interrupts:

drivers/tty/serial/8250/8250_dw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ static int dw8250_probe(struct platform_device *pdev)
635635
if (IS_ERR(data->rst))
636636
return PTR_ERR(data->rst);
637637

638-
reset_control_deassert(data->rst);
638+
err = reset_control_deassert(data->rst);
639+
if (err)
640+
return dev_err_probe(dev, err, "failed to deassert resets\n");
639641

640642
err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
641643
if (err)

drivers/tty/serial/8250/8250_exar.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
#define PCI_DEVICE_ID_ACCESSIO_COM_4SM 0x10db
4141
#define PCI_DEVICE_ID_ACCESSIO_COM_8SM 0x10ea
4242

43+
#define PCI_DEVICE_ID_ADVANTECH_XR17V352 0x0018
44+
4345
#define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x0002
4446
#define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x0004
4547
#define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a
@@ -1622,6 +1624,12 @@ static const struct exar8250_board pbn_fastcom35x_8 = {
16221624
.exit = pci_xr17v35x_exit,
16231625
};
16241626

1627+
static const struct exar8250_board pbn_adv_XR17V352 = {
1628+
.num_ports = 2,
1629+
.setup = pci_xr17v35x_setup,
1630+
.exit = pci_xr17v35x_exit,
1631+
};
1632+
16251633
static const struct exar8250_board pbn_exar_XR17V4358 = {
16261634
.num_ports = 12,
16271635
.setup = pci_xr17v35x_setup,
@@ -1696,6 +1704,9 @@ static const struct pci_device_id exar_pci_tbl[] = {
16961704
USR_DEVICE(XR17C152, 2980, pbn_exar_XR17C15x),
16971705
USR_DEVICE(XR17C152, 2981, pbn_exar_XR17C15x),
16981706

1707+
/* ADVANTECH devices */
1708+
EXAR_DEVICE(ADVANTECH, XR17V352, pbn_adv_XR17V352),
1709+
16991710
/* Exar Corp. XR17C15[248] Dual/Quad/Octal UART */
17001711
EXAR_DEVICE(EXAR, XR17C152, pbn_exar_XR17C15x),
17011712
EXAR_DEVICE(EXAR, XR17C154, pbn_exar_XR17C15x),

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ static int __maybe_unused mtk8250_runtime_suspend(struct device *dev)
435435
while
436436
(serial_in(up, MTK_UART_DEBUG0));
437437

438+
clk_disable_unprepare(data->uart_clk);
438439
clk_disable_unprepare(data->bus_clk);
439440

440441
return 0;
@@ -445,6 +446,7 @@ static int __maybe_unused mtk8250_runtime_resume(struct device *dev)
445446
struct mtk8250_data *data = dev_get_drvdata(dev);
446447

447448
clk_prepare_enable(data->bus_clk);
449+
clk_prepare_enable(data->uart_clk);
448450

449451
return 0;
450452
}
@@ -475,13 +477,13 @@ static int mtk8250_probe_of(struct platform_device *pdev, struct uart_port *p,
475477
int dmacnt;
476478
#endif
477479

478-
data->uart_clk = devm_clk_get(&pdev->dev, "baud");
480+
data->uart_clk = devm_clk_get_enabled(&pdev->dev, "baud");
479481
if (IS_ERR(data->uart_clk)) {
480482
/*
481483
* For compatibility with older device trees try unnamed
482484
* clk when no baud clk can be found.
483485
*/
484-
data->uart_clk = devm_clk_get(&pdev->dev, NULL);
486+
data->uart_clk = devm_clk_get_enabled(&pdev->dev, NULL);
485487
if (IS_ERR(data->uart_clk)) {
486488
dev_warn(&pdev->dev, "Can't get uart clock\n");
487489
return PTR_ERR(data->uart_clk);

drivers/tty/serial/sc16is7xx.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,13 +588,6 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)
588588
div /= prescaler;
589589
}
590590

591-
/* Enable enhanced features */
592-
sc16is7xx_efr_lock(port);
593-
sc16is7xx_port_update(port, SC16IS7XX_EFR_REG,
594-
SC16IS7XX_EFR_ENABLE_BIT,
595-
SC16IS7XX_EFR_ENABLE_BIT);
596-
sc16is7xx_efr_unlock(port);
597-
598591
/* If bit MCR_CLKSEL is set, the divide by 4 prescaler is activated. */
599592
sc16is7xx_port_update(port, SC16IS7XX_MCR_REG,
600593
SC16IS7XX_MCR_CLKSEL_BIT,

drivers/tty/serial/sh-sci.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,16 +1014,18 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
10141014
struct sci_port *s = to_sci_port(port);
10151015
const struct plat_sci_reg *reg;
10161016
int copied = 0;
1017-
u16 status;
1017+
u32 status;
10181018

1019-
reg = sci_getreg(port, s->params->overrun_reg);
1020-
if (!reg->size)
1021-
return 0;
1019+
if (s->type != SCI_PORT_RSCI) {
1020+
reg = sci_getreg(port, s->params->overrun_reg);
1021+
if (!reg->size)
1022+
return 0;
1023+
}
10221024

1023-
status = sci_serial_in(port, s->params->overrun_reg);
1025+
status = s->ops->read_reg(port, s->params->overrun_reg);
10241026
if (status & s->params->overrun_mask) {
10251027
status &= ~s->params->overrun_mask;
1026-
sci_serial_out(port, s->params->overrun_reg, status);
1028+
s->ops->write_reg(port, s->params->overrun_reg, status);
10271029

10281030
port->icount.overrun++;
10291031

0 commit comments

Comments
 (0)