Debian Codegraph @

src/mainboard/51nb/x210/acpi/ec.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 Device (EC)
4 {
5 Name (_HID, EisaId ("PNP0C09"))
6 Name (_UID, 0)
7
8 Name (_GPE, 0x4F) // _GPE: General Purpose Events
9 Name (_CRS, ResourceTemplate () {
10 IO (Decode16, 0x62, 0x62, 1, 1)
11 IO (Decode16, 0x66, 0x66, 1, 1)
12 })
13
14 OperationRegion (ERAM, EmbeddedControl, 0, 0xFF)
15 Field (ERAM, ByteAcc, Lock, Preserve)
16 {
17 Offset (0x50),
18 CTMP, 8,
19 CFAN, 8,
20 B1SS, 1,
21 BSTS, 2,
22 ACIN, 1,
23 Offset (0x53),
24 BKLG, 8,
25 TOUP, 1,
26 WIRE, 1,
27 BLTH, 1,
28 LIDC, 1,
29 APFG, 1,
30 WRST, 1,
31 BTST, 1,
32 ACEB, 1,
33 CAME, 1,
34 Offset (0x60),
35 DGCP, 16,
36 FLCP, 16,
37 DGVO, 16,
38 BDW, 16,
39 BDL, 16,
40 BPR, 16,
41 BRC, 16,
42 BPV, 16
43 }
44
45 Method (_REG, 2, NotSerialized)
46 {
47 /* Initialize AC power state */
48 \PWRS = ACIN
49
50 /* Initialize LID switch state */
51 \LIDS = LIDC
52 }
53
54 /* KEY_BRIGHTNESSUP */
55 Method (_Q04)
56 {
57 Notify(\_SB.PCI0.GFX0.LCD, 0x86)
58 }
59
60 /* KEY_BRIGHTNESSDOWN */
61 Method (_Q05)
62 {
63 Notify(\_SB.PCI0.GFX0.LCD, 0x87)
64 }
65
66 /* Battery Information Event */
67 Method (_Q0C)
68 {
69 Notify (BAT, 0x81)
70 }
71
72 /* AC event */
73 Method (_Q0D)
74 {
75 \PWRS = ACIN
76 Notify (AC, 0x80)
77 }
78
79 /* Lid event */
80 Method (_Q0E)
81 {
82 \LIDS = LIDC
83 Notify (LID0, 0x80)
84 }
85
86 /* Battery Information Event */
87 Method (_Q13)
88 {
89 Notify (BAT, 0x81)
90 }
91
92 /* Battery Status Event */
93 Method (_Q14)
94 {
95 Notify (BAT, 0x80)
96 }
97
98 Device (AC)
99 {
100 Name (_HID, "ACPI0003")
101 Name (_PCL, Package () { \_SB })
102
103 Method (_STA)
104 {
105 Return (0x0F)
106 }
107 Method (_PSR)
108 {
109 Return (\PWRS)
110 }
111 }
112
113 #include "battery.asl"
114 }