mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ACPI: Add a convenience function to tell a device is in D0 state
Add a convenience function to tell whether a device is in D0 state, primarily for use in drivers' probe or remove functions on busses where the custom is to power on the device for the duration of both. Returns false on non-ACPI systems. Suggested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
ed66f12ba4
commit
b82a7df4a7
2 changed files with 31 additions and 0 deletions
|
@ -1016,6 +1016,7 @@ int acpi_subsys_runtime_suspend(struct device *dev);
|
|||
int acpi_subsys_runtime_resume(struct device *dev);
|
||||
int acpi_dev_pm_attach(struct device *dev, bool power_on);
|
||||
bool acpi_storage_d3(struct device *dev);
|
||||
bool acpi_dev_state_d0(struct device *dev);
|
||||
#else
|
||||
static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
|
||||
static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
|
||||
|
@ -1027,6 +1028,10 @@ static inline bool acpi_storage_d3(struct device *dev)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
static inline bool acpi_dev_state_d0(struct device *dev)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue