mirror of
https://github.com/torvalds/linux.git
synced 2025-11-01 17:18:25 +02:00
ACPI: PM: Add power resource init function
This way DMI based quirk matching and quirk flag initialization can be done
just once - in the newly introduced acpi_power_resources_init() function,
which is similar to existing acpi_*_init() functions.
Convert the single already existing DMI match-based quirk in this ACPI
power resource handler ("leave unused power resources on" quirk) to such
one-time initialization in acpi_power_resources_init() function instead of
re-running that DMI match each time acpi_turn_off_unused_power_resources()
gets called.
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Link: https://patch.msgid.link/b173a6987f0b35597fd82400cb28f289786e03d0.1754243159.git.mail@maciej.szmigiero.name
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
1b237f190e
commit
3bc3dc166d
3 changed files with 11 additions and 1 deletions
|
|
@ -140,6 +140,7 @@ int __acpi_device_uevent_modalias(const struct acpi_device *adev,
|
|||
/* --------------------------------------------------------------------------
|
||||
Power Resource
|
||||
-------------------------------------------------------------------------- */
|
||||
void acpi_power_resources_init(void);
|
||||
void acpi_power_resources_list_free(struct list_head *list);
|
||||
int acpi_extract_power_resources(union acpi_object *package, unsigned int start,
|
||||
struct list_head *list);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ struct acpi_power_resource_entry {
|
|||
struct acpi_power_resource *resource;
|
||||
};
|
||||
|
||||
static bool unused_power_resources_quirk;
|
||||
|
||||
static LIST_HEAD(acpi_power_resource_list);
|
||||
static DEFINE_MUTEX(power_resource_list_lock);
|
||||
|
||||
|
|
@ -1046,7 +1048,7 @@ void acpi_turn_off_unused_power_resources(void)
|
|||
{
|
||||
struct acpi_power_resource *resource;
|
||||
|
||||
if (dmi_check_system(dmi_leave_unused_power_resources_on))
|
||||
if (unused_power_resources_quirk)
|
||||
return;
|
||||
|
||||
mutex_lock(&power_resource_list_lock);
|
||||
|
|
@ -1065,3 +1067,9 @@ void acpi_turn_off_unused_power_resources(void)
|
|||
|
||||
mutex_unlock(&power_resource_list_lock);
|
||||
}
|
||||
|
||||
void __init acpi_power_resources_init(void)
|
||||
{
|
||||
unused_power_resources_quirk =
|
||||
dmi_check_system(dmi_leave_unused_power_resources_on);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2702,6 +2702,7 @@ void __init acpi_scan_init(void)
|
|||
acpi_memory_hotplug_init();
|
||||
acpi_watchdog_init();
|
||||
acpi_pnp_init();
|
||||
acpi_power_resources_init();
|
||||
acpi_int340x_thermal_init();
|
||||
acpi_init_lpit();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue