Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans de Goede and committed by
Rafael J. Wysocki
37ba91a8 98b1cc82

+14
+13
drivers/acpi/device_pm.c
··· 397 397 } 398 398 EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended); 399 399 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 + 400 413 int acpi_device_update_power(struct acpi_device *device, int *state_p) 401 414 { 402 415 int state;
+1
include/acpi/acpi_bus.h
··· 542 542 int acpi_bus_init_power(struct acpi_device *device); 543 543 int acpi_device_fix_up_power(struct acpi_device *device); 544 544 void acpi_device_fix_up_power_extended(struct acpi_device *adev); 545 + void acpi_device_fix_up_power_children(struct acpi_device *adev); 545 546 int acpi_bus_update_power(acpi_handle handle, int *state_p); 546 547 int acpi_device_update_power(struct acpi_device *device, int *state_p); 547 548 bool acpi_bus_power_manageable(acpi_handle handle);