2 * resume.c - Functions for waking devices up.
4 * Copyright (c) 2003 Patrick Mochel
5 * Copyright (c) 2003 Open Source Development Labs
7 * This file is released under the GPLv2
11 #include <linux/device.h>
14 extern int sysdev_resume(void);
18 * resume_device - Restore state for one device.
23 int resume_device(struct device * dev)
25 if (dev->bus && dev->bus->resume)
26 return dev->bus->resume(dev);
34 while(!list_empty(&dpm_off)) {
35 struct list_head * entry = dpm_off.next;
36 struct device * dev = to_device(entry);
39 if (!dev->power.prev_state)
42 list_add_tail(entry,&dpm_active);
48 * device_resume - Restore state of each device in system.
50 * Walk the dpm_off list, remove each entry, resume the device,
51 * then add it to the dpm_active list.
54 void device_resume(void)
61 EXPORT_SYMBOL(device_resume);
65 * device_power_up_irq - Power on some devices.
67 * Walk the dpm_off_irq list and power each device up. This
68 * is used for devices that required they be powered down with
69 * interrupts disabled. As devices are powered on, they are moved to
70 * the dpm_suspended list.
72 * Interrupts must be disabled when calling this.
75 void dpm_power_up(void)
77 while(!list_empty(&dpm_off_irq)) {
78 struct list_head * entry = dpm_off_irq.next;
80 resume_device(to_device(entry));
81 list_add_tail(entry,&dpm_active);
87 * device_pm_power_up - Turn on all devices that need special attention.
89 * Power on system devices then devices that required we shut them down
90 * with interrupts disabled.
91 * Called with interrupts disabled.
94 void device_power_up(void)
100 EXPORT_SYMBOL(device_power_up);