1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EisaId ("PNP0C09") /* Embedded Controller Device */) // _HID: Hardware ID
6 Name (_GPE, 0x50 /* GPP_E16 */) // _GPE: General Purpose Events
7 Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
10 0x0062, // Range Minimum
11 0x0062, // Range Maximum
16 0x0066, // Range Minimum
17 0x0066, // Range Maximum
23 #include "acpi/ec_ram.asl"
26 Method (_REG, 2, Serialized) // _REG: Region Availability
28 Debug = Concatenate("EC: _REG", Concatenate(ToHexString(Arg0), Concatenate(" ", ToHexString(Arg1))))
29 If ((Arg0 == 0x03) && (Arg1 == One)) {
30 // Enable hardware touchpad lock, airplane mode, and keyboard backlight keys
33 // Enable software display brightness keys
36 // Set current AC state
38 // Update battery information and status
44 Notify(^^^^BAT0, Zero)
48 // EC is now available
51 // Reset System76 Device
57 Method (PTS, 1, Serialized) {
58 Debug = Concatenate("EC: PTS: ", ToHexString(Arg0))
60 // Save ECOS during sleep
68 Method (WAK, 1, Serialized) {
69 Debug = Concatenate("EC: WAK: ", ToHexString(Arg0))
71 // Restore ECOS after sleep
74 // Set current AC state
77 // Update battery information and status
83 Notify(^^^^BAT0, Zero)
85 // Reset System76 Device
90 Method (_Q0A, 0, NotSerialized) // Touchpad Toggle
92 Debug = "EC: Touchpad Toggle"
95 Method (_Q0B, 0, NotSerialized) // Screen Toggle
97 Debug = "EC: Screen Toggle"
100 Method (_Q0C, 0, NotSerialized) // Mute
105 Method (_Q0D, 0, NotSerialized) // Keyboard Backlight
107 Debug = "EC: Keyboard Backlight"
110 Method (_Q0E, 0, NotSerialized) // Volume Down
112 Debug = "EC: Volume Down"
115 Method (_Q0F, 0, NotSerialized) // Volume Up
117 Debug = "EC: Volume Up"
120 Method (_Q10, 0, NotSerialized) // Switch Video Mode
122 Debug = "EC: Switch Video Mode"
125 Method (_Q11, 0, NotSerialized) // Brightness Down
127 Debug = "EC: Brightness Down"
133 Method (_Q12, 0, NotSerialized) // Brightness Up
135 Debug = "EC: Brightness Up"
141 Method (_Q13, 0, NotSerialized) // Camera Toggle
143 Debug = "EC: Camera Toggle"
146 Method (_Q14, 0, NotSerialized) // Airplane Mode
148 Debug = "EC: Airplane Mode"
152 // TODO: hardware airplane mode
155 Method (_Q15, 0, NotSerialized) // Suspend Button
157 Debug = "EC: Suspend Button"
161 Method (_Q16, 0, NotSerialized) // AC Detect
163 Debug = "EC: AC Detect"
165 Notify (AC, 0x80) // Status Change
168 Notify (^^^^BAT0, 0x81) // Information Change
169 Notify (^^^^BAT0, 0x80) // Status Change
173 Method (_Q17, 0, NotSerialized) // BAT0 Update
175 Debug = "EC: BAT0 Update (17)"
176 Notify (^^^^BAT0, 0x81) // Information Change
179 Method (_Q19, 0, NotSerialized) // BAT0 Update
181 Debug = "EC: BAT0 Update (19)"
182 Notify (^^^^BAT0, 0x81) // Information Change
185 Method (_Q1B, 0, NotSerialized) // Lid Close
187 Debug = "EC: Lid Close"
191 Method (_Q1C, 0, NotSerialized) // Thermal Trip
193 Debug = "EC: Thermal Trip"
195 Notify (\_TZ.TZ0, 0x81) // Thermal Trip Point Change
196 Notify (\_TZ.TZ0, 0x80) // Thermal Status Change
200 Method (_Q1D, 0, NotSerialized) // Power Button
202 Debug = "EC: Power Button"
206 Method (_Q50, 0, NotSerialized) // Other Events
209 If (Local0 == 0x8A) {
210 Debug = "EC: White Keyboard Backlight"
211 Notify (^^^^S76D, 0x80)
212 } ElseIf (Local0 == 0x9F) {
213 Debug = "EC: Color Keyboard Toggle"
214 Notify (^^^^S76D, 0x81)
215 } ElseIf (Local0 == 0x81) {
216 Debug = "EC: Color Keyboard Down"
217 Notify (^^^^S76D, 0x82)
218 } ElseIf (Local0 == 0x82) {
219 Debug = "EC: Color Keyboard Up"
220 Notify (^^^^S76D, 0x83)
221 } ElseIf (Local0 == 0x80) {
222 Debug = "EC: Color Keyboard Color Change"
223 Notify (^^^^S76D, 0x84)
225 Debug = Concatenate("EC: Other: ", ToHexString(Local0))