Skip to content

Commit

Permalink
Merge tag 'tty-4.16-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/staging driver updates from Greg KH:
 "Here is the big tty/serial driver update for 4.16-rc1.

  The usual number of various serial driver fixes and updates to try to
  get them to work with crazy hardware configurations (seriously, how
  many different ways are hardware engineers going to come up with to
  hook up a simple UART?)

  There is also some serdev bugfixes and updates, as well as a
  smattering of other small fixes in here.

  All have been in the linux-next tree for a while, with no reported
  issues"

* tag 'tty-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (65 commits)
  tty: serial: exar: Relocate sleep wake-up handling
  tty: fix data race between tty_init_dev and flush of buf
  serial: imx: fix endless loop during suspend
  serial: core: mark port as initialized after successful IRQ change
  serdev: only match serdev devices
  serdev: do not generate modaliases for controllers
  serial: mxs-auart: don't use GPIOF_* with gpiod_get_direction
  serial: 8250_dw: Revert "Improve clock rate setting"
  MAINTAINERS: Add myself as designated reviewer for 8250_dw
  gpio: serial: max310x: Support open-drain configuration for GPIOs
  serdev: Fix serdev_uevent failure on ACPI enumerated serdev-controllers
  serial: 8250_ingenic: Parse earlycon options
  serial: 8250_ingenic: Add support for the JZ4770 SoC
  serial: core: Make uart_parse_options take const char* argument
  serial: 8250_of: fix return code when probe function fails to get reset
  serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS
  serial: 8250_uniphier: fix error return code in uniphier_uart_probe()
  tty: n_gsm: Allow ADM response in addition to UA for control dlci
  tty: omap-serial: Fix initial on-boot RTS GPIO level
  tty: serial: jsm: Add one check against NULL pointer dereference
  ...
  • Loading branch information
torvalds committed Feb 1, 2018
2 parents e4ee8b8 + c7e1b40 commit db59332
Show file tree
Hide file tree
Showing 43 changed files with 546 additions and 350 deletions.
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
Expand Up @@ -6,10 +6,10 @@ Required properties:
- interrupts : Should contain uart interrupt

Optional properties:
- fsl,irda-mode : Indicate the uart supports irda mode
- fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
in DCE mode by default.
- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
- rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
linux,rs485-enabled-at-boot-time: see rs485.txt

Please check Documentation/devicetree/bindings/serial/serial.txt
for the complete list of generic properties.
Expand Down
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/serial/fsl-lpuart.txt
Expand Up @@ -16,7 +16,8 @@ Required properties:
Optional properties:
- dmas: A list of two dma specifiers, one for each entry in dma-names.
- dma-names: should contain "tx" and "rx".
- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
- rs485-rts-delay, rs485-rts-active-low, rs485-rx-during-tx,
linux,rs485-enabled-at-boot-time: see rs485.txt

Note: Optional properties for DMA support. Write them both or both not.

Expand Down
8 changes: 6 additions & 2 deletions Documentation/devicetree/bindings/serial/ingenic,uart.txt
@@ -1,8 +1,12 @@
* Ingenic SoC UART

Required properties:
- compatible : "ingenic,jz4740-uart", "ingenic,jz4760-uart",
"ingenic,jz4775-uart" or "ingenic,jz4780-uart"
- compatible : One of:
- "ingenic,jz4740-uart",
- "ingenic,jz4760-uart",
- "ingenic,jz4770-uart",
- "ingenic,jz4775-uart",
- "ingenic,jz4780-uart".
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
- clocks : phandles to the module & baud clocks.
Expand Down
18 changes: 16 additions & 2 deletions Documentation/devicetree/bindings/serial/maxim,max310x.txt
Expand Up @@ -24,13 +24,27 @@ Optional properties:
1 = active low.

Example:

/ {
clocks {
spi_uart_clk: osc_max14830 {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <3686400>;
};

};
};

&spi0 {
max14830: max14830@0 {
compatible = "maxim,max14830";
reg = <0>;
clocks = <&clk20m>;
clocks = <&spi_uart_clk>;
clock-names = "osc";
interrupt-parent = <&gpio3>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
gpio-controller;
#gpio-cells = <2>;
};
};
50 changes: 45 additions & 5 deletions Documentation/devicetree/bindings/serial/mvebu-uart.txt
@@ -1,13 +1,53 @@
* Marvell UART : Non standard UART used in some of Marvell EBU SoCs (e.g., Armada-3700)
* Marvell UART : Non standard UART used in some of Marvell EBU SoCs
e.g., Armada-3700.

Required properties:
- compatible: "marvell,armada-3700-uart"
- compatible:
- "marvell,armada-3700-uart" for the standard variant of the UART
(32 bytes FIFO, no DMA, level interrupts, 8-bit access to the
FIFO, baudrate limited to 230400).
- "marvell,armada-3700-uart-ext" for the extended variant of the
UART (128 bytes FIFO, DMA, front interrupts, 8-bit or 32-bit
accesses to the FIFO, baudrate unlimited by the dividers).
- reg: offset and length of the register set for the device.
- interrupts: device interrupt
- clocks: UART reference clock used to derive the baudrate. If no clock
is provided (possible only with the "marvell,armada-3700-uart"
compatible string for backward compatibility), it will only work
if the baudrate was initialized by the bootloader and no baudrate
change will then be possible.
- interrupts:
- Must contain three elements for the standard variant of the IP
(marvell,armada-3700-uart): "uart-sum", "uart-tx" and "uart-rx",
respectively the UART sum interrupt, the UART TX interrupt and
UART RX interrupt. A corresponding interrupt-names property must
be defined.
- Must contain two elements for the extended variant of the IP
(marvell,armada-3700-uart-ext): "uart-tx" and "uart-rx",
respectively the UART TX interrupt and the UART RX interrupt. A
corresponding interrupts-names property must be defined.
- For backward compatibility reasons, a single element interrupts
property is also supported for the standard variant of the IP,
containing only the UART sum interrupt. This form is deprecated
and should no longer be used.

Example:
serial@12000 {
uart0: serial@12000 {
compatible = "marvell,armada-3700-uart";
reg = <0x12000 0x200>;
interrupts = <43>;
clocks = <&xtalclk>;
interrupts =
<GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "uart-sum", "uart-tx", "uart-rx";
};

uart1: serial@12200 {
compatible = "marvell,armada-3700-uart-ext";
reg = <0x12200 0x30>;
clocks = <&xtalclk>;
interrupts =
<GIC_SPI 30 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 31 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "uart-tx", "uart-rx";
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/omap_serial.txt
Expand Up @@ -20,6 +20,7 @@ Optional properties:
node and a DMA channel number.
- dma-names : "rx" for receive channel, "tx" for transmit channel.
- rs485-rts-delay, rs485-rx-during-tx, linux,rs485-enabled-at-boot-time: see rs485.txt
- rs485-rts-active-high: drive RTS high when sending (default is low).

Example:

Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/rs485.txt
Expand Up @@ -12,6 +12,7 @@ Optional properties:
* b is the delay between end of data sent and rts signal in milliseconds
it corresponds to the delay after sending data and actual release of the line.
If this property is not specified, <0 0> is assumed.
- rs485-rts-active-low: drive RTS low when sending (default is high).
- linux,rs485-enabled-at-boot-time: empty property telling to enable the rs485
feature at boot time. It can be disabled later with proper ioctl.
- rs485-rx-during-tx: empty property that enables the receiving of data even
Expand Down
5 changes: 5 additions & 0 deletions MAINTAINERS
Expand Up @@ -13181,6 +13181,11 @@ S: Supported
F: drivers/reset/reset-axs10x.c
F: Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt

SYNOPSYS DESIGNWARE 8250 UART DRIVER
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
S: Maintained
F: drivers/tty/serial/8250/8250_dw.c

SYNOPSYS DESIGNWARE APB GPIO DRIVER
M: Hoan Tran <hotran@apm.com>
L: linux-gpio@vger.kernel.org
Expand Down
6 changes: 5 additions & 1 deletion drivers/tty/Kconfig
Expand Up @@ -394,10 +394,14 @@ config GOLDFISH_TTY
depends on GOLDFISH
select SERIAL_CORE
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
help
Console and system TTY driver for the Goldfish virtual platform.

config GOLDFISH_TTY_EARLY_CONSOLE
bool
default y if GOLDFISH_TTY=y
select SERIAL_EARLYCON

config DA_TTY
bool "DA TTY"
depends on METAG_DA
Expand Down
2 changes: 2 additions & 0 deletions drivers/tty/goldfish.c
Expand Up @@ -433,6 +433,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE
static void gf_early_console_putchar(struct uart_port *port, int ch)
{
__raw_writel(ch, port->membase);
Expand All @@ -456,6 +457,7 @@ static int __init gf_earlycon_setup(struct earlycon_device *device,
}

OF_EARLYCON_DECLARE(early_gf_tty, "google,goldfish-tty", gf_earlycon_setup);
#endif

static const struct of_device_id goldfish_tty_of_match[] = {
{ .compatible = "google,goldfish-tty", },
Expand Down
6 changes: 1 addition & 5 deletions drivers/tty/isicom.c
Expand Up @@ -219,13 +219,9 @@ static struct isi_port isi_ports[PORT_COUNT];
static int WaitTillCardIsFree(unsigned long base)
{
unsigned int count = 0;
unsigned int a = in_atomic(); /* do we run under spinlock? */

while (!(inw(base + 0xe) & 0x1) && count++ < 100)
if (a)
mdelay(1);
else
msleep(1);
mdelay(1);

return !(inw(base + 0xe) & 0x1);
}
Expand Down
17 changes: 11 additions & 6 deletions drivers/tty/moxa.c
Expand Up @@ -1487,8 +1487,6 @@ static void moxa_set_tty_param(struct tty_struct *tty, struct ktermios *old_term
if (ts->c_iflag & IXANY)
xany = 1;

/* Clear the features we don't support */
ts->c_cflag &= ~CMSPAR;
MoxaPortFlowCtrl(ch, rts, cts, txflow, rxflow, xany);
baud = MoxaPortSetTermio(ch, ts, tty_get_baud_rate(tty));
if (baud == -1)
Expand Down Expand Up @@ -1781,10 +1779,17 @@ static int MoxaPortSetTermio(struct moxa_port *port, struct ktermios *termio,
mode |= MX_STOP1;

if (termio->c_cflag & PARENB) {
if (termio->c_cflag & PARODD)
mode |= MX_PARODD;
else
mode |= MX_PAREVEN;
if (termio->c_cflag & PARODD) {
if (termio->c_cflag & CMSPAR)
mode |= MX_PARMARK;
else
mode |= MX_PARODD;
} else {
if (termio->c_cflag & CMSPAR)
mode |= MX_PARSPACE;
else
mode |= MX_PAREVEN;
}
} else
mode |= MX_PARNONE;

Expand Down
2 changes: 2 additions & 0 deletions drivers/tty/moxa.h
Expand Up @@ -301,5 +301,7 @@
#define MX_PARNONE 0x00
#define MX_PAREVEN 0x40
#define MX_PARODD 0xC0
#define MX_PARMARK 0xA0
#define MX_PARSPACE 0x20

#endif
19 changes: 14 additions & 5 deletions drivers/tty/n_gsm.c
Expand Up @@ -1451,6 +1451,10 @@ static void gsm_dlci_open(struct gsm_dlci *dlci)
* in which case an opening port goes back to closed and a closing port
* is simply put into closed state (any further frames from the other
* end will get a DM response)
*
* Some control dlci can stay in ADM mode with other dlci working just
* fine. In that case we can just keep the control dlci open after the
* DLCI_OPENING retries time out.
*/

static void gsm_dlci_t1(struct timer_list *t)
Expand All @@ -1464,8 +1468,15 @@ static void gsm_dlci_t1(struct timer_list *t)
if (dlci->retries) {
gsm_command(dlci->gsm, dlci->addr, SABM|PF);
mod_timer(&dlci->t1, jiffies + gsm->t1 * HZ / 100);
} else
} else if (!dlci->addr && gsm->control == (DM | PF)) {
if (debug & 8)
pr_info("DLCI %d opening in ADM mode.\n",
dlci->addr);
gsm_dlci_open(dlci);
} else {
gsm_dlci_close(dlci);
}

break;
case DLCI_CLOSING:
dlci->retries--;
Expand All @@ -1483,8 +1494,8 @@ static void gsm_dlci_t1(struct timer_list *t)
* @dlci: DLCI to open
*
* Commence opening a DLCI from the Linux side. We issue SABM messages
* to the modem which should then reply with a UA, at which point we
* will move into open state. Opening is done asynchronously with retry
* to the modem which should then reply with a UA or ADM, at which point
* we will move into open state. Opening is done asynchronously with retry
* running off timers and the responses.
*/

Expand Down Expand Up @@ -2955,7 +2966,6 @@ static int gsmtty_open(struct tty_struct *tty, struct file *filp)
static void gsmtty_close(struct tty_struct *tty, struct file *filp)
{
struct gsm_dlci *dlci = tty->driver_data;
struct gsm_mux *gsm;

if (dlci == NULL)
return;
Expand All @@ -2964,7 +2974,6 @@ static void gsmtty_close(struct tty_struct *tty, struct file *filp)
mutex_lock(&dlci->mutex);
gsm_destroy_network(dlci);
mutex_unlock(&dlci->mutex);
gsm = dlci->gsm;
if (tty_port_close_start(&dlci->port, tty, filp) == 0)
return;
gsm_dlci_begin_close(dlci);
Expand Down

0 comments on commit db59332

Please sign in to comment.