summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@googlemail.com>2010-09-25 15:13:45 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:20:09 -0700
commitc161afe9759ddcc174d08e7c4f683d08ac9ba86f (patch)
tree288e3f33efe083f7a243dee092f30df6375d5677 /drivers/serial
parent70eebd0b604989705f46697814e48fb4ea1d1bb9 (diff)
8250: allow platforms to override PM hook.
Add a hook for platforms to specify custom pm methods. Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index b586406f04ca..6994afb5571a 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -154,12 +154,6 @@ struct uart_8250_port {
unsigned char lsr_saved_flags;
#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA
unsigned char msr_saved_flags;
-
- /*
- * We provide a per-port pm hook.
- */
- void (*pm)(struct uart_port *port,
- unsigned int state, unsigned int old);
};
struct irq_info {
@@ -2436,16 +2430,24 @@ serial8250_set_ldisc(struct uart_port *port, int new)
port->flags &= ~UPF_HARDPPS_CD;
}
-static void
-serial8250_pm(struct uart_port *port, unsigned int state,
- unsigned int oldstate)
+
+void serial8250_do_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
{
struct uart_8250_port *p = (struct uart_8250_port *)port;
serial8250_set_sleep(p, state != 0);
+}
+EXPORT_SYMBOL(serial8250_do_pm);
- if (p->pm)
- p->pm(port, state, oldstate);
+static void
+serial8250_pm(struct uart_port *port, unsigned int state,
+ unsigned int oldstate)
+{
+ if (port->pm)
+ port->pm(port, state, oldstate);
+ else
+ serial8250_do_pm(port, state, oldstate);
}
static unsigned int serial8250_port_size(struct uart_8250_port *pt)
@@ -3006,6 +3008,7 @@ static int __devinit serial8250_probe(struct platform_device *dev)
port.serial_in = p->serial_in;
port.serial_out = p->serial_out;
port.set_termios = p->set_termios;
+ port.pm = p->pm;
port.dev = &dev->dev;
port.irqflags |= irqflag;
ret = serial8250_register_port(&port);
@@ -3172,6 +3175,8 @@ int serial8250_register_port(struct uart_port *port)
/* Possibly override set_termios call */
if (port->set_termios)
uart->port.set_termios = port->set_termios;
+ if (port->pm)
+ uart->port.pm = port->pm;
ret = uart_add_one_port(&serial8250_reg, &uart->port);
if (ret == 0)