Commit dcb96e76 authored by Russell King's avatar Russell King Committed by Linus Torvalds

[SERIAL] Add sa1100 serial PM support using device model.

parent fc93ade6
......@@ -32,6 +32,7 @@
#include <linux/serial.h>
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/device.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -857,12 +858,54 @@ static struct uart_driver sa1100_reg = {
.cons = SA1100_CONSOLE,
};
static int sa1100_serial_suspend(struct device *dev, u32 state, u32 level)
{
int i;
for (i = 0; i < NR_PORTS; i++)
uart_suspend_port(&sa1100_reg, &sa1100_ports[i].port, level);
return 0;
}
static int sa1100_serial_resume(struct device *dev, u32 level)
{
int i;
for (i = 0; i < NR_PORTS; i++)
uart_resume_port(&sa1100_reg, &sa1100_ports[i].port, level);
return 0;
}
static struct device_driver sa11x0_serial_driver = {
.name = "sa11x0_serial",
.bus = &system_bus_type,
.devclass = &tty_devclass,
.suspend = sa1100_serial_suspend,
.resume = sa1100_serial_resume,
};
/*
* This "device" covers _all_ ISA 8250-compatible serial devices.
*/
static struct sys_device sa11x0_serial_devs = {
.name = "sa11x0_serial",
.id = 0,
.dev = {
.driver = &sa11x0_serial_driver,
},
};
static int __init sa1100_serial_init(void)
{
int ret;
printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.50 $\n");
driver_register(&sa11x0_serial_driver);
sys_device_register(&sa11x0_serial_devs);
sa1100_init_ports();
ret = uart_register_driver(&sa1100_reg);
if (ret == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment