blob: babca3a82a31572640b11f06cac3010d934ed20d [file] [log] [blame]
Jeremy Soller9037f0a2021-04-09 10:51:31 -06001/* SPDX-License-Identifier: GPL-2.0-only */
2
3// Notifications:
4// 0x80 - hardware backlight toggle
5// 0x81 - backlight toggle
6// 0x82 - backlight down
7// 0x83 - backlight up
8// 0x84 - backlight color change
9Device (S76D) {
10 Name (_HID, "17761776")
11 Name (_UID, 0)
12
13 Method (RSET, 0, Serialized) {
14 Debug = "S76D: RSET"
15 SAPL(0)
16 SKBL(0)
17 }
18
19 Method (INIT, 0, Serialized) {
20 Debug = "S76D: INIT"
21 RSET()
22 If (^^PCI0.LPCB.EC0.ECOK) {
23 // Set flags to use software control
24 ^^PCI0.LPCB.EC0.ECOS = 2
25 Return (0)
26 } Else {
27 Return (1)
28 }
29 }
30
31 Method (FINI, 0, Serialized) {
32 Debug = "S76D: FINI"
33 RSET()
34 If (^^PCI0.LPCB.EC0.ECOK) {
35 // Set flags to use hardware control
36 ^^PCI0.LPCB.EC0.ECOS = 1
37 Return (0)
38 } Else {
39 Return (1)
40 }
41 }
42
43 // Get Airplane LED
44 Method (GAPL, 0, Serialized) {
45 If (^^PCI0.LPCB.EC0.ECOK) {
46 If (^^PCI0.LPCB.EC0.AIRP & 0x40) {
47 Return (1)
48 }
49 }
50 Return (0)
51 }
52
53 // Set Airplane LED
54 Method (SAPL, 1, Serialized) {
55 If (^^PCI0.LPCB.EC0.ECOK) {
56 If (Arg0) {
57 ^^PCI0.LPCB.EC0.AIRP |= 0x40
58 } Else {
59 ^^PCI0.LPCB.EC0.AIRP &= 0xBF
60 }
61 }
62 }
63
64 // Get KB LED
65 Method (GKBL, 0, Serialized) {
66 Local0 = 0
67 If (^^PCI0.LPCB.EC0.ECOK) {
Felix Singerdfbb6342022-12-26 08:39:35 +010068 ^^PCI0.LPCB.EC0.FDAT = 1
Jeremy Soller9037f0a2021-04-09 10:51:31 -060069 ^^PCI0.LPCB.EC0.FCMD = 0xCA
70 Local0 = ^^PCI0.LPCB.EC0.FBUF
Felix Singerfa06bcb2022-12-26 09:32:47 +010071 ^^PCI0.LPCB.EC0.FCMD = 0
Jeremy Soller9037f0a2021-04-09 10:51:31 -060072 }
73 Return (Local0)
74 }
75
76 // Set KB Led
77 Method (SKBL, 1, Serialized) {
78 If (^^PCI0.LPCB.EC0.ECOK) {
Felix Singerfa06bcb2022-12-26 09:32:47 +010079 ^^PCI0.LPCB.EC0.FDAT = 0
Jeremy Soller9037f0a2021-04-09 10:51:31 -060080 ^^PCI0.LPCB.EC0.FBUF = Arg0
81 ^^PCI0.LPCB.EC0.FCMD = 0xCA
82 }
83 }
84}