ACPI / PM: Allow attach/detach routines to change device power states

Make it possible to ask the routines used for adding/removing devices
to/from the general ACPI PM domain, acpi_dev_pm_attach() and
acpi_dev_pm_detach(), respectively, to change the power states of
devices so that they are put into the full-power state automatically
by acpi_dev_pm_attach() and into the lowest-power state available
automatically by acpi_dev_pm_detach().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
Rafael J. Wysocki
2012-11-26 10:03:06 +01:00
parent 1399dfcdfe
commit b88ce2a415
2 changed files with 31 additions and 8 deletions

View File

@@ -458,11 +458,14 @@ static inline int acpi_subsys_resume_early(struct device *dev) { return 0; }
#endif
#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
int acpi_dev_pm_attach(struct device *dev);
int acpi_dev_pm_detach(struct device *dev);
int acpi_dev_pm_attach(struct device *dev, bool power_on);
int acpi_dev_pm_detach(struct device *dev, bool power_off);
#else
static inline int acpi_dev_pm_attach(struct device *dev) { return -ENODEV; }
static inline void acpi_dev_pm_detach(struct device *dev) {}
static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
{
return -ENODEV;
}
static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {}
#endif
#endif /*_LINUX_ACPI_H*/