diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:56:05 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-01-29 07:56:05 -0500 |
| commit | 8a78cf70fae587b0691b4b982bc69c1261e05e76 (patch) | |
| tree | c2b3aa89d4b64c7207250fb9ddff8fc5d717d486 /include/acpi | |
| parent | 09212fddc8661e67a964d91a6584209784f52500 (diff) | |
| parent | 65ab96f60621c4da8f1b4087a57b788bc4d8f27b (diff) | |
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 31b33d9cabcc..fc76b1f7ef06 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -197,7 +197,7 @@ struct acpi_device_power_state { | |||
| 197 | } flags; | 197 | } flags; |
| 198 | int power; /* % Power (compared to D0) */ | 198 | int power; /* % Power (compared to D0) */ |
| 199 | int latency; /* Dx->D0 time (microseconds) */ | 199 | int latency; /* Dx->D0 time (microseconds) */ |
| 200 | struct acpi_handle_list resources; /* Power resources referenced */ | 200 | struct list_head resources; /* Power resources referenced */ |
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | struct acpi_device_power { | 203 | struct acpi_device_power { |
| @@ -240,7 +240,7 @@ struct acpi_device_wakeup { | |||
| 240 | acpi_handle gpe_device; | 240 | acpi_handle gpe_device; |
| 241 | u64 gpe_number; | 241 | u64 gpe_number; |
| 242 | u64 sleep_state; | 242 | u64 sleep_state; |
| 243 | struct acpi_handle_list resources; | 243 | struct list_head resources; |
| 244 | struct acpi_device_wakeup_flags flags; | 244 | struct acpi_device_wakeup_flags flags; |
| 245 | int prepare_count; | 245 | int prepare_count; |
| 246 | }; | 246 | }; |
| @@ -277,6 +277,8 @@ struct acpi_device { | |||
| 277 | struct list_head physical_node_list; | 277 | struct list_head physical_node_list; |
| 278 | struct mutex physical_node_lock; | 278 | struct mutex physical_node_lock; |
| 279 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); | 279 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); |
| 280 | struct list_head power_dependent; | ||
| 281 | void (*remove)(struct acpi_device *); | ||
| 280 | }; | 282 | }; |
| 281 | 283 | ||
| 282 | static inline void *acpi_driver_data(struct acpi_device *d) | 284 | static inline void *acpi_driver_data(struct acpi_device *d) |
| @@ -327,13 +329,51 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); | |||
| 327 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 329 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
| 328 | unsigned long long *sta); | 330 | unsigned long long *sta); |
| 329 | int acpi_bus_get_status(struct acpi_device *device); | 331 | int acpi_bus_get_status(struct acpi_device *device); |
| 332 | |||
| 333 | #ifdef CONFIG_PM | ||
| 330 | int acpi_bus_set_power(acpi_handle handle, int state); | 334 | int acpi_bus_set_power(acpi_handle handle, int state); |
| 335 | const char *acpi_power_state_string(int state); | ||
| 336 | int acpi_device_get_power(struct acpi_device *device, int *state); | ||
| 331 | int acpi_device_set_power(struct acpi_device *device, int state); | 337 | int acpi_device_set_power(struct acpi_device *device, int state); |
| 338 | int acpi_bus_init_power(struct acpi_device *device); | ||
| 332 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 339 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
| 333 | bool acpi_bus_power_manageable(acpi_handle handle); | 340 | bool acpi_bus_power_manageable(acpi_handle handle); |
| 334 | bool acpi_bus_can_wakeup(acpi_handle handle); | 341 | bool acpi_bus_can_wakeup(acpi_handle handle); |
| 335 | int acpi_power_resource_register_device(struct device *dev, acpi_handle handle); | 342 | #else /* !CONFIG_PM */ |
| 336 | void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle); | 343 | static inline int acpi_bus_set_power(acpi_handle handle, int state) |
| 344 | { | ||
| 345 | return 0; | ||
| 346 | } | ||
| 347 | static inline const char *acpi_power_state_string(int state) | ||
| 348 | { | ||
| 349 | return "D0"; | ||
| 350 | } | ||
| 351 | static inline int acpi_device_get_power(struct acpi_device *device, int *state) | ||
| 352 | { | ||
| 353 | return 0; | ||
| 354 | } | ||
| 355 | static inline int acpi_device_set_power(struct acpi_device *device, int state) | ||
| 356 | { | ||
| 357 | return 0; | ||
| 358 | } | ||
| 359 | static inline int acpi_bus_init_power(struct acpi_device *device) | ||
| 360 | { | ||
| 361 | return 0; | ||
| 362 | } | ||
| 363 | static inline int acpi_bus_update_power(acpi_handle handle, int *state_p) | ||
| 364 | { | ||
| 365 | return 0; | ||
| 366 | } | ||
| 367 | static inline bool acpi_bus_power_manageable(acpi_handle handle) | ||
| 368 | { | ||
| 369 | return false; | ||
| 370 | } | ||
| 371 | static inline bool acpi_bus_can_wakeup(acpi_handle handle) | ||
| 372 | { | ||
| 373 | return false; | ||
| 374 | } | ||
| 375 | #endif /* !CONFIG_PM */ | ||
| 376 | |||
| 337 | #ifdef CONFIG_ACPI_PROC_EVENT | 377 | #ifdef CONFIG_ACPI_PROC_EVENT |
| 338 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); | 378 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); |
| 339 | int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); | 379 | 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, | |||
| 412 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | 452 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, |
| 413 | u32 target_state, int d_max_in, int *d_min_p); | 453 | u32 target_state, int d_max_in, int *d_min_p); |
| 414 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 454 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
| 455 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | ||
| 456 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | ||
| 415 | #else | 457 | #else |
| 416 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 458 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
| 417 | acpi_notify_handler handler, | 459 | acpi_notify_handler handler, |
| @@ -441,6 +483,10 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
| 441 | { | 483 | { |
| 442 | return __acpi_device_power_state(m, p); | 484 | return __acpi_device_power_state(m, p); |
| 443 | } | 485 | } |
| 486 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | ||
| 487 | struct device *depdev) {} | ||
| 488 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | ||
| 489 | struct device *depdev) {} | ||
| 444 | #endif | 490 | #endif |
| 445 | 491 | ||
| 446 | #ifdef CONFIG_PM_RUNTIME | 492 | #ifdef CONFIG_PM_RUNTIME |
