Skip to content

Commit

Permalink
Merge tag 'tty-3.9-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 patches from Greg Kroah-Hartman:
 "Here's the big tty/serial driver patches for 3.9-rc1.

  More tty port rework and fixes from Jiri here, as well as lots of
  individual serial driver updates and fixes.

  All of these have been in the linux-next tree for a while."

* tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits)
  tty: mxser: improve error handling in mxser_probe() and mxser_module_init()
  serial: imx: fix uninitialized variable warning
  serial: tegra: assume CONFIG_OF
  TTY: do not update atime/mtime on read/write
  lguest: select CONFIG_TTY to build properly.
  ARM defconfigs: add missing inclusions of linux/platform_device.h
  fb/exynos: include platform_device.h
  ARM: sa1100/assabet: include platform_device.h directly
  serial: imx: Fix recursive locking bug
  pps: Fix build breakage from decoupling pps from tty
  tty: Remove ancient hardpps()
  pps: Additional cleanups in uart_handle_dcd_change
  pps: Move timestamp read into PPS code proper
  pps: Don't crash the machine when exiting will do
  pps: Fix a use-after free bug when unregistering a source.
  pps: Use pps_lookup_dev to reduce ldisc coupling
  pps: Add pps_lookup_dev() function
  tty: serial: uartlite: Support uartlite on big and little endian systems
  tty: serial: uartlite: Fix sparse and checkpatch warnings
  serial/arc-uart: Miscll DT related updates (Grant's review comments)
  ...

Fix up trivial conflicts, mostly just due to the TTY config option
clashing with the EXPERIMENTAL removal.
  • Loading branch information
torvalds committed Feb 21, 2013
2 parents 74e1a2a + 9e17df3 commit 21eaab6
Show file tree
Hide file tree
Showing 267 changed files with 6,862 additions and 2,525 deletions.
24 changes: 24 additions & 0 deletions Documentation/devicetree/bindings/serial/nvidia,tegra20-hsuart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
NVIDIA Tegra20/Tegra30 high speed (DMA based) UART controller driver.

Required properties:
- compatible : should be "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart".
- reg: Should contain UART controller registers location and length.
- interrupts: Should contain UART controller interrupts.
- nvidia,dma-request-selector : The Tegra DMA controller's phandle and
request selector for this UART controller.

Optional properties:
- nvidia,enable-modem-interrupt: Enable modem interrupts. Should be enable
only if all 8 lines of UART controller are pinmuxed.

Example:

serial@70006000 {
compatible = "nvidia,tegra30-hsuart", "nvidia,tegra20-hsuart";
reg = <0x70006000 0x40>;
reg-shift = <2>;
interrupts = <0 36 0x04>;
nvidia,dma-request-selector = <&apbdma 8>;
nvidia,enable-modem-interrupt;
status = "disabled";
};
26 changes: 26 additions & 0 deletions Documentation/devicetree/bindings/tty/serial/arc-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
* Synopsys ARC UART : Non standard UART used in some of the ARC FPGA boards

Required properties:
- compatible : "snps,arc-uart"
- reg : offset and length of the register set for the device.
- interrupts : device interrupt
- clock-frequency : the input clock frequency for the UART
- current-speed : baud rate for UART

e.g.

arcuart0: serial@c0fc1000 {
compatible = "snps,arc-uart";
reg = <0xc0fc1000 0x100>;
interrupts = <5>;
clock-frequency = <80000000>;
current-speed = <115200>;
status = "okay";
};

Note: Each port should have an alias correctly numbered in "aliases" node.

e.g.
aliases {
serial0 = &arcuart0;
};
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/tty/serial/efm32-uart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ Required properties:
- reg : Address and length of the register set
- interrupts : Should contain uart interrupt

Optional properties:
- location : Decides the location of the USART I/O pins.
Allowed range : [0 .. 5]
Default: 0

Example:

uart@0x4000c400 {
compatible = "efm32,uart";
reg = <0x4000c400 0x400>;
interrupts = <15>;
location = <0>;
};
44 changes: 41 additions & 3 deletions Documentation/serial/driver
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ hardware.
Interrupts: locally disabled.
This call must not sleep

send_xchar(port,ch)
Transmit a high priority character, even if the port is stopped.
This is used to implement XON/XOFF flow control and tcflow(). If
the serial driver does not implement this function, the tty core
will append the character to the circular buffer and then call
start_tx() / stop_tx() to flush the data out.

Locking: none.
Interrupts: caller dependent.

stop_rx(port)
Stop receiving characters; the port is in the process of
being closed.
Expand Down Expand Up @@ -242,9 +252,8 @@ hardware.

pm(port,state,oldstate)
Perform any power management related activities on the specified
port. State indicates the new state (defined by ACPI D0-D3),
oldstate indicates the previous state. Essentially, D0 means
fully on, D3 means powered down.
port. State indicates the new state (defined by
enum uart_pm_state), oldstate indicates the previous state.

This function should not be used to grab any resources.

Expand All @@ -255,6 +264,10 @@ hardware.
Locking: none.
Interrupts: caller dependent.

set_wake(port,state)
Enable/disable power management wakeup on serial activity. Not
currently implemented.

type(port)
Return a pointer to a string constant describing the specified
port, or return NULL, in which case the string 'unknown' is
Expand Down Expand Up @@ -307,6 +320,31 @@ hardware.
Locking: none.
Interrupts: caller dependent.

poll_init(port)
Called by kgdb to perform the minimal hardware initialization needed
to support poll_put_char() and poll_get_char(). Unlike ->startup()
this should not request interrupts.

Locking: tty_mutex and tty_port->mutex taken.
Interrupts: n/a.

poll_put_char(port,ch)
Called by kgdb to write a single character directly to the serial
port. It can and should block until there is space in the TX FIFO.

Locking: none.
Interrupts: caller dependent.
This call must not sleep

poll_get_char(port)
Called by kgdb to read a single character directly from the serial
port. If data is available, it should be returned; otherwise
the function should return NO_POLL_CHAR immediately.

Locking: none.
Interrupts: caller dependent.
This call must not sleep

Other functions
---------------

Expand Down
2 changes: 2 additions & 0 deletions arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ choice

config ALPHA_GENERIC
bool "Generic"
depends on TTY
help
A generic kernel will run on all supported Alpha hardware.

Expand Down Expand Up @@ -490,6 +491,7 @@ config VGA_HOSE

config ALPHA_SRM
bool "Use SRM as bootloader" if ALPHA_CABRIOLET || ALPHA_AVANTI_CH || ALPHA_EB64P || ALPHA_PC164 || ALPHA_TAKARA || ALPHA_EB164 || ALPHA_ALCOR || ALPHA_MIATA || ALPHA_LX164 || ALPHA_SX164 || ALPHA_NAUTILUS || ALPHA_NONAME
depends on TTY
default y if ALPHA_JENSEN || ALPHA_MIKASA || ALPHA_SABLE || ALPHA_LYNX || ALPHA_NORITAKE || ALPHA_DP264 || ALPHA_RAWHIDE || ALPHA_EIGER || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_SHARK || ALPHA_MARVEL
---help---
There are two different types of booting firmware on Alphas: SRM,
Expand Down
18 changes: 9 additions & 9 deletions arch/alpha/kernel/srmcons.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ typedef union _srmcons_result {

/* called with callback_lock held */
static int
srmcons_do_receive_chars(struct tty_struct *tty)
srmcons_do_receive_chars(struct tty_port *port)
{
srmcons_result result;
int count = 0, loops = 0;

do {
result.as_long = callback_getc(0);
if (result.bits.status < 2) {
tty_insert_flip_char(tty, (char)result.bits.c, 0);
tty_insert_flip_char(port, (char)result.bits.c, 0);
count++;
}
} while((result.bits.status & 1) && (++loops < 10));

if (count)
tty_schedule_flip(tty);
tty_schedule_flip(port);

return count;
}
Expand All @@ -73,7 +73,7 @@ srmcons_receive_chars(unsigned long data)

local_irq_save(flags);
if (spin_trylock(&srmcons_callback_lock)) {
if (!srmcons_do_receive_chars(port->tty))
if (!srmcons_do_receive_chars(port))
incr = 100;
spin_unlock(&srmcons_callback_lock);
}
Expand All @@ -88,7 +88,7 @@ srmcons_receive_chars(unsigned long data)

/* called with callback_lock held */
static int
srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
srmcons_do_write(struct tty_port *port, const char *buf, int count)
{
static char str_cr[1] = "\r";
long c, remaining = count;
Expand All @@ -113,10 +113,10 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
cur += result.bits.c;

/*
* Check for pending input iff a tty was provided
* Check for pending input iff a tty port was provided
*/
if (tty)
srmcons_do_receive_chars(tty);
if (port)
srmcons_do_receive_chars(port);
}

while (need_cr) {
Expand All @@ -135,7 +135,7 @@ srmcons_write(struct tty_struct *tty,
unsigned long flags;

spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(tty, (const char *) buf, count);
srmcons_do_write(tty->port, (const char *) buf, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags);

return count;
Expand Down
40 changes: 36 additions & 4 deletions arch/arm/boot/dts/vt8500.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,38 @@
compatible = "fixed-clock";
clock-frequency = <24000000>;
};

clkuart0: uart0 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <1>;
};

clkuart1: uart1 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <2>;
};

clkuart2: uart2 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <3>;
};

clkuart3: uart3 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <4>;
};
};
};

Expand Down Expand Up @@ -83,28 +115,28 @@
compatible = "via,vt8500-uart";
reg = <0xd8200000 0x1040>;
interrupts = <32>;
clocks = <&ref24>;
clocks = <&clkuart0>;
};

uart@d82b0000 {
compatible = "via,vt8500-uart";
reg = <0xd82b0000 0x1040>;
interrupts = <33>;
clocks = <&ref24>;
clocks = <&clkuart1>;
};

uart@d8210000 {
compatible = "via,vt8500-uart";
reg = <0xd8210000 0x1040>;
interrupts = <47>;
clocks = <&ref24>;
clocks = <&clkuart2>;
};

uart@d82c0000 {
compatible = "via,vt8500-uart";
reg = <0xd82c0000 0x1040>;
interrupts = <50>;
clocks = <&ref24>;
clocks = <&clkuart3>;
};

rtc@d8100000 {
Expand Down
60 changes: 54 additions & 6 deletions arch/arm/boot/dts/wm8505.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,54 @@
compatible = "fixed-clock";
clock-frequency = <24000000>;
};

clkuart0: uart0 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <1>;
};

clkuart1: uart1 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <2>;
};

clkuart2: uart2 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <3>;
};

clkuart3: uart3 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <4>;
};

clkuart4: uart4 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <22>;
};

clkuart5: uart5 {
#clock-cells = <0>;
compatible = "via,vt8500-device-clock";
clocks = <&ref24>;
enable-reg = <0x250>;
enable-bit = <23>;
};
};
};

Expand Down Expand Up @@ -96,42 +144,42 @@
compatible = "via,vt8500-uart";
reg = <0xd8200000 0x1040>;
interrupts = <32>;
clocks = <&ref24>;
clocks = <&clkuart0>;
};

uart@d82b0000 {
compatible = "via,vt8500-uart";
reg = <0xd82b0000 0x1040>;
interrupts = <33>;
clocks = <&ref24>;
clocks = <&clkuart1>;
};

uart@d8210000 {
compatible = "via,vt8500-uart";
reg = <0xd8210000 0x1040>;
interrupts = <47>;
clocks = <&ref24>;
clocks = <&clkuart2>;
};

uart@d82c0000 {
compatible = "via,vt8500-uart";
reg = <0xd82c0000 0x1040>;
interrupts = <50>;
clocks = <&ref24>;
clocks = <&clkuart3>;
};

uart@d8370000 {
compatible = "via,vt8500-uart";
reg = <0xd8370000 0x1040>;
interrupts = <31>;
clocks = <&ref24>;
clocks = <&clkuart4>;
};

uart@d8380000 {
compatible = "via,vt8500-uart";
reg = <0xd8380000 0x1040>;
interrupts = <30>;
clocks = <&ref24>;
clocks = <&clkuart5>;
};

rtc@d8100000 {
Expand Down
Loading

0 comments on commit 21eaab6

Please sign in to comment.