From d5df4e65d9b5a9a46ff174ca9e87d5332bf65afb Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Fri, 24 Sep 2004 04:51:10 -0700 Subject: [power mgmt] Make system state enums match device state values. Changes the PM_SUSPEND_MEM (and PM_SUSPEND_DISK) enum values so that they make sense as PCI device power states. (a) Fixes bugs whereby PCI drivers are being given bogus values. This should resolve OSDL bugid 2886 without changing the PCI API (its PM calls still act as on 2.4 kernels). (b) Doesn't change the awkward assumption in the 2.6 PMcore that the /sys/bus/*/devices/power/state, /proc/acpi/sleep, dev->power.power_state, and dev->detach_state files share the same numeric codes ... even for busses very unlike PCI, or systems with several "on" policies as well as STD and STR, or with device-PM transtions with no system-wide equivalent. Really we need to move away from "u32" codes that are easily confused with each other, towards typed values (probably struct pointers), but that's a long-term change and we need the PCI issue fixed sooner. Signed-off-by: David Brownell --- include/linux/pm.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/pm.h b/include/linux/pm.h index d54bc441daff..7bfd2d43963e 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -194,11 +194,12 @@ extern void (*pm_idle)(void); extern void (*pm_power_off)(void); enum { - PM_SUSPEND_ON, - PM_SUSPEND_STANDBY, - PM_SUSPEND_MEM, - PM_SUSPEND_DISK, - PM_SUSPEND_MAX, + PM_SUSPEND_ON = 0, + PM_SUSPEND_STANDBY = 1, + /* NOTE: PM_SUSPEND_MEM == PCI_D3hot */ + PM_SUSPEND_MEM = 3, + PM_SUSPEND_DISK = 4, + PM_SUSPEND_MAX = 5, }; enum { -- cgit v1.2.3