diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-08 06:52:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-08 06:52:11 -0400 |
commit | 683a52a10148e929fb4844f9237f059a47c0b01b (patch) | |
tree | a64af13ef46a08ff12d1974725cd70d768750fb6 /drivers/tty/serial/clps711x.c | |
parent | b9af5643fdc5365a23f9752a1181fef374425217 (diff) | |
parent | 69784fa539efa477f39b5a849c27d5e630e0db27 (diff) |
Merge tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH:
"Here's the big tty/serial driver patchset for 3.18-rc1.
Lots of little things in here, some good work from Peter Hurley on the
tty core, and in lots of drivers. There are also lots of other driver
updates in here as well, full details in the changelogs.
All have been in the linux-next tree for a while"
* tag 'tty-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (99 commits)
Revert "serial/core: Initialize the console pm state"
tty: serial: 8250: use 32bit variable for rpm_tx_active
tty: serial: msm: Add earlycon support
serial/core: Initialize the console pm state
serial: asc: Conditionally use readl_relaxed (COMPILE_TEST)
serial: of-serial: add PM suspend/resume support
m68k: AMIGA_BUILTIN_SERIAL should depend on TTY
asm/uapi: Add definition of TIOC[SG]RS485
tty/metag_da: Add console_poll module parameter
serial: 8250_pci: remove rts_n override from Baytrail quirk
serial: cadence: Add generic earlycon support
serial: imx: change the wait even to interruptiable
serial: imx: terminate the RX DMA when the UART is suspending
serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
serial: 8250: Add Quark X1000 to 8250_pci.c
tty: omap-serial: pull out calculation from baud_is_mode16
tty: omap-serial: fix division by zero
xen_hvc: no reason to write the type key on xenstore
tty: serial: 8250_core: remove UART_IER_RDI in serial8250_stop_rx()
tty: serial: 8250_core: use the ->line argument as a hint in serial8250_find_match_or_unused()
...
Diffstat (limited to 'drivers/tty/serial/clps711x.c')
-rw-r--r-- | drivers/tty/serial/clps711x.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index f5b4c3d7e38f..acfe31773643 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -33,6 +33,8 @@ #include <linux/mfd/syscon.h> #include <linux/mfd/syscon/clps711x.h> +#include "serial_mctrl_gpio.h" + #define UART_CLPS711X_DEVNAME "ttyCL" #define UART_CLPS711X_NR 2 #define UART_CLPS711X_MAJOR 204 @@ -62,7 +64,7 @@ struct clps711x_port { unsigned int tx_enabled; int rx_irq; struct regmap *syscon; - bool use_ms; + struct mctrl_gpios *gpios; }; static struct uart_driver clps711x_uart = { @@ -198,28 +200,17 @@ static unsigned int uart_clps711x_tx_empty(struct uart_port *port) static unsigned int uart_clps711x_get_mctrl(struct uart_port *port) { + unsigned int result = TIOCM_DSR | TIOCM_CTS | TIOCM_CAR; struct clps711x_port *s = dev_get_drvdata(port->dev); - unsigned int result = 0; - - if (s->use_ms) { - u32 sysflg = 0; - - regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg); - if (sysflg & SYSFLG1_DCD) - result |= TIOCM_CAR; - if (sysflg & SYSFLG1_DSR) - result |= TIOCM_DSR; - if (sysflg & SYSFLG1_CTS) - result |= TIOCM_CTS; - } else - result = TIOCM_DSR | TIOCM_CTS | TIOCM_CAR; - return result; + return mctrl_gpio_get(s->gpios, &result); } static void uart_clps711x_set_mctrl(struct uart_port *port, unsigned int mctrl) { - /* Do nothing */ + struct clps711x_port *s = dev_get_drvdata(port->dev); + + mctrl_gpio_set(s->gpios, mctrl); } static void uart_clps711x_break_ctl(struct uart_port *port, int break_state) @@ -490,15 +481,10 @@ static int uart_clps711x_probe(struct platform_device *pdev) s->syscon = syscon_regmap_lookup_by_pdevname(syscon_name); if (IS_ERR(s->syscon)) return PTR_ERR(s->syscon); - - s->use_ms = !index; } else { s->syscon = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(s->syscon)) return PTR_ERR(s->syscon); - - if (!index) - s->use_ms = of_property_read_bool(np, "uart-use-ms"); } s->port.line = index; @@ -513,6 +499,8 @@ static int uart_clps711x_probe(struct platform_device *pdev) platform_set_drvdata(pdev, s); + s->gpios = mctrl_gpio_init(&pdev->dev, 0); + ret = uart_add_one_port(&clps711x_uart, &s->port); if (ret) return ret; |