1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define PEPD_DSM_UUID "e3f32452-febc-43ce-9039-932122d37721"
4 #define PEPD_DSM_LPI_ENUM_FUNCTIONS 0
5 #define PEPD_DSM_LPI_ADDITIONAL_FUNCTIONS 1
6 #define PEPD_DSM_LPI_GET_DEVICE_CONSTRAINTS 1
8 #define PEPD_DSM_NOTIFICATIONS_UUID "11e00d56-ce64-47ce-837b-1f898f9aa461"
9 #define PEPD_DSM_NOTIFICATION_ENUM_FUNCTIONS 0
10 #define PEPD_DSM_NOTIFICATION_ADDITIONAL_FUNCTIONS 1
11 #define PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY 5
12 #define PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT 6
14 External(\_SB.MS0X, MethodObj)
17 * Power Engine Plug-in Device
20 * * Intel Low Power S0 Idle
21 * * AMD Modern Standby BIOS Implementation Guide - #56358
22 * * Linux Kernel: drivers/acpi/x86/s2idle.c
23 * * https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-firmware-notifications
27 Name (_HID, "AMDI0005")
28 Name (_CID, EisaId ("PNP0D80"))
31 Method (_STA, 0, NotSerialized) {
36 * Device constraints for low power states (may be used for debugging).
37 * For now there is only one disabled dummy device, because Windows
38 * expects at least one device and crashes without it with a bluescreen
39 * (`INTERNAL_POWER_ERROR`). Returning an empty package does not work.
41 Name (DEVL, Package() {
43 1, /* Only 1 dummy device for now */
48 "\\DUMY", /* \DUMY - not existent */
49 0, /* Function States */
50 0 /* Minimum D-state */
56 * PEPD_DSM_UUID Helper method
58 * Arg0: Function Index
60 Method (DSM0, 1, Serialized) {
61 Switch (ToInteger(Arg0)) {
63 * Return a bit field of the supported functions for
66 Case (PEPD_DSM_LPI_ENUM_FUNCTIONS) {
67 Local0 = Buffer { 0x00 }
68 CreateByteField(Local0, 0x00, SUPP)
70 SUPP = PEPD_DSM_LPI_ADDITIONAL_FUNCTIONS
71 SUPP |= 1 << PEPD_DSM_LPI_GET_DEVICE_CONSTRAINTS
75 Case (PEPD_DSM_LPI_GET_DEVICE_CONSTRAINTS) {
79 /* Unknown function */
80 Return (Buffer() { 0x00 })
86 * PEPD_DSM_NOTIFICATIONS_UUID Helper method
88 * Arg0: Function Index
90 Method (DSM1, 1, Serialized) {
91 Switch (ToInteger(Arg0)) {
93 * Return a bit field of the supported functions for
96 Case (PEPD_DSM_NOTIFICATION_ENUM_FUNCTIONS) {
97 Local0 = Buffer { 0x00 }
98 CreateByteField(Local0, 0x00, SUPP)
100 SUPP = PEPD_DSM_NOTIFICATION_ADDITIONAL_FUNCTIONS
101 SUPP |= 1 << PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY
102 SUPP |= 1 << PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT
106 Case (PEPD_DSM_NOTIFICATION_LOW_POWER_ENTRY) {
107 /* provide board level S0ix hook */
108 If (CondRefOf (\_SB.MS0X)) {
111 Return (Buffer() { 0x00 })
113 Case (PEPD_DSM_NOTIFICATION_LOW_POWER_EXIT) {
114 /* provide board level S0ix hook */
115 If (CondRefOf (\_SB.MS0X)) {
118 Return (Buffer() { 0x00 })
121 /* Unknown function */
122 Return (Buffer() { 0x00 })
128 * Device Specific Method
132 * Arg2: Function Index
134 Method (_DSM, 4, Serialized) {
135 Switch (ToBuffer(Arg0)) {
136 Case (ToUUID(PEPD_DSM_UUID)) {
137 /* Unsupported Revision */
138 If (ToInteger(Arg1) != 0) {
139 Return (Buffer() { 0x00 })
144 Case (ToUUID(PEPD_DSM_NOTIFICATIONS_UUID)) {
145 /* Unsupported Revision */
146 If (ToInteger(Arg1) != 0) {
147 Return (Buffer() { 0x00 })
153 Return (Buffer { 0x00 })