aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acpi_bus.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-16 16:29:28 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-21 18:19:28 -0400
commitec4602a9588a196fa1a9af46bfdd37cbf5792db4 (patch)
treea7b21b2f8afd0f3b1796311ded8128dcdd38a9ab /include/acpi/acpi_bus.h
parentc7788792a5e7b0d5d7f96d0766b4cb6112d47d75 (diff)
ACPI / PM: Allow device power states to be used for CONFIG_PM unset
Currently, drivers/acpi/device_pm.c depends on CONFIG_PM and all of the functions defined in there are replaced with static inline stubs if that option is unset. However, CONFIG_PM means, roughly, "runtime PM or suspend/hibernation support" and some of those functions are useful regardless of that. For example, they are used by the ACPI fan driver for controlling fans and acpi_device_set_power() is called during device removal. Moreover, device initialization may depend on setting device power states properly. For these reasons, make the routines manipulating ACPI device power states defined in drivers/acpi/device_pm.c available for CONFIG_PM unset too. Reported-by: Zhang Rui <rui.zhang@intel.com> Reported-and-tested-by: Michel Lespinasse <walken@google.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: 3.9+ <stable@vger.kernel.org>
Diffstat (limited to 'include/acpi/acpi_bus.h')
-rw-r--r--include/acpi/acpi_bus.h40
1 files changed, 5 insertions, 35 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 98db31d9f9b4..636c59f2003a 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -377,7 +377,6 @@ acpi_status acpi_bus_get_status_handle(acpi_handle handle,
377 unsigned long long *sta); 377 unsigned long long *sta);
378int acpi_bus_get_status(struct acpi_device *device); 378int acpi_bus_get_status(struct acpi_device *device);
379 379
380#ifdef CONFIG_PM
381int acpi_bus_set_power(acpi_handle handle, int state); 380int acpi_bus_set_power(acpi_handle handle, int state);
382const char *acpi_power_state_string(int state); 381const char *acpi_power_state_string(int state);
383int acpi_device_get_power(struct acpi_device *device, int *state); 382int acpi_device_get_power(struct acpi_device *device, int *state);
@@ -385,41 +384,12 @@ int acpi_device_set_power(struct acpi_device *device, int state);
385int acpi_bus_init_power(struct acpi_device *device); 384int acpi_bus_init_power(struct acpi_device *device);
386int acpi_bus_update_power(acpi_handle handle, int *state_p); 385int acpi_bus_update_power(acpi_handle handle, int *state_p);
387bool acpi_bus_power_manageable(acpi_handle handle); 386bool acpi_bus_power_manageable(acpi_handle handle);
387
388#ifdef CONFIG_PM
388bool acpi_bus_can_wakeup(acpi_handle handle); 389bool acpi_bus_can_wakeup(acpi_handle handle);
389#else /* !CONFIG_PM */ 390#else
390static inline int acpi_bus_set_power(acpi_handle handle, int state) 391static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
391{ 392#endif
392 return 0;
393}
394static inline const char *acpi_power_state_string(int state)
395{
396 return "D0";
397}
398static inline int acpi_device_get_power(struct acpi_device *device, int *state)
399{
400 return 0;
401}
402static inline int acpi_device_set_power(struct acpi_device *device, int state)
403{
404 return 0;
405}
406static inline int acpi_bus_init_power(struct acpi_device *device)
407{
408 return 0;
409}
410static inline int acpi_bus_update_power(acpi_handle handle, int *state_p)
411{
412 return 0;
413}
414static inline bool acpi_bus_power_manageable(acpi_handle handle)
415{
416 return false;
417}
418static inline bool acpi_bus_can_wakeup(acpi_handle handle)
419{
420 return false;
421}
422#endif /* !CONFIG_PM */
423 393
424#ifdef CONFIG_ACPI_PROC_EVENT 394#ifdef CONFIG_ACPI_PROC_EVENT
425int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); 395int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);