diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-11-12 21:36:26 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-11-20 17:31:49 +0100 |
commit | 37ba91a82e3b9de35f64348c62b5ec7d74e3a41c (patch) | |
tree | b0380d3e5d6b3eeae9031f0dec5dfa2a5764aee5 /drivers/acpi | |
parent | 98b1cc82c4affc16f5598d4fa14b1858671b2263 (diff) | |
download | linux-stable-37ba91a82e3b9de35f64348c62b5ec7d74e3a41c.tar.gz linux-stable-37ba91a82e3b9de35f64348c62b5ec7d74e3a41c.tar.bz2 linux-stable-37ba91a82e3b9de35f64348c62b5ec7d74e3a41c.zip |
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/device_pm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index f007116a8427..3b4d048c4941 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -397,6 +397,19 @@ void acpi_device_fix_up_power_extended(struct acpi_device *adev) } EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended); +/** + * acpi_device_fix_up_power_children - Force a device's children into D0. + * @adev: Parent device object whose children's power state is to be fixed up. + * + * Call acpi_device_fix_up_power() for @adev's children so long as they + * are reported as present and enabled. + */ +void acpi_device_fix_up_power_children(struct acpi_device *adev) +{ + acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL); +} +EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_children); + int acpi_device_update_power(struct acpi_device *device, int *state_p) { int state; |