Skip to content

Commit

Permalink
Partially revert "serial: sh-sci: console Runtime PM support"
Browse files Browse the repository at this point in the history
This partially reverts commit 1ba7622 (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
(73c3d53 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>
  • Loading branch information
Shinya Kuribayashi authored and Greg Kroah-Hartman committed Nov 16, 2012
1 parent 8807ec6 commit 00cadbf
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ struct sci_port {
#endif

struct notifier_block freq_transition;

#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
unsigned short saved_smr;
unsigned short saved_fcr;
unsigned char saved_brr;
#endif
};

/* Function prototypes */
Expand Down Expand Up @@ -2248,8 +2242,7 @@ static int __devinit serial_console_setup(struct console *co, char *options)
if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);

sci_port_disable(sci_port);

/* TODO: disable clock */
return uart_set_options(port, co, baud, parity, bits, flow);
}

Expand Down Expand Up @@ -2292,46 +2285,6 @@ static int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
return 0;
}

#define uart_console(port) ((port)->cons->index == (port)->line)

static int sci_runtime_suspend(struct device *dev)
{
struct sci_port *sci_port = dev_get_drvdata(dev);
struct uart_port *port = &sci_port->port;

if (uart_console(port)) {
struct plat_sci_reg *reg;

sci_port->saved_smr = serial_port_in(port, SCSMR);
sci_port->saved_brr = serial_port_in(port, SCBRR);

reg = sci_getreg(port, SCFCR);
if (reg->size)
sci_port->saved_fcr = serial_port_in(port, SCFCR);
else
sci_port->saved_fcr = 0;
}
return 0;
}

static int sci_runtime_resume(struct device *dev)
{
struct sci_port *sci_port = dev_get_drvdata(dev);
struct uart_port *port = &sci_port->port;

if (uart_console(port)) {
sci_reset(port);
serial_port_out(port, SCSMR, sci_port->saved_smr);
serial_port_out(port, SCBRR, sci_port->saved_brr);

if (sci_port->saved_fcr)
serial_port_out(port, SCFCR, sci_port->saved_fcr);

serial_port_out(port, SCSCR, sci_port->cfg->scscr);
}
return 0;
}

#define SCI_CONSOLE (&serial_console)

#else
Expand All @@ -2341,8 +2294,6 @@ static inline int __devinit sci_probe_earlyprintk(struct platform_device *pdev)
}

#define SCI_CONSOLE NULL
#define sci_runtime_suspend NULL
#define sci_runtime_resume NULL

#endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */

Expand Down Expand Up @@ -2460,8 +2411,6 @@ static int sci_resume(struct device *dev)
}

static const struct dev_pm_ops sci_dev_pm_ops = {
.runtime_suspend = sci_runtime_suspend,
.runtime_resume = sci_runtime_resume,
.suspend = sci_suspend,
.resume = sci_resume,
};
Expand Down

0 comments on commit 00cadbf

Please sign in to comment.