diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 13:56:05 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 13:56:05 +0100 |
commit | 8a78cf70fae587b0691b4b982bc69c1261e05e76 (patch) | |
tree | c2b3aa89d4b64c7207250fb9ddff8fc5d717d486 /include/acpi | |
parent | 09212fddc8661e67a964d91a6584209784f52500 (diff) | |
parent | 65ab96f60621c4da8f1b4087a57b788bc4d8f27b (diff) | |
download | linux-3.10-8a78cf70fae587b0691b4b982bc69c1261e05e76.tar.gz linux-3.10-8a78cf70fae587b0691b4b982bc69c1261e05e76.tar.bz2 linux-3.10-8a78cf70fae587b0691b4b982bc69c1261e05e76.zip |
Merge branch 'acpi-pm' into acpi-cleanup
The following commits depend on the 'acpi-pm' material.
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acpi_bus.h | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 31b33d9cabc..fc76b1f7ef0 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -197,7 +197,7 @@ struct acpi_device_power_state { } flags; int power; /* % Power (compared to D0) */ int latency; /* Dx->D0 time (microseconds) */ - struct acpi_handle_list resources; /* Power resources referenced */ + struct list_head resources; /* Power resources referenced */ }; struct acpi_device_power { @@ -240,7 +240,7 @@ struct acpi_device_wakeup { acpi_handle gpe_device; u64 gpe_number; u64 sleep_state; - struct acpi_handle_list resources; + struct list_head resources; struct acpi_device_wakeup_flags flags; int prepare_count; }; @@ -277,6 +277,8 @@ struct acpi_device { struct list_head physical_node_list; struct mutex physical_node_lock; DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); + struct list_head power_dependent; + void (*remove)(struct acpi_device *); }; static inline void *acpi_driver_data(struct acpi_device *d) @@ -327,13 +329,51 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); acpi_status acpi_bus_get_status_handle(acpi_handle handle, unsigned long long *sta); int acpi_bus_get_status(struct acpi_device *device); + +#ifdef CONFIG_PM int acpi_bus_set_power(acpi_handle handle, int state); +const char *acpi_power_state_string(int state); +int acpi_device_get_power(struct acpi_device *device, int *state); int acpi_device_set_power(struct acpi_device *device, int state); +int acpi_bus_init_power(struct acpi_device *device); int acpi_bus_update_power(acpi_handle handle, int *state_p); bool acpi_bus_power_manageable(acpi_handle handle); bool acpi_bus_can_wakeup(acpi_handle handle); -int acpi_power_resource_register_device(struct device *dev, acpi_handle handle); -void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle); +#else /* !CONFIG_PM */ +static inline int acpi_bus_set_power(acpi_handle handle, int state) +{ + return 0; +} +static inline const char *acpi_power_state_string(int state) +{ + return "D0"; +} +static inline int acpi_device_get_power(struct acpi_device *device, int *state) +{ + return 0; +} +static inline int acpi_device_set_power(struct acpi_device *device, int state) +{ + return 0; +} +static inline int acpi_bus_init_power(struct acpi_device *device) +{ + return 0; +} +static inline int acpi_bus_update_power(acpi_handle handle, int *state_p) +{ + return 0; +} +static inline bool acpi_bus_power_manageable(acpi_handle handle) +{ + return false; +} +static inline bool acpi_bus_can_wakeup(acpi_handle handle) +{ + return false; +} +#endif /* !CONFIG_PM */ + #ifdef CONFIG_ACPI_PROC_EVENT int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); @@ -412,6 +452,8 @@ acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, int acpi_device_power_state(struct device *dev, struct acpi_device *adev, u32 target_state, int d_max_in, int *d_min_p); int acpi_pm_device_sleep_state(struct device *, int *, int); +void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); +void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); #else static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, acpi_notify_handler handler, @@ -441,6 +483,10 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) { return __acpi_device_power_state(m, p); } +static inline void acpi_dev_pm_add_dependent(acpi_handle handle, + struct device *depdev) {} +static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, + struct device *depdev) {} #endif #ifdef CONFIG_PM_RUNTIME |