aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>2012-11-15 20:51:24 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 21:02:36 -0500
commit00cadbfd1e73fb9951da7d2358c39b561c017ea3 (patch)
tree3cbad8d7f74a7a56a329fbb947f622b9674ca46f /drivers/tty
parent8807ec6c707802cabadc0fe1b035ffefa27f1719 (diff)
Partially revert "serial: sh-sci: console Runtime PM support"
This partially reverts commit 1ba7622094 (serial: sh-sci: console Runtime PM support, from Magnus Damm <damm@opensource.se>, 2011-08-03). The generic 'serial_core' can take care of console PM maintenance, so all (or at least the first thing) we have to do to get console PM work properly, is to implement uart_ops ->pm() operation in the sh-sci serial client driver. This patch partially reverts the commit above, but leaving sci_reset() change in place, because sci_reset() is already part of another commit (73c3d53f38 serial: sh-sci: Avoid FIFO clear for MCE toggle.). A revised version of console PM support follows next. Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/sh-sci.c53
1 files changed, 1 insertions, 52 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index fcac1360c783..602d0781c6c8 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -99,12 +99,6 @@ struct sci_port {
99#endif 99#endif
100 100
101 struct notifier_block freq_transition; 101 struct notifier_block freq_transition;
102
103#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
104 unsigned short saved_smr;
105 unsigned short saved_fcr;
106 unsigned char saved_brr;
107#endif
108}; 102};
109 103
110/* Function prototypes */ 104/* Function prototypes */
@@ -2248,8 +2242,7 @@ static int __devinit serial_console_setup(struct console *co, char *options)
2248 if (options) 2242 if (options)
2249 uart_parse_options(options, &baud, &parity, &bits, &flow); 2243 uart_parse_options(options, &baud, &parity, &bits, &flow);
2250 2244
2251 sci_port_disable(sci_port); 2245 /* TODO: disable clock */
2252
2253 return uart_set_options(port, co, baud, parity, bits, flow); 2246 return uart_set_options(port, co, baud, parity, bits, flow);
2254} 2247}
2255 2248
@@ -2292,46 +2285,6 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
2292 return 0; 2285 return 0;
2293} 2286}
2294 2287
2295#define uart_console(port) ((port)->cons->index == (port)->line)
2296
2297static int sci_runtime_suspend(struct device *dev)
2298{
2299 struct sci_port *sci_port = dev_get_drvdata(dev);
2300 struct uart_port *port = &sci_port->port;
2301
2302 if (uart_console(port)) {
2303 struct plat_sci_reg *reg;
2304
2305 sci_port->saved_smr = serial_port_in(port, SCSMR);
2306 sci_port->saved_brr = serial_port_in(port, SCBRR);
2307
2308 reg = sci_getreg(port, SCFCR);
2309 if (reg->size)
2310 sci_port->saved_fcr = serial_port_in(port, SCFCR);
2311 else
2312 sci_port->saved_fcr = 0;
2313 }
2314 return 0;
2315}
2316
2317static int sci_runtime_resume(struct device *dev)
2318{
2319 struct sci_port *sci_port = dev_get_drvdata(dev);
2320 struct uart_port *port = &sci_port->port;
2321
2322 if (uart_console(port)) {
2323 sci_reset(port);
2324 serial_port_out(port, SCSMR, sci_port->saved_smr);
2325 serial_port_out(port, SCBRR, sci_port->saved_brr);
2326
2327 if (sci_port->saved_fcr)
2328 serial_port_out(port, SCFCR, sci_port->saved_fcr);
2329
2330 serial_port_out(port, SCSCR, sci_port->cfg->scscr);
2331 }
2332 return 0;
2333}
2334
2335#define SCI_CONSOLE (&serial_console) 2288#define SCI_CONSOLE (&serial_console)
2336 2289
2337#else 2290#else
@@ -2341,8 +2294,6 @@ static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
2341} 2294}
2342 2295
2343#define SCI_CONSOLE NULL 2296#define SCI_CONSOLE NULL
2344#define sci_runtime_suspend NULL
2345#define sci_runtime_resume NULL
2346 2297
2347#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ 2298#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
2348 2299
@@ -2460,8 +2411,6 @@ static int sci_resume(struct device *dev)
2460} 2411}
2461 2412
2462static const struct dev_pm_ops sci_dev_pm_ops = { 2413static const struct dev_pm_ops sci_dev_pm_ops = {
2463 .runtime_suspend = sci_runtime_suspend,
2464 .runtime_resume = sci_runtime_resume,
2465 .suspend = sci_suspend, 2414 .suspend = sci_suspend,
2466 .resume = sci_resume, 2415 .resume = sci_resume,
2467}; 2416};