aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-07-07 03:30:55 +0200
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-07 16:25:02 -0700
commit3737b2b1046900660b42e25c904b85e78139d25b (patch)
treea03ba67b061c44eddca14073e5317b1eb4fc1431 /drivers/acpi/bus.c
parentc6c4f070a61b2b6e5cd317a5fbf25255878688a2 (diff)
ACPI: Introduce acpi_bus_power_manageable function
Introduce function acpi_bus_power_manageable() allowing other (dependent) subsystems to check if ACPI is able to power manage given device. This may be useful, for example, for PCI device power management. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a6dbcf4d9ef..b9b69d9629b 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -295,6 +295,17 @@ int acpi_bus_set_power(acpi_handle handle, int state)
EXPORT_SYMBOL(acpi_bus_set_power);
+bool acpi_bus_power_manageable(acpi_handle handle)
+{
+ struct acpi_device *device;
+ int result;
+
+ result = acpi_bus_get_device(handle, &device);
+ return result ? false : device->flags.power_manageable;
+}
+
+EXPORT_SYMBOL(acpi_bus_power_manageable);
+
/* --------------------------------------------------------------------------
Event Management
-------------------------------------------------------------------------- */