Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213520
b: refs/heads/master
c: c161afe
h: refs/heads/master
v: v3
  • Loading branch information
Manuel Lauss authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 43d88c3 commit b8a3e5a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70eebd0b604989705f46697814e48fb4ea1d1bb9
refs/heads/master: c161afe9759ddcc174d08e7c4f683d08ac9ba86f
27 changes: 16 additions & 11 deletions trunk/drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/serial_8250.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ struct plat_serial8250_port {
void (*set_termios)(struct uart_port *,
struct ktermios *new,
struct ktermios *old);
void (*pm)(struct uart_port *, unsigned int state,
unsigned old);
};

/*
Expand Down Expand Up @@ -76,5 +78,7 @@ extern int serial8250_find_port_for_earlycon(void);
extern int setup_early_serial8250_console(char *cmdline);
extern void serial8250_do_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *old);
extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate);

#endif
2 changes: 2 additions & 0 deletions trunk/include/linux/serial_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ struct uart_port {
void (*set_termios)(struct uart_port *,
struct ktermios *new,
struct ktermios *old);
void (*pm)(struct uart_port *, unsigned int state,
unsigned int old);
unsigned int irq; /* irq number */
unsigned long irqflags; /* irq flags */
unsigned int uartclk; /* base uart clock */
Expand Down

0 comments on commit b8a3e5a

Please sign in to comment.