aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/of_serial.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 06:52:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-08 06:52:11 -0400
commit683a52a10148e929fb4844f9237f059a47c0b01b (patch)
treea64af13ef46a08ff12d1974725cd70d768750fb6 /drivers/tty/serial/of_serial.c
parentb9af5643fdc5365a23f9752a1181fef374425217 (diff)
parent69784fa539efa477f39b5a849c27d5e630e0db27 (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/of_serial.c')
-rw-r--r--drivers/tty/serial/of_serial.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c
index 68d4455f3cf9..8bc2563335ae 100644
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -183,10 +183,6 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
183 "auto-flow-control")) 183 "auto-flow-control"))
184 port8250.capabilities |= UART_CAP_AFE; 184 port8250.capabilities |= UART_CAP_AFE;
185 185
186 if (of_property_read_bool(ofdev->dev.of_node,
187 "has-hw-flow-control"))
188 port8250.port.flags |= UPF_HARD_FLOW;
189
190 ret = serial8250_register_8250_port(&port8250); 186 ret = serial8250_register_8250_port(&port8250);
191 break; 187 break;
192 } 188 }
@@ -244,6 +240,32 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
244 return 0; 240 return 0;
245} 241}
246 242
243#ifdef CONFIG_PM_SLEEP
244static int of_serial_suspend(struct device *dev)
245{
246 struct of_serial_info *info = dev_get_drvdata(dev);
247
248 serial8250_suspend_port(info->line);
249 if (info->clk)
250 clk_disable_unprepare(info->clk);
251
252 return 0;
253}
254
255static int of_serial_resume(struct device *dev)
256{
257 struct of_serial_info *info = dev_get_drvdata(dev);
258
259 if (info->clk)
260 clk_prepare_enable(info->clk);
261
262 serial8250_resume_port(info->line);
263
264 return 0;
265}
266#endif
267static SIMPLE_DEV_PM_OPS(of_serial_pm_ops, of_serial_suspend, of_serial_resume);
268
247/* 269/*
248 * A few common types, add more as needed. 270 * A few common types, add more as needed.
249 */ 271 */
@@ -275,6 +297,7 @@ static struct platform_driver of_platform_serial_driver = {
275 .name = "of_serial", 297 .name = "of_serial",
276 .owner = THIS_MODULE, 298 .owner = THIS_MODULE,
277 .of_match_table = of_platform_serial_table, 299 .of_match_table = of_platform_serial_table,
300 .pm = &of_serial_pm_ops,
278 }, 301 },
279 .probe = of_platform_serial_probe, 302 .probe = of_platform_serial_probe,
280 .remove = of_platform_serial_remove, 303 .remove = of_platform_serial_remove,