Commit 5dbf5099 authored by Pratik Vishwakarma's avatar Pratik Vishwakarma Committed by Rafael J. Wysocki

ACPI: PM: s2idle: Add support for new Microsoft UUID

This adds supports for _DSM notifications to the Microsoft UUID
described by Microsoft documentation for s2idle.

Link: https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-firmware-notificationsCo-developed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarPratik Vishwakarma <Pratik.Vishwakarma@amd.com>
Tested-by: default avatarJulian Sikorski <belegdol@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3f4b116c
...@@ -32,6 +32,9 @@ static const struct acpi_device_id lps0_device_ids[] = { ...@@ -32,6 +32,9 @@ static const struct acpi_device_id lps0_device_ids[] = {
{"", }, {"", },
}; };
/* Microsoft platform agnostic UUID */
#define ACPI_LPS0_DSM_UUID_MICROSOFT "11e00d56-ce64-47ce-837b-1f898f9aa461"
#define ACPI_LPS0_DSM_UUID "c4eb40a0-6cd2-11e2-bcfd-0800200c9a66" #define ACPI_LPS0_DSM_UUID "c4eb40a0-6cd2-11e2-bcfd-0800200c9a66"
#define ACPI_LPS0_GET_DEVICE_CONSTRAINTS 1 #define ACPI_LPS0_GET_DEVICE_CONSTRAINTS 1
...@@ -39,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = { ...@@ -39,6 +42,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
#define ACPI_LPS0_SCREEN_ON 4 #define ACPI_LPS0_SCREEN_ON 4
#define ACPI_LPS0_ENTRY 5 #define ACPI_LPS0_ENTRY 5
#define ACPI_LPS0_EXIT 6 #define ACPI_LPS0_EXIT 6
#define ACPI_LPS0_MS_ENTRY 7
#define ACPI_LPS0_MS_EXIT 8
/* AMD */ /* AMD */
#define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721"
...@@ -51,6 +56,9 @@ static acpi_handle lps0_device_handle; ...@@ -51,6 +56,9 @@ static acpi_handle lps0_device_handle;
static guid_t lps0_dsm_guid; static guid_t lps0_dsm_guid;
static int lps0_dsm_func_mask; static int lps0_dsm_func_mask;
static guid_t lps0_dsm_guid_microsoft;
static int lps0_dsm_func_mask_microsoft;
/* Device constraint entry structure */ /* Device constraint entry structure */
struct lpi_device_info { struct lpi_device_info {
char *name; char *name;
...@@ -366,14 +374,18 @@ static int lps0_device_attach(struct acpi_device *adev, ...@@ -366,14 +374,18 @@ static int lps0_device_attach(struct acpi_device *adev,
rev_id = 0; rev_id = 0;
lps0_dsm_func_mask = validate_dsm(adev->handle, lps0_dsm_func_mask = validate_dsm(adev->handle,
ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
&lps0_dsm_guid_microsoft);
} else { } else {
rev_id = 1; rev_id = 1;
lps0_dsm_func_mask = validate_dsm(adev->handle, lps0_dsm_func_mask = validate_dsm(adev->handle,
ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid); ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid);
lps0_dsm_func_mask_microsoft = -EINVAL;
} }
if (lps0_dsm_func_mask < 0) if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0)
return 0;//function eval failed return 0; //function evaluation failed
lps0_device_handle = adev->handle; lps0_device_handle = adev->handle;
...@@ -412,7 +424,14 @@ int acpi_s2idle_prepare_late(void) ...@@ -412,7 +424,14 @@ int acpi_s2idle_prepare_late(void)
if (pm_debug_messages_on) if (pm_debug_messages_on)
lpi_check_constraints(); lpi_check_constraints();
if (acpi_s2idle_vendor_amd()) { if (lps0_dsm_func_mask_microsoft > 0) {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_OFF,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
} else 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,
lps0_dsm_func_mask, lps0_dsm_guid); lps0_dsm_func_mask, lps0_dsm_guid);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD, acpi_sleep_run_lps0_dsm(ACPI_LPS0_ENTRY_AMD,
...@@ -432,7 +451,14 @@ void acpi_s2idle_restore_early(void) ...@@ -432,7 +451,14 @@ void acpi_s2idle_restore_early(void)
if (!lps0_device_handle || sleep_no_lps0) if (!lps0_device_handle || sleep_no_lps0)
return; return;
if (acpi_s2idle_vendor_amd()) { if (lps0_dsm_func_mask_microsoft > 0) {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_ENTRY,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON,
lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft);
} else if (acpi_s2idle_vendor_amd()) {
acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD, acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT_AMD,
lps0_dsm_func_mask, lps0_dsm_guid); lps0_dsm_func_mask, lps0_dsm_guid);
acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD, acpi_sleep_run_lps0_dsm(ACPI_LPS0_SCREEN_ON_AMD,
......
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