Debian Codegraph @

src/mainboard/roda/rk886ex/acpi/ec.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 Device(EC0)
4 {
5 Name (_HID, EISAID("PNP0C09"))
6 Name (_UID, 1)
7
8 Name (_GPE, 23) // GPI07 / GPE23 -> Runtime SCI
9 Name (ECON, 0)
10 Name (QEVT, 0)
11
12 OperationRegion(ERAM, EmbeddedControl, 0x00, 0xff)
13 Field (ERAM, ByteAcc, NoLock, Preserve)
14 {
15 Offset(0x04), // Command interface
16 CMCM, 8,
17 CMD1, 8,
18 CMD2, 8,
19 CMD3, 8,
20 Offset(0x18), // SMBus
21 SMPR, 8,
22 SMST, 8,
23 SMAD, 8,
24 SMCM, 8,
25 Offset(0x1c),
26 SMW0, 16,
27 //SMD0, 264,
28 Offset(0x3d),
29 SMAA, 8,
30 Offset(0x78), // GPIs
31 P60S, 1,
32 P61S, 1,
33 P62S, 1,
34 P63S, 1,
35 P64S, 1,
36 P65S, 1,
37 P66S, 1,
38 P67S, 1,
39 Offset(0x83), // Thermal
40 RTMP, 8,
41 TML0, 8,
42 TMH0, 8,
43 Offset(0x87),
44 TMCR, 8,
45 Offset(0x89),
46 TML1, 8,
47 TMH1, 8
48 }
49
50 Method (_CRS, 0)
51 {
52 Name (ECMD, ResourceTemplate()
53 {
54 IO (Decode16, 0x62, 0x62, 1, 1)
55 IO (Decode16, 0x66, 0x66, 1, 1)
56 })
57
58 Return (ECMD)
59 }
60
61 Method (_REG, 2)
62 {
63 // This method is needed by Windows XP/2000 for
64 // EC initialization before a driver is loaded
65
66 If (Arg0 == 0x03) {
67 ECON = Arg1
68 }
69 }
70
71 // EC Query methods
72
73 Method (_Q11, 0)
74 {
75 Printf ("_Q11: Fn-F8 (Sleep Button) pressed")
76 Notify(SLPB, 0x80)
77 }
78
79 Method (_Q12, 0)
80 {
81 Printf ("_Q12: Fn-F9 (Display Switch) pressed")
82 Notify (\_SB.PCI0.GFX0, 0x82)
83 // TLST = 1
84 }
85
86 Method (_Q30, 0)
87 {
88 Printf ("_Q30: AC In/Out")
89 Notify(ADP1, 0x80) // Tell the Power Adapter
90 PNOT() // and the CPU and Battery
91 // Notify the Batteries
92 Notify(BAT1, 0x80) // Execute BAT1 _BST
93 Notify(BAT2, 0x80) // Execute BAT2 _BST
94 }
95
96 Method (_Q31, 0)
97 {
98 Printf ("_Q31: LID Open/Close")
99 Notify(LID0, 0x80)
100 }
101
102 Method (_Q32, 0)
103 {
104 Printf ("_Q32: Battery 1 In/Out")
105 If (ECON) {
106 Local0 = P62S
107 If (~Local0) {
108 Notify(BAT1, 0x80)
109 }
110 }
111 }
112
113 Method (_Q33, 0)
114 {
115 Printf ("_Q33: Battery 2 In/Out")
116 If (ECON) {
117 Local0 = P63S
118 If (~Local0) {
119 Notify(BAT2, 0x80)
120 }
121 }
122 }
123
124 Method (_Q34, 0)
125 {
126 Printf ("_Q34: LPT/FDD")
127 // PHSS(0x70)
128 }
129
130 Method (_Q35, 0)
131 {
132 Printf ("_Q35: Processor is hot")
133 }
134
135 Method (_Q36, 0)
136 {
137 Printf ("_Q36: Thermal Warning")
138 }
139
140 Method (_Q37, 0)
141 {
142 Printf ("_Q37: PME")
143 }
144
145 Method (_Q38, 0)
146 {
147 Printf ("_Q38: Thermal")
148 }
149
150 Method (_Q39, 0)
151 {
152 Printf ("_Q39: Thermal")
153 }
154
155 // TODO Scope _SB devices for AC power, LID, Power button
156
157 }