From 3105b8a08fd6f31e97f9ebc3236eb37937b51e33 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 24 Aug 2003 18:39:44 +0100 Subject: [SERIAL] Add new port numbers. This adds the new port numbers which are in use in MAC and PARISC trees (so other people know they're taken.) --- include/linux/serial_core.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a7cb796c4deb..0bc15aeb153e 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -67,6 +67,15 @@ #define PORT_PC9861 45 #define PORT_PC9801_101 46 +/* DZ */ +#define PORT_DZ 47 + +/* Parisc type numbers. */ +#define PORT_MUX 48 + +/* Macintosh Zilog type numbers */ +#define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ +#define PORT_PMAC_ZILOG 51 #ifdef __KERNEL__ -- cgit v1.2.3 From d5a45662a10e72d0efdfc6014b9a06de5e146345 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 9 Sep 2003 15:15:57 +0100 Subject: [SERIAL] Drop "level" argument from serial PM calls. Since the driver model has transitioned away from using multi-level device suspend/resume, we also drop the multi-level support from the serial layer. Update the 8250 and sa1100 drivers for this change. --- drivers/serial/8250.c | 8 ++-- drivers/serial/8250.h | 4 +- drivers/serial/8250_pci.c | 22 ++--------- drivers/serial/sa1100.c | 8 ++-- drivers/serial/serial_core.c | 94 +++++++++++++++++++------------------------- include/linux/serial_core.h | 4 +- 6 files changed, 56 insertions(+), 84 deletions(-) (limited to 'include') diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index ba16a21a7a05..5a722a5bd8fc 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2101,9 +2101,9 @@ void serial8250_get_irq_map(unsigned int *map) * * Suspend one serial port. */ -void serial8250_suspend_port(int line, u32 level) +void serial8250_suspend_port(int line) { - uart_suspend_port(&serial8250_reg, &serial8250_ports[line].port, level); + uart_suspend_port(&serial8250_reg, &serial8250_ports[line].port); } /** @@ -2112,9 +2112,9 @@ void serial8250_suspend_port(int line, u32 level) * * Resume one serial port. */ -void serial8250_resume_port(int line, u32 level) +void serial8250_resume_port(int line) { - uart_resume_port(&serial8250_reg, &serial8250_ports[line].port, level); + uart_resume_port(&serial8250_reg, &serial8250_ports[line].port); } static int __init serial8250_init(void) diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index cc206f9476ac..91ced9bdb3be 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h @@ -27,8 +27,8 @@ struct serial8250_probe { int serial8250_register_probe(struct serial8250_probe *probe); void serial8250_unregister_probe(struct serial8250_probe *probe); void serial8250_get_irq_map(unsigned int *map); -void serial8250_suspend_port(int line, u32 level); -void serial8250_resume_port(int line, u32 level); +void serial8250_suspend_port(int line); +void serial8250_resume_port(int line); struct old_serial_port { unsigned int uart; diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index dc90cc477844..778cd1eea5ba 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c @@ -1600,19 +1600,6 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev) } } -static int pciserial_save_state_one(struct pci_dev *dev, u32 state) -{ - struct serial_private *priv = pci_get_drvdata(dev); - - if (priv) { - int i; - - for (i = 0; i < priv->nr; i++) - serial8250_suspend_port(priv->line[i], SUSPEND_SAVE_STATE); - } - return 0; -} - static int pciserial_suspend_one(struct pci_dev *dev, u32 state) { struct serial_private *priv = pci_get_drvdata(dev); @@ -1621,7 +1608,7 @@ static int pciserial_suspend_one(struct pci_dev *dev, u32 state) int i; for (i = 0; i < priv->nr; i++) - serial8250_suspend_port(priv->line[i], SUSPEND_POWER_DOWN); + serial8250_suspend_port(priv->line[i]); } return 0; } @@ -1639,10 +1626,8 @@ static int pciserial_resume_one(struct pci_dev *dev) if (priv->quirk->init) priv->quirk->init(dev); - for (i = 0; i < priv->nr; i++) { - serial8250_resume_port(priv->line[i], RESUME_POWER_ON); - serial8250_resume_port(priv->line[i], RESUME_RESTORE_STATE); - } + for (i = 0; i < priv->nr; i++) + serial8250_resume_port(priv->line[i]); } return 0; } @@ -2040,7 +2025,6 @@ static struct pci_driver serial_pci_driver = { .name = "serial", .probe = pciserial_init_one, .remove = __devexit_p(pciserial_remove_one), - .save_state = pciserial_save_state_one, .suspend = pciserial_suspend_one, .resume = pciserial_resume_one, .id_table = serial_pci_tbl, diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 8ded3cf74f28..51b191307bad 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c @@ -862,8 +862,8 @@ static int sa1100_serial_suspend(struct device *_dev, u32 state, u32 level) { struct sa1100_port *sport = dev_get_drvdata(_dev); - if (sport) - uart_suspend_port(&sa1100_reg, &sport->port, level); + if (sport && level == SUSPEND_DISABLE) + uart_suspend_port(&sa1100_reg, &sport->port); return 0; } @@ -872,8 +872,8 @@ static int sa1100_serial_resume(struct device *_dev, u32 level) { struct sa1100_port *sport = dev_get_drvdata(_dev); - if (sport) - uart_resume_port(&sa1100_reg, &sport->port, level); + if (sport && level == RESUME_ENABLE) + uart_resume_port(&sa1100_reg, &sport->port); return 0; } diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index a264d72ca695..064b9631201f 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1875,84 +1875,72 @@ static void uart_change_pm(struct uart_state *state, int pm_state) state->pm_state = pm_state; } -int uart_suspend_port(struct uart_driver *drv, struct uart_port *port, u32 level) +int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) { struct uart_state *state = drv->state + port->line; down(&state->sem); - switch (level) { - case SUSPEND_SAVE_STATE: - if (state->info && state->info->flags & UIF_INITIALIZED) { - struct uart_ops *ops = port->ops; + if (state->info && state->info->flags & UIF_INITIALIZED) { + struct uart_ops *ops = port->ops; - spin_lock_irq(&port->lock); - ops->stop_tx(port, 0); - ops->set_mctrl(port, 0); - ops->stop_rx(port); - spin_unlock_irq(&port->lock); - - /* - * Wait for the transmitter to empty. - */ - while (!ops->tx_empty(port)) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(10*HZ/1000); - } - set_current_state(TASK_RUNNING); - - ops->shutdown(port); - } - break; + spin_lock_irq(&port->lock); + ops->stop_tx(port, 0); + ops->set_mctrl(port, 0); + ops->stop_rx(port); + spin_unlock_irq(&port->lock); - case SUSPEND_POWER_DOWN: /* - * Disable the console device before suspending. + * Wait for the transmitter to empty. */ - if (uart_console(port)) - port->cons->flags &= ~CON_ENABLED; + while (!ops->tx_empty(port)) { + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(10*HZ/1000); + } + set_current_state(TASK_RUNNING); - uart_change_pm(state, 3); - break; + ops->shutdown(port); } + /* + * Disable the console device before suspending. + */ + if (uart_console(port)) + port->cons->flags &= ~CON_ENABLED; + + uart_change_pm(state, 3); + up(&state->sem); return 0; } -int uart_resume_port(struct uart_driver *drv, struct uart_port *port, u32 level) +int uart_resume_port(struct uart_driver *drv, struct uart_port *port) { struct uart_state *state = drv->state + port->line; down(&state->sem); - switch (level) { - case RESUME_POWER_ON: - uart_change_pm(state, 0); + uart_change_pm(state, 0); - /* - * Re-enable the console device after suspending. - */ - if (uart_console(port)) { - uart_change_speed(state, NULL); - port->cons->flags |= CON_ENABLED; - } - break; + /* + * Re-enable the console device after suspending. + */ + if (uart_console(port)) { + uart_change_speed(state, NULL); + port->cons->flags |= CON_ENABLED; + } - case RESUME_RESTORE_STATE: - if (state->info && state->info->flags & UIF_INITIALIZED) { - struct uart_ops *ops = port->ops; + if (state->info && state->info->flags & UIF_INITIALIZED) { + struct uart_ops *ops = port->ops; - ops->set_mctrl(port, 0); - ops->startup(port); - uart_change_speed(state, NULL); - spin_lock_irq(&port->lock); - ops->set_mctrl(port, port->mctrl); - ops->start_tx(port, 0); - spin_unlock_irq(&port->lock); - } - break; + ops->set_mctrl(port, 0); + ops->startup(port); + uart_change_speed(state, NULL); + spin_lock_irq(&port->lock); + ops->set_mctrl(port, port->mctrl); + ops->start_tx(port, 0); + spin_unlock_irq(&port->lock); } up(&state->sem); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 0bc15aeb153e..8e09c20be413 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -325,8 +325,8 @@ int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); /* * Power Management */ -int uart_suspend_port(struct uart_driver *reg, struct uart_port *port, u32 level); -int uart_resume_port(struct uart_driver *reg, struct uart_port *port, u32 level); +int uart_suspend_port(struct uart_driver *reg, struct uart_port *port); +int uart_resume_port(struct uart_driver *reg, struct uart_port *port); #define uart_circ_empty(circ) ((circ)->head == (circ)->tail) #define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0) -- cgit v1.2.3