mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
Merge tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki: - ACPI conversion to PM handling based on struct dev_pm_ops. - Conversion of a number of platform drivers to PM handling based on struct dev_pm_ops and removal of empty legacy PM callbacks from a couple of PCI drivers. - Suspend-to-both for in-kernel hibernation from Bojan Smojver. - cpuidle fixes and cleanups from ShuoX Liu, Daniel Lezcano and Preeti Murthy. - cpufreq bug fixes from Jonghwa Lee and Stephen Boyd. - Suspend and hibernate fixes from Srivatsa Bhat and Colin Cross. - Generic PM domains framework updates. - RTC CMOS wakeup signaling update from Paul Fox. - sparse warnings fixes from Sachin Kamat. - Build warnings fixes for the generic PM domains framework and PM sysfs code. - sysfs switch for printing device suspend times from Sameer Nanda. - Documentation fix from Oskar Schirmer. * tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (70 commits) cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch EXYNOS: bugfix on retrieving old_index from freqs.old PM / Sleep: call early resume handlers when suspend_noirq fails PM / QoS: Use NULL pointer instead of plain integer in qos.c PM / QoS: Use NULL pointer instead of plain integer in pm_qos.h PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock PM / Sleep: Add missing static storage class specifiers in main.c cpuilde / ACPI: remove time from acpi_processor_cx structure cpuidle / ACPI: remove usage from acpi_processor_cx structure cpuidle / ACPI : remove latency_ticks from acpi_processor_cx structure rtc-cmos: report wakeups from interrupt handler PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset olpc-xo15-sci: Use struct dev_pm_ops for power management PM / Domains: Replace plain integer with NULL pointer in domain.c file PM / Domains: Add missing static storage class specifier in domain.c file PM / crypto / ux500: Use struct dev_pm_ops for power management PM / IPMI: Remove empty legacy PCI PM callbacks tpm_nsc: Use struct dev_pm_ops for power management tpm_tis: Use struct dev_pm_ops for power management ...
This commit is contained in:
@@ -231,3 +231,16 @@ Description:
|
||||
Reads from this file return a string consisting of the names of
|
||||
wakeup sources created with the help of /sys/power/wake_lock
|
||||
that are inactive at the moment, separated with spaces.
|
||||
|
||||
What: /sys/power/pm_print_times
|
||||
Date: May 2012
|
||||
Contact: Sameer Nanda <snanda@chromium.org>
|
||||
Description:
|
||||
The /sys/power/pm_print_times file allows user space to
|
||||
control whether the time taken by devices to suspend and
|
||||
resume is printed. These prints are useful for hunting down
|
||||
devices that take too long to suspend or resume.
|
||||
|
||||
Writing a "1" enables this printing while writing a "0"
|
||||
disables it. The default value is "0". Reading from this file
|
||||
will display the current value.
|
||||
|
||||
@@ -583,9 +583,10 @@ for the given device during all power transitions, instead of the respective
|
||||
subsystem-level callbacks. Specifically, if a device's pm_domain pointer is
|
||||
not NULL, the ->suspend() callback from the object pointed to by it will be
|
||||
executed instead of its subsystem's (e.g. bus type's) ->suspend() callback and
|
||||
anlogously for all of the remaining callbacks. In other words, power management
|
||||
domain callbacks, if defined for the given device, always take precedence over
|
||||
the callbacks provided by the device's subsystem (e.g. bus type).
|
||||
analogously for all of the remaining callbacks. In other words, power
|
||||
management domain callbacks, if defined for the given device, always take
|
||||
precedence over the callbacks provided by the device's subsystem (e.g. bus
|
||||
type).
|
||||
|
||||
The support for device power management domains is only relevant to platforms
|
||||
needing to use the same device driver power management callbacks in many
|
||||
@@ -598,7 +599,7 @@ it into account in any way.
|
||||
Device Low Power (suspend) States
|
||||
---------------------------------
|
||||
Device low-power states aren't standard. One device might only handle
|
||||
"on" and "off, while another might support a dozen different versions of
|
||||
"on" and "off", while another might support a dozen different versions of
|
||||
"on" (how many engines are active?), plus a state that gets back to "on"
|
||||
faster than from a full "off".
|
||||
|
||||
|
||||
@@ -33,6 +33,11 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state
|
||||
|
||||
echo platform > /sys/power/disk; echo disk > /sys/power/state
|
||||
|
||||
. If you would like to write hibernation image to swap and then suspend
|
||||
to RAM (provided your platform supports it), you can try
|
||||
|
||||
echo suspend > /sys/power/disk; echo disk > /sys/power/state
|
||||
|
||||
. If you have SATA disks, you'll need recent kernels with SATA suspend
|
||||
support. For suspend and resume to work, make sure your disk drivers
|
||||
are built into kernel -- not modules. [There's way to make
|
||||
|
||||
@@ -203,7 +203,7 @@ static int xo15_sci_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int xo15_sci_resume(struct acpi_device *device)
|
||||
static int xo15_sci_resume(struct device *dev)
|
||||
{
|
||||
/* Enable all EC events */
|
||||
olpc_ec_mask_write(EC_SCI_SRC_ALL);
|
||||
@@ -215,6 +215,8 @@ static int xo15_sci_resume(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(xo15_sci_pm, NULL, xo15_sci_resume);
|
||||
|
||||
static const struct acpi_device_id xo15_sci_device_ids[] = {
|
||||
{"XO15EC", 0},
|
||||
{"", 0},
|
||||
@@ -227,8 +229,8 @@ static struct acpi_driver xo15_sci_drv = {
|
||||
.ops = {
|
||||
.add = xo15_sci_add,
|
||||
.remove = xo15_sci_remove,
|
||||
.resume = xo15_sci_resume,
|
||||
},
|
||||
.drv.pm = &xo15_sci_pm,
|
||||
};
|
||||
|
||||
static int __init xo15_sci_init(void)
|
||||
|
||||
+12
-5
@@ -61,7 +61,6 @@ static int acpi_ac_open_fs(struct inode *inode, struct file *file);
|
||||
|
||||
static int acpi_ac_add(struct acpi_device *device);
|
||||
static int acpi_ac_remove(struct acpi_device *device, int type);
|
||||
static int acpi_ac_resume(struct acpi_device *device);
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id ac_device_ids[] = {
|
||||
@@ -70,6 +69,9 @@ static const struct acpi_device_id ac_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, ac_device_ids);
|
||||
|
||||
static int acpi_ac_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
|
||||
|
||||
static struct acpi_driver acpi_ac_driver = {
|
||||
.name = "ac",
|
||||
.class = ACPI_AC_CLASS,
|
||||
@@ -78,9 +80,9 @@ static struct acpi_driver acpi_ac_driver = {
|
||||
.ops = {
|
||||
.add = acpi_ac_add,
|
||||
.remove = acpi_ac_remove,
|
||||
.resume = acpi_ac_resume,
|
||||
.notify = acpi_ac_notify,
|
||||
},
|
||||
.drv.pm = &acpi_ac_pm,
|
||||
};
|
||||
|
||||
struct acpi_ac {
|
||||
@@ -309,13 +311,18 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
return result;
|
||||
}
|
||||
|
||||
static int acpi_ac_resume(struct acpi_device *device)
|
||||
static int acpi_ac_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_ac *ac;
|
||||
unsigned old_state;
|
||||
if (!device || !acpi_driver_data(device))
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
ac = acpi_driver_data(device);
|
||||
|
||||
ac = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!ac)
|
||||
return -EINVAL;
|
||||
|
||||
old_state = ac->state;
|
||||
if (acpi_ac_get_state(ac))
|
||||
return 0;
|
||||
|
||||
+11
-4
@@ -1044,17 +1044,24 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
|
||||
}
|
||||
|
||||
/* this is needed to learn about changes made in suspended state */
|
||||
static int acpi_battery_resume(struct acpi_device *device)
|
||||
static int acpi_battery_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_battery *battery;
|
||||
if (!device)
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
battery = acpi_driver_data(device);
|
||||
|
||||
battery = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!battery)
|
||||
return -EINVAL;
|
||||
|
||||
battery->update_time = 0;
|
||||
acpi_battery_update(battery);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume);
|
||||
|
||||
static struct acpi_driver acpi_battery_driver = {
|
||||
.name = "battery",
|
||||
.class = ACPI_BATTERY_CLASS,
|
||||
@@ -1062,10 +1069,10 @@ static struct acpi_driver acpi_battery_driver = {
|
||||
.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
|
||||
.ops = {
|
||||
.add = acpi_battery_add,
|
||||
.resume = acpi_battery_resume,
|
||||
.remove = acpi_battery_remove,
|
||||
.notify = acpi_battery_notify,
|
||||
},
|
||||
.drv.pm = &acpi_battery_pm,
|
||||
};
|
||||
|
||||
static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
|
||||
|
||||
@@ -76,19 +76,21 @@ MODULE_DEVICE_TABLE(acpi, button_device_ids);
|
||||
|
||||
static int acpi_button_add(struct acpi_device *device);
|
||||
static int acpi_button_remove(struct acpi_device *device, int type);
|
||||
static int acpi_button_resume(struct acpi_device *device);
|
||||
static void acpi_button_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static int acpi_button_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume);
|
||||
|
||||
static struct acpi_driver acpi_button_driver = {
|
||||
.name = "button",
|
||||
.class = ACPI_BUTTON_CLASS,
|
||||
.ids = button_device_ids,
|
||||
.ops = {
|
||||
.add = acpi_button_add,
|
||||
.resume = acpi_button_resume,
|
||||
.remove = acpi_button_remove,
|
||||
.notify = acpi_button_notify,
|
||||
},
|
||||
.drv.pm = &acpi_button_pm,
|
||||
};
|
||||
|
||||
struct acpi_button {
|
||||
@@ -308,8 +310,9 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
|
||||
}
|
||||
}
|
||||
|
||||
static int acpi_button_resume(struct acpi_device *device)
|
||||
static int acpi_button_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_device *device = to_acpi_device(dev);
|
||||
struct acpi_button *button = acpi_driver_data(device);
|
||||
|
||||
if (button->type == ACPI_BUTTON_TYPE_LID)
|
||||
|
||||
+11
-10
@@ -46,8 +46,6 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
static int acpi_fan_add(struct acpi_device *device);
|
||||
static int acpi_fan_remove(struct acpi_device *device, int type);
|
||||
static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
|
||||
static int acpi_fan_resume(struct acpi_device *device);
|
||||
|
||||
static const struct acpi_device_id fan_device_ids[] = {
|
||||
{"PNP0C0B", 0},
|
||||
@@ -55,6 +53,10 @@ static const struct acpi_device_id fan_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, fan_device_ids);
|
||||
|
||||
static int acpi_fan_suspend(struct device *dev);
|
||||
static int acpi_fan_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume);
|
||||
|
||||
static struct acpi_driver acpi_fan_driver = {
|
||||
.name = "fan",
|
||||
.class = ACPI_FAN_CLASS,
|
||||
@@ -62,9 +64,8 @@ static struct acpi_driver acpi_fan_driver = {
|
||||
.ops = {
|
||||
.add = acpi_fan_add,
|
||||
.remove = acpi_fan_remove,
|
||||
.suspend = acpi_fan_suspend,
|
||||
.resume = acpi_fan_resume,
|
||||
},
|
||||
.drv.pm = &acpi_fan_pm,
|
||||
};
|
||||
|
||||
/* thermal cooling device callbacks */
|
||||
@@ -183,24 +184,24 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
|
||||
static int acpi_fan_suspend(struct device *dev)
|
||||
{
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
acpi_bus_set_power(device->handle, ACPI_STATE_D0);
|
||||
acpi_bus_set_power(to_acpi_device(dev)->handle, ACPI_STATE_D0);
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static int acpi_fan_resume(struct acpi_device *device)
|
||||
static int acpi_fan_resume(struct device *dev)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
result = acpi_bus_update_power(device->handle, NULL);
|
||||
result = acpi_bus_update_power(to_acpi_device(dev)->handle, NULL);
|
||||
if (result)
|
||||
printk(KERN_ERR PREFIX "Error updating fan power state\n");
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ ACPI_MODULE_NAME("power");
|
||||
|
||||
static int acpi_power_add(struct acpi_device *device);
|
||||
static int acpi_power_remove(struct acpi_device *device, int type);
|
||||
static int acpi_power_resume(struct acpi_device *device);
|
||||
|
||||
static const struct acpi_device_id power_device_ids[] = {
|
||||
{ACPI_POWER_HID, 0},
|
||||
@@ -68,6 +67,9 @@ static const struct acpi_device_id power_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, power_device_ids);
|
||||
|
||||
static int acpi_power_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_power_pm, NULL, acpi_power_resume);
|
||||
|
||||
static struct acpi_driver acpi_power_driver = {
|
||||
.name = "power",
|
||||
.class = ACPI_POWER_CLASS,
|
||||
@@ -75,8 +77,8 @@ static struct acpi_driver acpi_power_driver = {
|
||||
.ops = {
|
||||
.add = acpi_power_add,
|
||||
.remove = acpi_power_remove,
|
||||
.resume = acpi_power_resume,
|
||||
},
|
||||
.drv.pm = &acpi_power_pm,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -771,14 +773,16 @@ static int acpi_power_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_power_resume(struct acpi_device *device)
|
||||
static int acpi_power_resume(struct device *dev)
|
||||
{
|
||||
int result = 0, state;
|
||||
struct acpi_device *device;
|
||||
struct acpi_power_resource *resource;
|
||||
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
device = to_acpi_device(dev);
|
||||
resource = acpi_driver_data(device);
|
||||
if (!resource)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -93,6 +93,9 @@ static const struct acpi_device_id processor_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, processor_device_ids);
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_processor_pm,
|
||||
acpi_processor_suspend, acpi_processor_resume);
|
||||
|
||||
static struct acpi_driver acpi_processor_driver = {
|
||||
.name = "processor",
|
||||
.class = ACPI_PROCESSOR_CLASS,
|
||||
@@ -100,10 +103,9 @@ static struct acpi_driver acpi_processor_driver = {
|
||||
.ops = {
|
||||
.add = acpi_processor_add,
|
||||
.remove = acpi_processor_remove,
|
||||
.suspend = acpi_processor_suspend,
|
||||
.resume = acpi_processor_resume,
|
||||
.notify = acpi_processor_notify,
|
||||
},
|
||||
.drv.pm = &acpi_processor_pm,
|
||||
};
|
||||
|
||||
#define INSTALL_NOTIFY_HANDLER 1
|
||||
@@ -427,18 +429,11 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
|
||||
* Initialize missing things
|
||||
*/
|
||||
if (pr->flags.need_hotplug_init) {
|
||||
struct cpuidle_driver *idle_driver =
|
||||
cpuidle_get_driver();
|
||||
|
||||
printk(KERN_INFO "Will online and init hotplugged "
|
||||
"CPU: %d\n", pr->id);
|
||||
WARN(acpi_processor_start(pr), "Failed to start CPU:"
|
||||
" %d\n", pr->id);
|
||||
pr->flags.need_hotplug_init = 0;
|
||||
if (idle_driver && !strcmp(idle_driver->name,
|
||||
"intel_idle")) {
|
||||
intel_idle_cpu_init(pr->id);
|
||||
}
|
||||
/* Normal CPU soft online event */
|
||||
} else {
|
||||
acpi_processor_ppc_has_changed(pr, 0);
|
||||
|
||||
@@ -221,10 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Suspend / resume control
|
||||
*/
|
||||
static int acpi_idle_suspend;
|
||||
static u32 saved_bm_rld;
|
||||
|
||||
static void acpi_idle_bm_rld_save(void)
|
||||
@@ -241,23 +237,15 @@ static void acpi_idle_bm_rld_restore(void)
|
||||
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
|
||||
}
|
||||
|
||||
int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
|
||||
int acpi_processor_suspend(struct device *dev)
|
||||
{
|
||||
if (acpi_idle_suspend == 1)
|
||||
return 0;
|
||||
|
||||
acpi_idle_bm_rld_save();
|
||||
acpi_idle_suspend = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpi_processor_resume(struct acpi_device * device)
|
||||
int acpi_processor_resume(struct device *dev)
|
||||
{
|
||||
if (acpi_idle_suspend == 0)
|
||||
return 0;
|
||||
|
||||
acpi_idle_bm_rld_restore();
|
||||
acpi_idle_suspend = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -595,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
|
||||
*/
|
||||
cx->valid = 1;
|
||||
|
||||
cx->latency_ticks = cx->latency;
|
||||
/*
|
||||
* On older chipsets, BM_RLD needs to be set
|
||||
* in order for Bus Master activity to wake the
|
||||
@@ -628,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
|
||||
if (!cx->address)
|
||||
break;
|
||||
cx->valid = 1;
|
||||
cx->latency_ticks = cx->latency; /* Normalize latency */
|
||||
break;
|
||||
|
||||
case ACPI_STATE_C3:
|
||||
@@ -763,11 +749,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
if (acpi_idle_suspend) {
|
||||
local_irq_enable();
|
||||
cpu_relax();
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 1);
|
||||
kt1 = ktime_get_real();
|
||||
@@ -779,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,
|
||||
dev->last_residency = (int)idle_time;
|
||||
|
||||
local_irq_enable();
|
||||
cx->usage++;
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
|
||||
return index;
|
||||
@@ -838,11 +818,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
if (acpi_idle_suspend) {
|
||||
local_irq_enable();
|
||||
cpu_relax();
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
@@ -887,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
cx->usage++;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
cx->time += idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
@@ -928,8 +900,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
drv, drv->safe_state_index);
|
||||
} else {
|
||||
local_irq_disable();
|
||||
if (!acpi_idle_suspend)
|
||||
acpi_safe_halt();
|
||||
acpi_safe_halt();
|
||||
local_irq_enable();
|
||||
return -EBUSY;
|
||||
}
|
||||
@@ -937,11 +908,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
if (acpi_idle_suspend) {
|
||||
local_irq_enable();
|
||||
cpu_relax();
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH) {
|
||||
current_thread_info()->status &= ~TS_POLLING;
|
||||
@@ -1014,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
|
||||
if (cx->entry_method != ACPI_CSTATE_FFH)
|
||||
current_thread_info()->status |= TS_POLLING;
|
||||
|
||||
cx->usage++;
|
||||
|
||||
lapic_timer_state_broadcast(pr, cx, 0);
|
||||
cx->time += idle_time;
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
+6
-4
@@ -988,16 +988,18 @@ static void acpi_sbs_rmdirs(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int acpi_sbs_resume(struct acpi_device *device)
|
||||
static int acpi_sbs_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_sbs *sbs;
|
||||
if (!device)
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
sbs = device->driver_data;
|
||||
sbs = to_acpi_device(dev)->driver_data;
|
||||
acpi_sbs_callback(sbs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
|
||||
|
||||
static struct acpi_driver acpi_sbs_driver = {
|
||||
.name = "sbs",
|
||||
.class = ACPI_SBS_CLASS,
|
||||
@@ -1005,8 +1007,8 @@ static struct acpi_driver acpi_sbs_driver = {
|
||||
.ops = {
|
||||
.add = acpi_sbs_add,
|
||||
.remove = acpi_sbs_remove,
|
||||
.resume = acpi_sbs_resume,
|
||||
},
|
||||
.drv.pm = &acpi_sbs_pm,
|
||||
};
|
||||
|
||||
static int __init acpi_sbs_init(void)
|
||||
|
||||
@@ -290,26 +290,6 @@ static void acpi_device_release(struct device *dev)
|
||||
kfree(acpi_dev);
|
||||
}
|
||||
|
||||
static int acpi_device_suspend(struct device *dev, pm_message_t state)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
struct acpi_driver *acpi_drv = acpi_dev->driver;
|
||||
|
||||
if (acpi_drv && acpi_drv->ops.suspend)
|
||||
return acpi_drv->ops.suspend(acpi_dev, state);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_device_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
struct acpi_driver *acpi_drv = acpi_dev->driver;
|
||||
|
||||
if (acpi_drv && acpi_drv->ops.resume)
|
||||
return acpi_drv->ops.resume(acpi_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_bus_match(struct device *dev, struct device_driver *drv)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
@@ -441,8 +421,6 @@ static int acpi_device_remove(struct device * dev)
|
||||
|
||||
struct bus_type acpi_bus_type = {
|
||||
.name = "acpi",
|
||||
.suspend = acpi_device_suspend,
|
||||
.resume = acpi_device_resume,
|
||||
.match = acpi_bus_match,
|
||||
.probe = acpi_device_probe,
|
||||
.remove = acpi_device_remove,
|
||||
|
||||
+10
-7
@@ -98,7 +98,6 @@ MODULE_PARM_DESC(psv, "Disable or override all passive trip points.");
|
||||
|
||||
static int acpi_thermal_add(struct acpi_device *device);
|
||||
static int acpi_thermal_remove(struct acpi_device *device, int type);
|
||||
static int acpi_thermal_resume(struct acpi_device *device);
|
||||
static void acpi_thermal_notify(struct acpi_device *device, u32 event);
|
||||
|
||||
static const struct acpi_device_id thermal_device_ids[] = {
|
||||
@@ -107,6 +106,9 @@ static const struct acpi_device_id thermal_device_ids[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(acpi, thermal_device_ids);
|
||||
|
||||
static int acpi_thermal_resume(struct device *dev);
|
||||
static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume);
|
||||
|
||||
static struct acpi_driver acpi_thermal_driver = {
|
||||
.name = "thermal",
|
||||
.class = ACPI_THERMAL_CLASS,
|
||||
@@ -114,9 +116,9 @@ static struct acpi_driver acpi_thermal_driver = {
|
||||
.ops = {
|
||||
.add = acpi_thermal_add,
|
||||
.remove = acpi_thermal_remove,
|
||||
.resume = acpi_thermal_resume,
|
||||
.notify = acpi_thermal_notify,
|
||||
},
|
||||
.drv.pm = &acpi_thermal_pm,
|
||||
};
|
||||
|
||||
struct acpi_thermal_state {
|
||||
@@ -1041,16 +1043,17 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpi_thermal_resume(struct acpi_device *device)
|
||||
static int acpi_thermal_resume(struct device *dev)
|
||||
{
|
||||
struct acpi_thermal *tz = NULL;
|
||||
struct acpi_thermal *tz;
|
||||
int i, j, power_state, result;
|
||||
|
||||
|
||||
if (!device || !acpi_driver_data(device))
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
tz = acpi_driver_data(device);
|
||||
tz = acpi_driver_data(to_acpi_device(dev));
|
||||
if (!tz)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
|
||||
if (!(&tz->trips.active[i]))
|
||||
|
||||
+268
-74
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/async.h>
|
||||
#include <linux/suspend.h>
|
||||
|
||||
#include <linux/cpuidle.h>
|
||||
#include "../base.h"
|
||||
#include "power.h"
|
||||
|
||||
@@ -45,10 +45,10 @@ typedef int (*pm_callback_t)(struct device *);
|
||||
*/
|
||||
|
||||
LIST_HEAD(dpm_list);
|
||||
LIST_HEAD(dpm_prepared_list);
|
||||
LIST_HEAD(dpm_suspended_list);
|
||||
LIST_HEAD(dpm_late_early_list);
|
||||
LIST_HEAD(dpm_noirq_list);
|
||||
static LIST_HEAD(dpm_prepared_list);
|
||||
static LIST_HEAD(dpm_suspended_list);
|
||||
static LIST_HEAD(dpm_late_early_list);
|
||||
static LIST_HEAD(dpm_noirq_list);
|
||||
|
||||
struct suspend_stats suspend_stats;
|
||||
static DEFINE_MUTEX(dpm_list_mtx);
|
||||
@@ -166,7 +166,7 @@ static ktime_t initcall_debug_start(struct device *dev)
|
||||
{
|
||||
ktime_t calltime = ktime_set(0, 0);
|
||||
|
||||
if (initcall_debug) {
|
||||
if (pm_print_times_enabled) {
|
||||
pr_info("calling %s+ @ %i, parent: %s\n",
|
||||
dev_name(dev), task_pid_nr(current),
|
||||
dev->parent ? dev_name(dev->parent) : "none");
|
||||
@@ -181,7 +181,7 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime,
|
||||
{
|
||||
ktime_t delta, rettime;
|
||||
|
||||
if (initcall_debug) {
|
||||
if (pm_print_times_enabled) {
|
||||
rettime = ktime_get();
|
||||
delta = ktime_sub(rettime, calltime);
|
||||
pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev),
|
||||
@@ -467,6 +467,7 @@ static void dpm_resume_noirq(pm_message_t state)
|
||||
mutex_unlock(&dpm_list_mtx);
|
||||
dpm_show_time(starttime, state, "noirq");
|
||||
resume_device_irqs();
|
||||
cpuidle_resume();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -867,6 +868,7 @@ static int dpm_suspend_noirq(pm_message_t state)
|
||||
ktime_t starttime = ktime_get();
|
||||
int error = 0;
|
||||
|
||||
cpuidle_pause();
|
||||
suspend_device_irqs();
|
||||
mutex_lock(&dpm_list_mtx);
|
||||
while (!list_empty(&dpm_late_early_list)) {
|
||||
@@ -989,8 +991,16 @@ static int dpm_suspend_late(pm_message_t state)
|
||||
int dpm_suspend_end(pm_message_t state)
|
||||
{
|
||||
int error = dpm_suspend_late(state);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
return error ? : dpm_suspend_noirq(state);
|
||||
error = dpm_suspend_noirq(state);
|
||||
if (error) {
|
||||
dpm_resume_early(state);
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dpm_suspend_end);
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
|
||||
static void __dev_pm_qos_drop_user_request(struct device *dev)
|
||||
{
|
||||
dev_pm_qos_remove_request(dev->power.pq_req);
|
||||
dev->power.pq_req = 0;
|
||||
dev->power.pq_req = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -474,6 +474,8 @@ static DEVICE_ATTR(runtime_enabled, 0444, rtpm_enabled_show, NULL);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
||||
static ssize_t async_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
@@ -500,6 +502,8 @@ static ssize_t async_store(struct device *dev, struct device_attribute *attr,
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(async, 0644, async_show, async_store);
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_PM_ADVANCED_DEBUG */
|
||||
|
||||
static struct attribute *power_attrs[] = {
|
||||
|
||||
@@ -780,9 +780,9 @@ static const struct block_device_operations mg_disk_ops = {
|
||||
.getgeo = mg_getgeo
|
||||
};
|
||||
|
||||
static int mg_suspend(struct platform_device *plat_dev, pm_message_t state)
|
||||
static int mg_suspend(struct device *dev)
|
||||
{
|
||||
struct mg_drv_data *prv_data = plat_dev->dev.platform_data;
|
||||
struct mg_drv_data *prv_data = dev->platform_data;
|
||||
struct mg_host *host = prv_data->host;
|
||||
|
||||
if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD))
|
||||
@@ -804,9 +804,9 @@ static int mg_suspend(struct platform_device *plat_dev, pm_message_t state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mg_resume(struct platform_device *plat_dev)
|
||||
static int mg_resume(struct device *dev)
|
||||
{
|
||||
struct mg_drv_data *prv_data = plat_dev->dev.platform_data;
|
||||
struct mg_drv_data *prv_data = dev->platform_data;
|
||||
struct mg_host *host = prv_data->host;
|
||||
|
||||
if (mg_wait(host, MG_STAT_READY, MG_TMAX_CONF_TO_CMD))
|
||||
@@ -825,6 +825,8 @@ static int mg_resume(struct platform_device *plat_dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(mg_pm, mg_suspend, mg_resume);
|
||||
|
||||
static int mg_probe(struct platform_device *plat_dev)
|
||||
{
|
||||
struct mg_host *host;
|
||||
@@ -1074,11 +1076,10 @@ static int mg_remove(struct platform_device *plat_dev)
|
||||
static struct platform_driver mg_disk_driver = {
|
||||
.probe = mg_probe,
|
||||
.remove = mg_remove,
|
||||
.suspend = mg_suspend,
|
||||
.resume = mg_resume,
|
||||
.driver = {
|
||||
.name = MG_DEV_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.pm = &mg_pm,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -162,22 +162,24 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)
|
||||
static int omap_rng_suspend(struct device *dev)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int omap_rng_resume(struct platform_device *pdev)
|
||||
static int omap_rng_resume(struct device *dev)
|
||||
{
|
||||
omap_rng_write_reg(RNG_MASK_REG, 0x1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
|
||||
#define OMAP_RNG_PM (&omap_rng_pm)
|
||||
|
||||
#else
|
||||
|
||||
#define omap_rng_suspend NULL
|
||||
#define omap_rng_resume NULL
|
||||
#define OMAP_RNG_PM NULL
|
||||
|
||||
#endif
|
||||
|
||||
@@ -188,11 +190,10 @@ static struct platform_driver omap_rng_driver = {
|
||||
.driver = {
|
||||
.name = "omap_rng",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = OMAP_RNG_PM,
|
||||
},
|
||||
.probe = omap_rng_probe,
|
||||
.remove = __exit_p(omap_rng_remove),
|
||||
.suspend = omap_rng_suspend,
|
||||
.resume = omap_rng_resume
|
||||
};
|
||||
|
||||
static int __init omap_rng_init(void)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user