Skip to content

Commit 37ba91a

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: PM: Add acpi_device_fix_up_power_children() function
In some cases it is necessary to fix-up the power-state of an ACPI device's children without touching the ACPI device itself add a new acpi_device_fix_up_power_children() function for this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Cc: 6.6+ <stable@vger.kernel.org> # 6.6+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 98b1cc8 commit 37ba91a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/acpi/device_pm.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,19 @@ void acpi_device_fix_up_power_extended(struct acpi_device *adev)
397397
}
398398
EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended);
399399

400+
/**
401+
* acpi_device_fix_up_power_children - Force a device's children into D0.
402+
* @adev: Parent device object whose children's power state is to be fixed up.
403+
*
404+
* Call acpi_device_fix_up_power() for @adev's children so long as they
405+
* are reported as present and enabled.
406+
*/
407+
void acpi_device_fix_up_power_children(struct acpi_device *adev)
408+
{
409+
acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL);
410+
}
411+
EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_children);
412+
400413
int acpi_device_update_power(struct acpi_device *device, int *state_p)
401414
{
402415
int state;

include/acpi/acpi_bus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ int acpi_device_set_power(struct acpi_device *device, int state);
542542
int acpi_bus_init_power(struct acpi_device *device);
543543
int acpi_device_fix_up_power(struct acpi_device *device);
544544
void acpi_device_fix_up_power_extended(struct acpi_device *adev);
545+
void acpi_device_fix_up_power_children(struct acpi_device *adev);
545546
int acpi_bus_update_power(acpi_handle handle, int *state_p);
546547
int acpi_device_update_power(struct acpi_device *device, int *state_p);
547548
bool acpi_bus_power_manageable(acpi_handle handle);

0 commit comments

Comments
 (0)