#ifdef CONFIG_SERIAL_8250_MULTIPORT
#define CONFIG_SERIAL_MULTIPORT 1
#endif
+#ifdef CONFIG_SERIAL_8250_MANY_PORTS
+#define CONFIG_SERIAL_MANY_PORTS 1
+#endif
/*
* HUB6 is always on. This will be removed once the header
* files have been cleaned.
*/
#define CONFIG_HUB6 1
-#define CONFIG_SERIAL_MANY_PORTS 1
#include <asm/serial.h>
}
}
+/**
+ * serial8250_suspend_port - suspend one serial port
+ * @line: serial line number
+ *
+ * Suspend one serial port.
+ */
+void serial8250_suspend_port(int line, u32 level)
+{
+ uart_suspend_port(&serial8250_reg, &serial8250_ports[line].port, level);
+}
+
+/**
+ * serial8250_resume_port - resume one serial port
+ * @line: serial line number
+ *
+ * Resume one serial port.
+ */
+void serial8250_resume_port(int line, u32 level)
+{
+ uart_resume_port(&serial8250_reg, &serial8250_ports[line].port, level);
+}
+
static int __init serial8250_init(void)
{
int ret, i;
EXPORT_SYMBOL(register_serial);
EXPORT_SYMBOL(unregister_serial);
EXPORT_SYMBOL(serial8250_get_irq_map);
+EXPORT_SYMBOL(serial8250_suspend_port);
+EXPORT_SYMBOL(serial8250_resume_port);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $");
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);
struct old_serial_port {
unsigned int uart;
}
}
+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);
+
+ if (priv) {
+ int i;
+
+ for (i = 0; i < priv->nr; i++)
+ serial8250_suspend_port(priv->line[i], SUSPEND_POWER_DOWN);
+ }
+ return 0;
+}
+
+static int pciserial_resume_one(struct pci_dev *dev)
+{
+ struct serial_private *priv = pci_get_drvdata(dev);
+
+ if (priv) {
+ int i;
+
+ /*
+ * Ensure that the board is correctly configured.
+ */
+ 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);
+ }
+ }
+ return 0;
+}
+
static struct pci_device_id serial_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_V3, PCI_DEVICE_ID_V3_V960,
PCI_SUBVENDOR_ID_CONNECT_TECH,
.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,
.driver = {
.devclass = &tty_devclass,