Skip to content

Commit e4ada4c

Browse files
committed
Merge back ACPI power management material for v5.14.
2 parents 9b7ff25 + b9370dc commit e4ada4c

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

drivers/acpi/device_pm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/pm_runtime.h>
2121
#include <linux/suspend.h>
2222

23+
#include "fan.h"
2324
#include "internal.h"
2425

2526
/**
@@ -1310,10 +1311,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
13101311
* with the generic ACPI PM domain.
13111312
*/
13121313
static const struct acpi_device_id special_pm_ids[] = {
1313-
{"PNP0C0B", }, /* Generic ACPI fan */
1314-
{"INT3404", }, /* Fan */
1315-
{"INTC1044", }, /* Fan for Tiger Lake generation */
1316-
{"INTC1048", }, /* Fan for Alder Lake generation */
1314+
ACPI_FAN_DEVICE_IDS,
13171315
{}
13181316
};
13191317
struct acpi_device *adev = ACPI_COMPANION(dev);

drivers/acpi/fan.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/platform_device.h>
1717
#include <linux/sort.h>
1818

19+
#include "fan.h"
20+
1921
MODULE_AUTHOR("Paul Diefenbaugh");
2022
MODULE_DESCRIPTION("ACPI Fan Driver");
2123
MODULE_LICENSE("GPL");
@@ -24,10 +26,7 @@ static int acpi_fan_probe(struct platform_device *pdev);
2426
static int acpi_fan_remove(struct platform_device *pdev);
2527

2628
static const struct acpi_device_id fan_device_ids[] = {
27-
{"PNP0C0B", 0},
28-
{"INT3404", 0},
29-
{"INTC1044", 0},
30-
{"INTC1048", 0},
29+
ACPI_FAN_DEVICE_IDS,
3130
{"", 0},
3231
};
3332
MODULE_DEVICE_TABLE(acpi, fan_device_ids);

drivers/acpi/fan.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+
/*
4+
* ACPI fan device IDs are shared between the fan driver and the device power
5+
* management code.
6+
*
7+
* Add new device IDs before the generic ACPI fan one.
8+
*/
9+
#define ACPI_FAN_DEVICE_IDS \
10+
{"INT3404", }, /* Fan */ \
11+
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
12+
{"INTC1048", }, /* Fan for Alder Lake generation */ \
13+
{"PNP0C0B", } /* Generic ACPI fan */

drivers/acpi/x86/s2idle.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
4242

4343
/* AMD */
4444
#define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721"
45+
#define ACPI_LPS0_ENTRY_AMD 2
46+
#define ACPI_LPS0_EXIT_AMD 3
4547
#define ACPI_LPS0_SCREEN_OFF_AMD 4
4648
#define ACPI_LPS0_SCREEN_ON_AMD 5
4749

@@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
408410

409411
if (acpi_s2idle_vendor_amd()) {
410412
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
413+
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
411414
} else {
412415
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
413416
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
@@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
422425
return;
423426

424427
if (acpi_s2idle_vendor_amd()) {
428+
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
425429
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
426430
} else {
427431
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);

0 commit comments

Comments
 (0)