blob: 637dfedb8fd823e5ff6f7e0bf403750c146c29b8 [file] [log] [blame]
Angel Pons0612b272020-04-05 15:46:56 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Shaunak Saha44887c32016-06-07 00:05:00 -07002
Sumeet R Pawnikar5e53bd52020-06-01 17:40:08 +05303/* Include common dptf ASL files */
Sumeet R Pawnikar51e0fd92020-06-16 12:59:39 +05304#include <soc/intel/common/acpi/dptf_common.asl>
Sumeet R Pawnikar5e53bd52020-06-01 17:40:08 +05305
Shaunak Saha44887c32016-06-07 00:05:00 -07006Device (DPTF)
7{
Sumeet R Pawnikar5e53bd52020-06-01 17:40:08 +05308 Name (_HID, DPTF_DPTF_DEVICE)
9
Shaunak Saha44887c32016-06-07 00:05:00 -070010 Name (_UID, 0)
11
12 Name (IDSP, Package()
13 {
14 /* DPPM Passive Policy 1.0 */
15 ToUUID ("42A441D6-AE6A-462B-A84B-4A8CE79027D3"),
16
17 /* DPPM Critical Policy */
18 ToUUID ("97C68AE7-15FA-499c-B8C9-5DA81D606E0A"),
19
20 /* DPPM Cooling Policy */
21 ToUUID ("16CAF1B7-DD38-40ED-B1C1-1B8A1913D531"),
22
23#ifdef DPTF_ENABLE_FAN_CONTROL
24 /* DPPM Active Policy */
25 ToUUID ("3A95C389-E4B8-4629-A526-C52C88626BAE"),
26#endif
27 })
28
29 Method (_STA)
30 {
Alexey Buyanov03248032020-06-01 21:41:14 -070031 If (\DPTE == 1) {
Shaunak Saha44887c32016-06-07 00:05:00 -070032 Return (0xF)
33 } Else {
34 Return (0x0)
35 }
36 }
37
38 /*
39 * Arg0: Buffer containing UUID
40 * Arg1: Integer containing Revision ID of buffer format
41 * Arg2: Integer containing count of entries in Arg3
42 * Arg3: Buffer containing list of DWORD capabilities
43 * Return: Buffer containing list of DWORD capabilities
44 */
45 Method (_OSC, 4, Serialized)
46 {
47 /* Check for Passive Policy UUID */
Alexey Buyanov03248032020-06-01 21:41:14 -070048 If (DeRefOf (IDSP[0]) == Arg0) {
Shaunak Saha44887c32016-06-07 00:05:00 -070049 /* Initialize Thermal Devices */
50 ^TINI ()
51
52#ifdef DPTF_ENABLE_CHARGER
53 /* Initialize Charger Device */
54 ^TCHG.INIT ()
55#endif
56 }
57
58 Return (Arg3)
59 }
60
61 /* Priority based _TRT */
62 Name (TRTR, 1)
63
64 Method (_TRT)
65 {
66 Return (\_SB.DTRT)
67 }
68
69#ifdef DPTF_ENABLE_FAN_CONTROL
70 /* _ART : Active Cooling Relationship Table */
71 Method (_ART)
72 {
73 Return (\_SB.DART)
74 }
75#endif
76
77 /* Convert from Degrees C to 1/10 Kelvin for ACPI */
78 Method (CTOK, 1) {
79 /* 10th of Degrees C */
Alexey Buyanov03248032020-06-01 21:41:14 -070080 Local0 = Arg0 * 10
Shaunak Saha44887c32016-06-07 00:05:00 -070081
82 /* Convert to Kelvin */
Alexey Buyanov03248032020-06-01 21:41:14 -070083 Local0 += 2732
Shaunak Saha44887c32016-06-07 00:05:00 -070084
85 Return (Local0)
86 }
87
Duncan Laurie84227612018-11-20 17:22:24 -080088 /* Convert from 1/10 Kelvin to Degrees C for ACPI */
89 Method (KTOC, 1) {
Alexey Buyanov03248032020-06-01 21:41:14 -070090 If (Arg0 <= 2732) {
Duncan Laurie84227612018-11-20 17:22:24 -080091 Return (0)
92 }
93
94 /* Convert to Celsius */
Alexey Buyanov03248032020-06-01 21:41:14 -070095 Local0 = Arg0 - 2732
Duncan Laurie84227612018-11-20 17:22:24 -080096
97 /* Convert from 10th of degrees */
Alexey Buyanov03248032020-06-01 21:41:14 -070098 Local0 /= 10
Duncan Laurie84227612018-11-20 17:22:24 -080099
100 Return (Local0)
101 }
102
Shaunak Saha44887c32016-06-07 00:05:00 -0700103 /* Include Thermal Participants */
104 #include "thermal.asl"
105
106#ifdef DPTF_ENABLE_CHARGER
107 /* Include Charger Participant */
108 #include "charger.asl"
109#endif
110
111#ifdef DPTF_ENABLE_FAN_CONTROL
112 /* Include Fan Participant */
113 #include "fan.asl"
114#endif
115
116}
117
118Scope (\_SB.PCI0)
119{
120 #include "cpu.asl"
121}