Debian Codegraph @

src/soc/intel/common/acpi/dptf/dptf.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /* Include common dptf ASL files */
4 #include <soc/intel/common/acpi/dptf_common.asl>
5
6 Device (DPTF)
7 {
8 Name (_HID, DPTF_DPTF_DEVICE)
9
10 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 {
31 If (\DPTE == 1) {
32 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 */
48 If (DeRefOf (IDSP[0]) == Arg0) {
49 /* 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 Method (_ART)
71 {
72 Return (\_SB.DART)
73 }
74 #endif
75
76 /* Convert from Degrees C to 1/10 Kelvin for ACPI */
77 Method (CTOK, 1) {
78 /* 10th of Degrees C */
79 Local0 = Arg0 * 10
80
81 /* Convert to Kelvin */
82 Local0 += 2732
83
84 Return (Local0)
85 }
86
87 /* Convert from 1/10 Kelvin to Degrees C for ACPI */
88 Method (KTOC, 1) {
89 If (Arg0 <= 2732) {
90 Return (0)
91 }
92
93 /* Convert to Celsius */
94 Local0 = Arg0 - 2732
95
96 /* Convert from 10th of degrees */
97 Local0 /= 10
98
99 Return (Local0)
100 }
101
102 /* Include Thermal Participants */
103 #include "thermal.asl"
104
105 #ifdef DPTF_ENABLE_CHARGER
106 /* Include Charger Participant */
107 #include "charger.asl"
108 #endif
109
110 #ifdef DPTF_ENABLE_FAN_CONTROL
111 /* Include Fan Participant */
112 #include "fan.asl"
113 #endif
114
115 }
116
117 Scope (\_SB.PCI0)
118 {
119 #include "cpu.asl"
120 }