Commit e4ada4c8 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge back ACPI power management material for v5.14.

parents 9b7ff25d b9370dce
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include "fan.h"
#include "internal.h" #include "internal.h"
/** /**
...@@ -1310,10 +1311,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) ...@@ -1310,10 +1311,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
* with the generic ACPI PM domain. * with the generic ACPI PM domain.
*/ */
static const struct acpi_device_id special_pm_ids[] = { static const struct acpi_device_id special_pm_ids[] = {
{"PNP0C0B", }, /* Generic ACPI fan */ ACPI_FAN_DEVICE_IDS,
{"INT3404", }, /* Fan */
{"INTC1044", }, /* Fan for Tiger Lake generation */
{"INTC1048", }, /* Fan for Alder Lake generation */
{} {}
}; };
struct acpi_device *adev = ACPI_COMPANION(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/sort.h> #include <linux/sort.h>
#include "fan.h"
MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION("ACPI Fan Driver"); MODULE_DESCRIPTION("ACPI Fan Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -24,10 +26,7 @@ static int acpi_fan_probe(struct platform_device *pdev); ...@@ -24,10 +26,7 @@ static int acpi_fan_probe(struct platform_device *pdev);
static int acpi_fan_remove(struct platform_device *pdev); static int acpi_fan_remove(struct platform_device *pdev);
static const struct acpi_device_id fan_device_ids[] = { static const struct acpi_device_id fan_device_ids[] = {
{"PNP0C0B", 0}, ACPI_FAN_DEVICE_IDS,
{"INT3404", 0},
{"INTC1044", 0},
{"INTC1048", 0},
{"", 0}, {"", 0},
}; };
MODULE_DEVICE_TABLE(acpi, fan_device_ids); MODULE_DEVICE_TABLE(acpi, fan_device_ids);
......
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* ACPI fan device IDs are shared between the fan driver and the device power
* management code.
*
* Add new device IDs before the generic ACPI fan one.
*/
#define ACPI_FAN_DEVICE_IDS \
{"INT3404", }, /* Fan */ \
{"INTC1044", }, /* Fan for Tiger Lake generation */ \
{"INTC1048", }, /* Fan for Alder Lake generation */ \
{"PNP0C0B", } /* Generic ACPI fan */
...@@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = { ...@@ -42,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
/* AMD */ /* AMD */
#define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721"
#define ACPI_LPS0_ENTRY_AMD 2
#define ACPI_LPS0_EXIT_AMD 3
#define ACPI_LPS0_SCREEN_OFF_AMD 4 #define ACPI_LPS0_SCREEN_OFF_AMD 4
#define ACPI_LPS0_SCREEN_ON_AMD 5 #define ACPI_LPS0_SCREEN_ON_AMD 5
...@@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void) ...@@ -408,6 +410,7 @@ int acpi_s2idle_prepare_late(void)
if (acpi_s2idle_vendor_amd()) { if (acpi_s2idle_vendor_amd()) {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD); acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF_AMD);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD);
} else { } else {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF); acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY); acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY);
...@@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void) ...@@ -422,6 +425,7 @@ void acpi_s2idle_restore_early(void)
return; return;
if (acpi_s2idle_vendor_amd()) { if (acpi_s2idle_vendor_amd()) {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD); acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD);
} else { } else {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT); acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment