summaryrefslogtreecommitdiff
path: root/src/mainboard/system76/kbl-u/acpi/s76.asl
diff options
context:
space:
mode:
authorJeremy Soller <jeremy@system76.com>2021-04-09 10:51:31 -0600
committerPatrick Georgi <pgeorgi@google.com>2021-11-02 19:23:15 +0000
commit9037f0a831d2054371484babedc964550308dd59 (patch)
treed9167530e172a0238500bc50ed65c3d91ee9af67 /src/mainboard/system76/kbl-u/acpi/s76.asl
parente747bdda1b466f4b5ab2267c28ebf254d20fdafc (diff)
mb/system76/kbl-u: Add System76 Galago Pro 3 Rev B
Change-Id: I25464d3a2dd02e613a8392db90b1eaf0f9b3ca70 Signed-off-by: Jeremy Soller <jeremy@system76.com> Signed-off-by: Tim Crawford <tcrawford@system76.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52217 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/mainboard/system76/kbl-u/acpi/s76.asl')
-rw-r--r--src/mainboard/system76/kbl-u/acpi/s76.asl84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/mainboard/system76/kbl-u/acpi/s76.asl b/src/mainboard/system76/kbl-u/acpi/s76.asl
new file mode 100644
index 0000000000..399e569734
--- /dev/null
+++ b/src/mainboard/system76/kbl-u/acpi/s76.asl
@@ -0,0 +1,84 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+// Notifications:
+// 0x80 - hardware backlight toggle
+// 0x81 - backlight toggle
+// 0x82 - backlight down
+// 0x83 - backlight up
+// 0x84 - backlight color change
+Device (S76D) {
+ Name (_HID, "17761776")
+ Name (_UID, 0)
+
+ Method (RSET, 0, Serialized) {
+ Debug = "S76D: RSET"
+ SAPL(0)
+ SKBL(0)
+ }
+
+ Method (INIT, 0, Serialized) {
+ Debug = "S76D: INIT"
+ RSET()
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ // Set flags to use software control
+ ^^PCI0.LPCB.EC0.ECOS = 2
+ Return (0)
+ } Else {
+ Return (1)
+ }
+ }
+
+ Method (FINI, 0, Serialized) {
+ Debug = "S76D: FINI"
+ RSET()
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ // Set flags to use hardware control
+ ^^PCI0.LPCB.EC0.ECOS = 1
+ Return (0)
+ } Else {
+ Return (1)
+ }
+ }
+
+ // Get Airplane LED
+ Method (GAPL, 0, Serialized) {
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ If (^^PCI0.LPCB.EC0.AIRP & 0x40) {
+ Return (1)
+ }
+ }
+ Return (0)
+ }
+
+ // Set Airplane LED
+ Method (SAPL, 1, Serialized) {
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ If (Arg0) {
+ ^^PCI0.LPCB.EC0.AIRP |= 0x40
+ } Else {
+ ^^PCI0.LPCB.EC0.AIRP &= 0xBF
+ }
+ }
+ }
+
+ // Get KB LED
+ Method (GKBL, 0, Serialized) {
+ Local0 = 0
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ ^^PCI0.LPCB.EC0.FDAT = One
+ ^^PCI0.LPCB.EC0.FCMD = 0xCA
+ Local0 = ^^PCI0.LPCB.EC0.FBUF
+ ^^PCI0.LPCB.EC0.FCMD = Zero
+ }
+ Return (Local0)
+ }
+
+ // Set KB Led
+ Method (SKBL, 1, Serialized) {
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ ^^PCI0.LPCB.EC0.FDAT = Zero
+ ^^PCI0.LPCB.EC0.FBUF = Arg0
+ ^^PCI0.LPCB.EC0.FCMD = 0xCA
+ }
+ }
+}