1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EisaId ("PNP0C09") /* Embedded Controller Device */)
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 Printf ("EC: _REG %o %o", ToHexString(Arg0), ToHexString(Arg1))
29 If ((Arg0 == 0x03) && (Arg1 == 1)) {
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
48 // EC is now available
51 // Reset System76 Device
57 Method (PTS, 1, Serialized) {
58 Printf ("EC: PTS: %o", ToHexString(Arg0))
60 // Save ECOS during sleep
68 Method (WAK, 1, Serialized) {
69 Printf ("EC: WAK: %o", ToHexString(Arg0))
71 // Restore ECOS after sleep
74 // Set current AC state
77 // Update battery information and status
85 // Reset System76 Device
90 Method (_Q0A, 0, NotSerialized) // Touchpad Toggle
92 Printf ("EC: Touchpad Toggle")
95 Method (_Q0B, 0, NotSerialized) // Screen Toggle
97 Printf ("EC: Screen Toggle")
100 Method (_Q0C, 0, NotSerialized) // Mute
105 Method (_Q0D, 0, NotSerialized) // Keyboard Backlight
107 Printf ("EC: Keyboard Backlight")
110 Method (_Q0E, 0, NotSerialized) // Volume Down
112 Printf ("EC: Volume Down")
115 Method (_Q0F, 0, NotSerialized) // Volume Up
117 Printf ("EC: Volume Up")
120 Method (_Q10, 0, NotSerialized) // Switch Video Mode
122 Printf ("EC: Switch Video Mode")
125 Method (_Q11, 0, NotSerialized) // Brightness Down
127 Printf ("EC: Brightness Down")
133 Method (_Q12, 0, NotSerialized) // Brightness Up
135 Printf ("EC: Brightness Up")
141 Method (_Q13, 0, NotSerialized) // Camera Toggle
143 Printf ("EC: Camera Toggle")
146 Method (_Q14, 0, NotSerialized) // Airplane Mode
148 Printf ("EC: Airplane Mode")
152 // TODO: hardware airplane mode
155 Method (_Q15, 0, NotSerialized) // Suspend Button
157 Printf ("EC: Suspend Button")
161 Method (_Q16, 0, NotSerialized) // AC Detect
163 Printf ("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 Printf ("EC: BAT0 Update (17)")
176 Notify (^^^^BAT0, 0x81) // Information Change
179 Method (_Q19, 0, NotSerialized) // BAT0 Update
181 Printf ("EC: BAT0 Update (19)")
182 Notify (^^^^BAT0, 0x81) // Information Change
185 Method (_Q1B, 0, NotSerialized) // Lid Close
187 Printf ("EC: Lid Close")
191 Method (_Q1C, 0, NotSerialized) // Thermal Trip
193 Printf ("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 Printf ("EC: Power Button")
206 Method (_Q50, 0, NotSerialized) // Other Events
209 If (Local0 == 0x8A) {
210 Printf ("EC: White Keyboard Backlight")
211 Notify (^^^^S76D, 0x80)
212 } ElseIf (Local0 == 0x9F) {
213 Printf ("EC: Color Keyboard Toggle")
214 Notify (^^^^S76D, 0x81)
215 } ElseIf (Local0 == 0x81) {
216 Printf ("EC: Color Keyboard Down")
217 Notify (^^^^S76D, 0x82)
218 } ElseIf (Local0 == 0x82) {
219 Printf ("EC: Color Keyboard Up")
220 Notify (^^^^S76D, 0x83)
221 } ElseIf (Local0 == 0x80) {
222 Printf ("EC: Color Keyboard Color Change")
223 Notify (^^^^S76D, 0x84)
225 Printf ("EC: Other: %o", ToHexString(Local0))