Skip to content

Commit

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

  A number of individual driver updates, some code cleanups, and other
  minor things, full details in the shortlog.

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

* tag 'tty-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (152 commits)
  Doc: serial-rs485.txt: update RS485 driver interface
  Doc: tty.txt: remove mention of the BKL
  MAINTAINERS: tty: add serial docs directory
  serial: sprd: check for NULL after calling devm_clk_get
  serial: 8250_pci: Correct uartclk for xr17v35x expansion chips
  serial: 8250_pci: Add support for 12 port Exar boards
  serial: 8250_uniphier: add bindings document for UniPhier UART
  serial: core: cleanup in uart_get_baud_rate()
  serial: stm32-usart: Add STM32 USART Driver
  tty/serial: kill off set_irq_flags usage
  tty: move linux/gsmmux.h to uapi
  doc: dt: add documentation for nxp,lpc1850-uart
  serial: 8250: add LPC18xx/43xx UART driver
  serial: 8250_uniphier: add UniPhier serial driver
  serial: 8250_dw: support ACPI platforms with integrated DMA engine
  serial: of_serial: check the return value of clk_prepare_enable()
  serial: of_serial: use devm_clk_get() instead of clk_get()
  serial: earlycon: Add support for big-endian MMIO accesses
  serial: sirf: use hrtimer for data rx
  serial: sirf: correct the fifo empty_bit
  ...
  • Loading branch information
torvalds committed Jun 26, 2015
2 parents 23908db + 71206b9 commit 8c7febe
Show file tree
Hide file tree
Showing 97 changed files with 3,233 additions and 1,802 deletions.
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* ARM SBSA defined generic UART
This UART uses a subset of the PL011 registers and consequently lives
in the PL011 driver. It's baudrate and other communication parameters
cannot be adjusted at runtime, so it lacks a clock specifier here.

Required properties:
- compatible: must be "arm,sbsa-uart"
- reg: exactly one register range
- interrupts: exactly one interrupt specifier
- current-speed: the (fixed) baud rate set by the firmware
12 changes: 10 additions & 2 deletions Documentation/devicetree/bindings/serial/mtk-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ Required properties:

- interrupts: A single interrupt specifier.

- clocks: Clock driving the hardware.
- clocks : Must contain an entry for each entry in clock-names.
See ../clocks/clock-bindings.txt for details.
- clock-names:
- "baud": The clock the baudrate is derived from
- "bus": The bus clock for register accesses (optional)

For compatibility with older device trees an unnamed clock is used for the
baud clock if the baudclk does not exist. Do not use this for new designs.

Example:

uart0: serial@11006000 {
compatible = "mediatek,mt6589-uart", "mediatek,mt6577-uart";
reg = <0x11006000 0x400>;
interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_LOW>;
clocks = <&uart_clk>;
clocks = <&uart_clk>, <&bus_clk>;
clock-names = "baud", "bus";
};
28 changes: 28 additions & 0 deletions Documentation/devicetree/bindings/serial/nxp,lpc1850-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
* NXP LPC1850 UART

Required properties:
- compatible : "nxp,lpc1850-uart", "ns16550a".
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
- clocks : phandle to the input clocks.
- clock-names : required elements: "uartclk", "reg".

Optional properties:
- dmas : Two or more DMA channel specifiers following the
convention outlined in bindings/dma/dma.txt
- dma-names : Names for the dma channels, if present. There must
be at least one channel named "tx" for transmit
and named "rx" for receive.

Since it's also possible to also use the of_serial.c driver all
parameters from 8250.txt also apply but are optional.

Example:
uart0: serial@40081000 {
compatible = "nxp,lpc1850-uart", "ns16550a";
reg = <0x40081000 0x1000>;
reg-shift = <2>;
interrupts = <24>;
clocks = <&ccu2 CLK_APB0_UART0>, <&ccu1 CLK_CPU_UART0>;
clock-names = "uartclk", "reg";
};
37 changes: 37 additions & 0 deletions Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* NXP SC16IS7xx advanced Universal Asynchronous Receiver-Transmitter (UART)
* i2c as bus

Required properties:
- compatible: Should be one of the following:
Expand Down Expand Up @@ -31,3 +32,39 @@ Example:
gpio-controller;
#gpio-cells = <2>;
};

* spi as bus

Required properties:
- compatible: Should be one of the following:
- "nxp,sc16is740" for NXP SC16IS740,
- "nxp,sc16is741" for NXP SC16IS741,
- "nxp,sc16is750" for NXP SC16IS750,
- "nxp,sc16is752" for NXP SC16IS752,
- "nxp,sc16is760" for NXP SC16IS760,
- "nxp,sc16is762" for NXP SC16IS762.
- reg: SPI chip select number.
- interrupt-parent: The phandle for the interrupt controller that
services interrupts for this IC.
- interrupts: Specifies the interrupt source of the parent interrupt
controller. The format of the interrupt specifier depends on the
parent interrupt controller.
- clocks: phandle to the IC source clock.

Optional properties:
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be two. The first cell is the GPIO number and
the second cell is used to specify the GPIO polarity:
0 = active high,
1 = active low.

Example:
sc16is750: sc16is750@0 {
compatible = "nxp,sc16is750";
reg = <0>;
clocks = <&clk20m>;
interrupt-parent = <&gpio3>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
gpio-controller;
#gpio-cells = <2>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Required properties:
Note: Each enabled SCIx UART should have an alias correctly numbered in the
"aliases" node.

Optional properties:
- dmas: Must contain a list of two references to DMA specifiers, one for
transmission, and one for reception.
- dma-names: Must contain a list of two DMA names, "tx" and "rx".

Example:
aliases {
serial0 = &scifa0;
Expand All @@ -57,4 +62,6 @@ Example:
interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
clock-names = "sci_ick";
dmas = <&dmac0 0x21>, <&dmac0 0x22>;
dma-names = "tx", "rx";
};
15 changes: 1 addition & 14 deletions Documentation/devicetree/bindings/serial/sirf-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

Required properties:
- compatible : Should be "sirf,prima2-uart", "sirf, prima2-usp-uart",
"sirf,atlas7-uart" or "sirf,atlas7-bt-uart" which means
uart located in BT module and used for BT.
"sirf,atlas7-uart" or "sirf,atlas7-usp-uart".
- reg : Offset and length of the register set for the device
- interrupts : Should contain uart interrupt
- fifosize : Should define hardware rx/tx fifo size
Expand Down Expand Up @@ -33,15 +32,3 @@ usp@b0090000 {
rts-gpios = <&gpio 15 0>;
cts-gpios = <&gpio 46 0>;
};

for uart use in BT module,
uart6: uart@11000000 {
cell-index = <6>;
compatible = "sirf,atlas7-bt-uart", "sirf,atlas7-uart";
reg = <0x11000000 0x1000>;
interrupts = <0 100 0>;
clocks = <&clks 138>, <&clks 140>, <&clks 141>;
clock-names = "uart", "general", "noc";
fifosize = <128>;
status = "disabled";
}
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/serial/uniphier-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
UniPhier UART controller

Required properties:
- compatible: should be "socionext,uniphier-uart".
- reg: offset and length of the register set for the device.
- interrupts: a single interrupt specifier.
- clocks: phandle to the input clock.

Optional properties:
- fifo-size: the RX/TX FIFO size. Defaults to 64 if not specified.

Example:
aliases {
serial0 = &serial0;
};

serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
reg = <0x54006800 0x40>;
interrupts = <0 33 4>;
clocks = <&uart_clk>;
fifo-size = <64>;
};
9 changes: 5 additions & 4 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -972,14 +972,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
uart[8250],io,<addr>[,options]
uart[8250],mmio,<addr>[,options]
uart[8250],mmio32,<addr>[,options]
uart[8250],mmio32be,<addr>[,options]
uart[8250],0x<addr>[,options]
Start an early, polled-mode console on the 8250/16550
UART at the specified I/O port or MMIO address.
MMIO inter-register address stride is either 8-bit
(mmio) or 32-bit (mmio32).
If none of [io|mmio|mmio32], <addr> is assumed to be
equivalent to 'mmio'. 'options' are specified in the
same format described for "console=ttyS<n>"; if
(mmio) or 32-bit (mmio32 or mmio32be).
If none of [io|mmio|mmio32|mmio32be], <addr> is assumed
to be equivalent to 'mmio'. 'options' are specified
in the same format described for "console=ttyS<n>"; if
unspecified, the h/w is not initialized.

pl011,<addr>
Expand Down
50 changes: 5 additions & 45 deletions Documentation/serial/serial-rs485.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,10 @@
the values given by the device tree.

Any driver for devices capable of working both as RS232 and RS485 should
provide at least the following ioctls:

- TIOCSRS485 (typically associated with number 0x542F). This ioctl is used
to enable/disable RS485 mode from user-space

- TIOCGRS485 (typically associated with number 0x542E). This ioctl is used
to get RS485 mode from kernel-space (i.e., driver) to user-space.

In other words, the serial driver should contain a code similar to the next
one:

static struct uart_ops atmel_pops = {
/* ... */
.ioctl = handle_ioctl,
};

static int handle_ioctl(struct uart_port *port,
unsigned int cmd,
unsigned long arg)
{
struct serial_rs485 rs485conf;

switch (cmd) {
case TIOCSRS485:
if (copy_from_user(&rs485conf,
(struct serial_rs485 *) arg,
sizeof(rs485conf)))
return -EFAULT;

/* ... */
break;

case TIOCGRS485:
if (copy_to_user((struct serial_rs485 *) arg,
...,
sizeof(rs485conf)))
return -EFAULT;
/* ... */
break;

/* ... */
}
}

implement the rs485_config callback in the uart_port structure. The
serial_core calls rs485_config to do the device specific part in response
to TIOCSRS485 and TIOCGRS485 ioctls (see below). The rs485_config callback
receives a pointer to struct serial_rs485.

4. USAGE FROM USER-LEVEL

Expand All @@ -85,7 +45,7 @@

#include <linux/serial.h>

/* Driver-specific ioctls: */
/* RS485 ioctls: */
#define TIOCGRS485 0x542E
#define TIOCSRS485 0x542F

Expand Down
3 changes: 0 additions & 3 deletions Documentation/serial/tty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Your guide to the ancient and twisted locking policies of the tty layer and
the warped logic behind them. Beware all ye who read on.

FIXME: still need to work out the full set of BKL assumptions and document
them so they can eventually be killed off.


Line Discipline
---------------
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10316,6 +10316,7 @@ M: Greg Kroah-Hartman <[email protected]>
M: Jiri Slaby <[email protected]>
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
F: Documentation/serial/
F: drivers/tty/
F: drivers/tty/serial/serial_core.c
F: include/linux/serial_core.h
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define BASE_BAUD ( 1843200 / 16 )

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_DETECT_IRQ
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#else
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/common/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,9 @@ void edma_stop(unsigned channel)
edma_shadow0_write_array(ctlr, SH_SECR, j, mask);
edma_write_array(ctlr, EDMA_EMCR, j, mask);

/* clear possibly pending completion interrupt */
edma_shadow0_write_array(ctlr, SH_ICR, j, mask);

pr_debug("EDMA: EER%d %08x\n", j,
edma_shadow0_read_array(ctlr, SH_EER, j));

Expand Down
8 changes: 4 additions & 4 deletions arch/blackfin/include/asm/bfin_serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
defined(CONFIG_BFIN_UART2_CTSRTS) || \
defined(CONFIG_BFIN_UART3_CTSRTS)
# if defined(BFIN_UART_BF54X_STYLE) || defined(BFIN_UART_BF60X_STYLE)
# define CONFIG_SERIAL_BFIN_HARD_CTSRTS
# define SERIAL_BFIN_HARD_CTSRTS
# else
# define CONFIG_SERIAL_BFIN_CTSRTS
# define SERIAL_BFIN_CTSRTS
# endif
#endif

Expand All @@ -50,8 +50,8 @@ struct bfin_serial_port {
#elif ANOMALY_05000363
unsigned int anomaly_threshold;
#endif
#if defined(CONFIG_SERIAL_BFIN_CTSRTS) || \
defined(CONFIG_SERIAL_BFIN_HARD_CTSRTS)
#if defined(SERIAL_BFIN_CTSRTS) || \
defined(SERIAL_BFIN_HARD_CTSRTS)
int cts_pin;
int rts_pin;
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define BASE_BAUD ( 1843200 / 16 )

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_DETECT_IRQ
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#else
Expand Down
4 changes: 2 additions & 2 deletions arch/mn10300/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#define _ASM_SERIAL_H

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_DETECT_IRQ
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
#endif

#ifdef CONFIG_SERIAL_MANY_PORTS
#ifdef CONFIG_SERIAL_8250_MANY_PORTS
#define FOURPORT_FLAGS ASYNC_FOURPORT
#define ACCENT_FLAGS 0
#define BOCA_FLAGS 0
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define BASE_BAUD (1843200/16)

/* Standard COM flags (except for COM4, because of the 8514 problem) */
#ifdef CONFIG_SERIAL_DETECT_IRQ
#ifdef CONFIG_SERIAL_8250_DETECT_IRQ
# define STD_COMX_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ)
# define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | 0 | UPF_AUTO_IRQ)
#else
Expand Down
7 changes: 1 addition & 6 deletions drivers/dma/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ static int edma_dma_pause(struct dma_chan *chan)
{
struct edma_chan *echan = to_edma_chan(chan);

/* Pause/Resume only allowed with cyclic mode */
if (!echan->edesc || !echan->edesc->cyclic)
if (!echan->edesc)
return -EINVAL;

edma_pause(echan->ch_num);
Expand All @@ -312,10 +311,6 @@ static int edma_dma_resume(struct dma_chan *chan)
{
struct edma_chan *echan = to_edma_chan(chan);

/* Pause/Resume only allowed with cyclic mode */
if (!echan->edesc->cyclic)
return -EINVAL;

edma_resume(echan->ch_num);
return 0;
}
Expand Down
Loading

0 comments on commit 8c7febe

Please sign in to comment.