|
@@ -364,6 +364,31 @@ int acpi_bus_set_power(acpi_handle handle, int state)
|
|
|
|
|
|
EXPORT_SYMBOL(acpi_bus_set_power);
|
|
|
|
|
|
+
|
|
|
+int acpi_bus_init_power(struct acpi_device *device)
|
|
|
+{
|
|
|
+ int state;
|
|
|
+ int result;
|
|
|
+
|
|
|
+ if (!device)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ device->power.state = ACPI_STATE_UNKNOWN;
|
|
|
+
|
|
|
+ result = __acpi_bus_get_power(device, &state);
|
|
|
+ if (result)
|
|
|
+ return result;
|
|
|
+
|
|
|
+ if (device->power.flags.power_resources)
|
|
|
+ result = acpi_power_on_resources(device, state);
|
|
|
+
|
|
|
+ if (!result)
|
|
|
+ device->power.state = state;
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
bool acpi_bus_power_manageable(acpi_handle handle)
|
|
|
{
|
|
|
struct acpi_device *device;
|