Skip to content

Commit

Permalink
Merge tag 'tty-4.7-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 and serial driver updates from Greg KH:
 "Here's the large TTY and Serial driver update for 4.7-rc1.

  A few new serial drivers are added here, and Peter has fixed a bunch
  of long-standing bugs in the tty layer and serial drivers as normal.
  Full details in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (88 commits)
  MAINTAINERS: 8250: remove website reference
  serial: core: Fix port mutex assert if lockdep disabled
  serial: 8250_dw: fix wrong logic in dw8250_check_lcr()
  tty: vt, finish looping on duplicate
  tty: vt, return error when con_startup fails
  QE-UART: add "fsl,t1040-ucc-uart" to of_device_id
  serial: mctrl_gpio: Drop support for out1-gpios and out2-gpios
  serial: 8250dw: Add device HID for future AMD UART controller
  Fix OpenSSH pty regression on close
  serial: mctrl_gpio: add IRQ locking
  serial: 8250: Integrate Fintek into 8250_base
  serial: mps2-uart: add support for early console
  serial: mps2-uart: add MPS2 UART driver
  dt-bindings: document the MPS2 UART bindings
  serial: sirf: Use generic uart-has-rtscts DT property
  serial: sirf: Introduce helper variable struct device_node *np
  serial: mxs-auart: Use generic uart-has-rtscts DT property
  serial: imx: Use generic uart-has-rtscts DT property
  doc: DT: Add Generic Serial Device Tree Bindings
  serial: 8250: of: Make tegra_serial_handle_break() static
  ...
  • Loading branch information
torvalds committed May 21, 2016
2 parents 0eff458 + d20bb59 commit e10abc6
Show file tree
Hide file tree
Showing 104 changed files with 2,528 additions and 1,174 deletions.
19 changes: 19 additions & 0 deletions Documentation/devicetree/bindings/serial/arm,mps2-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARM MPS2 UART

Required properties:
- compatible : Should be "arm,mps2-uart"
- reg : Address and length of the register set
- interrupts : Reference to the UART RX, TX and overrun interrupts

Required clocking property:
- clocks : The input clock of the UART


Examples:

uart0: serial@40004000 {
compatible = "arm,mps2-uart";
reg = <0x40004000 0x1000>;
interrupts = <0 1 12>;
clocks = <&sysclk>;
};
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Required properties:
- interrupts : Should contain uart interrupt

Optional properties:
- fsl,uart-has-rtscts : Indicate the uart has rts and cts
- uart-has-rtscts : Indicate the uart has rts and cts
- 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.
Expand All @@ -24,6 +24,6 @@ uart1: serial@73fbc000 {
compatible = "fsl,imx51-uart", "fsl,imx21-uart";
reg = <0x73fbc000 0x4000>;
interrupts = <31>;
fsl,uart-has-rtscts;
uart-has-rtscts;
fsl,dte-mode;
};
16 changes: 12 additions & 4 deletions Documentation/devicetree/bindings/serial/fsl-mxs-auart.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
* Freescale MXS Application UART (AUART)

Required properties:
- compatible : Should be "fsl,<soc>-auart". The supported SoCs include
imx23 and imx28.
Required properties for all SoCs:
- compatible : Should be one of fallowing variants:
"fsl,imx23-auart" - Freescale i.MX23
"fsl,imx28-auart" - Freescale i.MX28
"alphascale,asm9260-auart" - Alphascale ASM9260
- reg : Address and length of the register set for the device
- interrupts : Should contain the auart interrupt numbers
- dmas: DMA specifier, consisting of a phandle to DMA controller node
and AUART DMA channel ID.
Refer to dma.txt and fsl-mxs-dma.txt for details.
- dma-names: "rx" for RX channel, "tx" for TX channel.

Required properties for "alphascale,asm9260-auart":
- clocks : the clocks feeding the watchdog timer. See clock-bindings.txt
- clock-names : should be set to
"mod" - source for tick counter.
"ahb" - ahb gate.

Optional properties:
- fsl,uart-has-rtscts : Indicate the UART has RTS and CTS lines
- uart-has-rtscts : Indicate the UART has RTS and CTS lines
for hardware flow control,
it also means you enable the DMA support for this UART.
- {rts,cts,dtr,dsr,rng,dcd}-gpios: specify a GPIO for RTS/CTS/DTR/DSR/RI/DCD
Expand Down
57 changes: 57 additions & 0 deletions Documentation/devicetree/bindings/serial/serial.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Generic Serial DT Bindings

This document lists a set of generic properties for describing UARTs in a
device tree. Whether these properties apply to a particular device depends on
the DT bindings for the actual device.

Optional properties:
- cts-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's CTS line.
- dcd-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's DCD line.
- dsr-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's DSR line.
- dtr-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's DTR line.
- rng-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's RNG line.
- rts-gpios: Must contain a GPIO specifier, referring to the GPIO pin to be
used as the UART's RTS line.

- uart-has-rtscts: The presence of this property indicates that the
UART has dedicated lines for RTS/CTS hardware flow control, and that
they are available for use (wired and enabled by pinmux configuration).
This depends on both the UART hardware and the board wiring.
Note that this property is mutually-exclusive with "cts-gpios" and
"rts-gpios" above.


Examples:

uart1: serial@48022000 {
compatible = "ti,am3352-uart", "ti,omap3-uart";
ti,hwmods = "uart2";
clock-frequency = <48000000>;
reg = <0x48022000 0x2000>;
interrupts = <73>;
dmas = <&edma 28 0>, <&edma 29 0>;
dma-names = "tx", "rx";
dtr-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
dsr-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
dcd-gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
rng-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
cts-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
status = "okay";
};

scifa4: serial@e6c80000 {
compatible = "renesas,scifa-sh73a0", "renesas,scifa";
reg = <0xe6c80000 0x100>;
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp2_clks SH73A0_CLK_SCIFA4>;
clock-names = "fck";
power-domains = <&pd_a3sp>;
uart-has-rtscts;
status = "okay";
};
8 changes: 4 additions & 4 deletions Documentation/devicetree/bindings/serial/sirf-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Required properties:
- clocks : Should contain uart clock number

Optional properties:
- sirf,uart-has-rtscts: we have hardware flow controller pins in hardware
- rts-gpios: RTS pin for USP-based UART if sirf,uart-has-rtscts is true
- cts-gpios: CTS pin for USP-based UART if sirf,uart-has-rtscts is true
- uart-has-rtscts: we have hardware flow controller pins in hardware
- rts-gpios: RTS pin for USP-based UART if uart-has-rtscts is true
- cts-gpios: CTS pin for USP-based UART if uart-has-rtscts is true

Example:

Expand All @@ -28,7 +28,7 @@ On the board-specific dts, we can put rts-gpios and cts-gpios like

usp@b0090000 {
compatible = "sirf,prima2-usp-uart";
sirf,uart-has-rtscts;
uart-has-rtscts;
rts-gpios = <&gpio 15 0>;
cts-gpios = <&gpio 46 0>;
};
6 changes: 6 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
the driver will use only 32-bit accessors to read/write
the device registers.

meson,<addr>
Start an early, polled-mode console on a meson serial
port at the specified address. The serial port must
already be setup and configured. Options are not yet
supported.

msm_serial,<addr>
Start an early, polled-mode console on an msm serial
port at the specified address. The serial port
Expand Down
3 changes: 0 additions & 3 deletions Documentation/serial/tty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ TTY_IO_ERROR If set, causes all subsequent userspace read/write

TTY_OTHER_CLOSED Device is a pty and the other side has closed.

TTY_OTHER_DONE Device is a pty and the other side has closed and
all pending input processing has been completed.

TTY_NO_WRITE_SPLIT Prevent driver from splitting up writes into
smaller chunks.

Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ F: drivers/net/ethernet/realtek/r8169.c
8250/16?50 (AND CLONE UARTS) SERIAL DRIVER
M: Greg Kroah-Hartman <[email protected]>
L: [email protected]
W: http://serial.sourceforge.net
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
F: drivers/tty/serial/8250*
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/hp/sim/simserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int rs_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
(cmd != TIOCMIWAIT)) {
if (tty->flags & (1 << TTY_IO_ERROR))
if (tty_io_error(tty))
return -EIO;
}

Expand Down
6 changes: 4 additions & 2 deletions arch/mips/ath79/early_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ static inline void prom_putchar_wait(void __iomem *reg, u32 mask, u32 val)
} while (1);
}

#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)

static void prom_putchar_ar71xx(unsigned char ch)
{
void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE));

prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE);
prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
__raw_writel(ch, base + UART_TX * 4);
prom_putchar_wait(base + UART_LSR * 4, UART_LSR_THRE, UART_LSR_THRE);
prom_putchar_wait(base + UART_LSR * 4, BOTH_EMPTY, BOTH_EMPTY);
}

static void prom_putchar_ar933x(unsigned char ch)
Expand Down
29 changes: 11 additions & 18 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ static void dcd_change(MGSLPC_INFO *info, struct tty_struct *tty)
wake_up_interruptible(&info->status_event_wait_q);
wake_up_interruptible(&info->event_wait_q);

if (info->port.flags & ASYNC_CHECK_CD) {
if (tty_port_check_carrier(&info->port)) {
if (debug_level >= DEBUG_LEVEL_ISR)
printk("%s CD now %s...", info->device_name,
(info->serial_signals & SerialSignal_DCD) ? "on" : "off");
Expand Down Expand Up @@ -1272,7 +1272,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):startup(%s)\n", __FILE__, __LINE__, info->device_name);

if (info->port.flags & ASYNC_INITIALIZED)
if (tty_port_initialized(&info->port))
return 0;

if (!info->tx_buf) {
Expand Down Expand Up @@ -1311,7 +1311,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)
if (tty)
clear_bit(TTY_IO_ERROR, &tty->flags);

info->port.flags |= ASYNC_INITIALIZED;
tty_port_set_initialized(&info->port, 1);

return 0;
}
Expand All @@ -1322,7 +1322,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
{
unsigned long flags;

if (!(info->port.flags & ASYNC_INITIALIZED))
if (!tty_port_initialized(&info->port))
return;

if (debug_level >= DEBUG_LEVEL_INFO)
Expand Down Expand Up @@ -1361,7 +1361,7 @@ static void shutdown(MGSLPC_INFO * info, struct tty_struct *tty)
if (tty)
set_bit(TTY_IO_ERROR, &tty->flags);

info->port.flags &= ~ASYNC_INITIALIZED;
tty_port_set_initialized(&info->port, 0);
}

static void mgslpc_program_hw(MGSLPC_INFO *info, struct tty_struct *tty)
Expand Down Expand Up @@ -1466,15 +1466,8 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
}
info->timeout += HZ/50; /* Add .02 seconds of slop */

if (cflag & CRTSCTS)
info->port.flags |= ASYNC_CTS_FLOW;
else
info->port.flags &= ~ASYNC_CTS_FLOW;

if (cflag & CLOCAL)
info->port.flags &= ~ASYNC_CHECK_CD;
else
info->port.flags |= ASYNC_CHECK_CD;
tty_port_set_cts_flow(&info->port, cflag & CRTSCTS);
tty_port_set_check_carrier(&info->port, ~cflag & CLOCAL);

/* process tty input control flags */

Expand Down Expand Up @@ -2246,7 +2239,7 @@ static int mgslpc_ioctl(struct tty_struct *tty,

if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != TIOCMIWAIT)) {
if (tty->flags & (1 << TTY_IO_ERROR))
if (tty_io_error(tty))
return -EIO;
}

Expand Down Expand Up @@ -2316,7 +2309,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, struct ktermios *old_term
/* Handle transition away from B0 status */
if (!(old_termios->c_cflag & CBAUD) && C_BAUD(tty)) {
info->serial_signals |= SerialSignal_DTR;
if (!C_CRTSCTS(tty) || !test_bit(TTY_THROTTLED, &tty->flags))
if (!C_CRTSCTS(tty) || !tty_throttled(tty))
info->serial_signals |= SerialSignal_RTS;
spin_lock_irqsave(&info->lock, flags);
set_signals(info);
Expand Down Expand Up @@ -2345,7 +2338,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
if (tty_port_close_start(port, tty, filp) == 0)
goto cleanup;

if (port->flags & ASYNC_INITIALIZED)
if (tty_port_initialized(port))
mgslpc_wait_until_sent(tty, info->timeout);

mgslpc_flush_buffer(tty);
Expand Down Expand Up @@ -2378,7 +2371,7 @@ static void mgslpc_wait_until_sent(struct tty_struct *tty, int timeout)
if (mgslpc_paranoia_check(info, tty->name, "mgslpc_wait_until_sent"))
return;

if (!(info->port.flags & ASYNC_INITIALIZED))
if (!tty_port_initialized(&info->port))
goto exit;

orig_jiffies = jiffies;
Expand Down
5 changes: 2 additions & 3 deletions drivers/ipack/devices/ipoctal.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ static void ipoctal_hangup(struct tty_struct *tty)
tty_port_hangup(&channel->tty_port);

ipoctal_reset_channel(channel);

clear_bit(ASYNCB_INITIALIZED, &channel->tty_port.flags);
tty_port_set_initialized(&channel->tty_port, 0);
wake_up_interruptible(&channel->tty_port.open_wait);
}

Expand All @@ -642,7 +641,7 @@ static void ipoctal_shutdown(struct tty_struct *tty)
return;

ipoctal_reset_channel(channel);
clear_bit(ASYNCB_INITIALIZED, &channel->tty_port.flags);
tty_port_set_initialized(&channel->tty_port, 0);
}

static void ipoctal_cleanup(struct tty_struct *tty)
Expand Down
Loading

0 comments on commit e10abc6

Please sign in to comment.