Debian Codegraph @

src/mainboard/razer/blade_stealth_kbl/acpi/ec.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 Device (EC)
4 {
5 Name (_HID, EisaId ("PNP0C09"))
6 Name (_UID, 0)
7 Name (_GPE, 0x50) // Copied over
8
9 Name (_CRS, ResourceTemplate () {
10 IO (Decode16, 0x62, 0x62, 0, 1)
11 IO (Decode16, 0x66, 0x66, 0, 1)
12 })
13
14 Name (ACEX, 0)
15
16 OperationRegion (ERAM, EmbeddedControl, 0x00, 0xFF)
17 Field (ERAM, ByteAcc, NoLock, Preserve)
18 {
19 Offset (0x1C),
20 ODP1, 8,
21 ODP2, 8,
22 Offset (0x56),
23 CPUT, 8,
24 CPU1, 8,
25 GPUT, 8,
26 ADPV, 16,
27 ADPC, 16,
28 FANC, 8,
29 Offset (0x60),
30 BSER, 256, // BAT Serial Number
31 Offset (0x90),
32 BIF0, 16,
33 BDCP, 16, // BAT Design Capacity
34 BFCP, 16, // BAT Full Capacity
35 BRCH, 16, // BAT Rechargeable
36 BDVT, 16, // BAT Design Voltage
37 BIF5, 16,
38 BIF6, 16,
39 BIF7, 16,
40 BIF8, 16,
41 BCST, 16, // BAT Current State
42 BCRT, 16, // BAT Current Rate
43 BRCP, 16, // BAT Remaining Capacity
44 BCVT, 16, // BAT Current Voltage
45 PWRS, 8, // Power State (?)
46 ECN0, 8,
47 Offset (0xB0),
48 SRNM, 16,
49 MFDA, 16,
50 PHMR, 8,
51 BLDA, 8,
52 Offset (0xE2),
53 LIDS, 8 // Lid state
54 }
55
56 Method (_REG, 2, NotSerialized)
57 {
58 /* Initialize AC power state */
59 ACEX = PWRS - 0x82
60
61 /* Initialize LID switch state */
62 \LIDS = LIDS
63 }
64
65
66 // Close ?
67 Method (_Q14, 0, NotSerialized)
68 {
69 \LIDS = LIDS
70 Notify (LID0, 0x80)
71 }
72
73 //Open
74 Method (_Q15, 0, NotSerialized)
75 {
76 \LIDS = LIDS
77 Notify (LID0, 0x80)
78 }
79
80
81 // AC plugged
82 Method (_Q13, 0, NotSerialized)
83 {
84 ACEX = PWRS - 0x82
85 Notify (BAT, 0x80) // Status Change
86 Notify (BAT, 0x81) // Information Change
87 Notify (AC, 0x80) // Status Change
88 }
89
90 #include "ac.asl"
91 #include "battery.asl"
92 }