Update ACPI in system76 cfl-h mainboard
This commit is contained in:
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select INTEL_LPSS_UART_FOR_CONSOLE
|
select INTEL_LPSS_UART_FOR_CONSOLE
|
||||||
# select MAINBOARD_HAS_SPI_TPM_CR50
|
# select MAINBOARD_HAS_SPI_TPM_CR50
|
||||||
# select MAINBOARD_HAS_TPM2
|
# select MAINBOARD_HAS_TPM2
|
||||||
|
select NO_UART_ON_SUPERIO
|
||||||
select SOC_INTEL_CANNONLAKE_PCH_H
|
select SOC_INTEL_CANNONLAKE_PCH_H
|
||||||
select SOC_INTEL_COFFEELAKE
|
select SOC_INTEL_COFFEELAKE
|
||||||
select SOC_INTEL_COMMON_ACPI_EC_PTS_WAK
|
select SOC_INTEL_COMMON_ACPI_EC_PTS_WAK
|
||||||
|
@@ -40,10 +40,10 @@ Device (EC0)
|
|||||||
{
|
{
|
||||||
Debug = Concatenate("EC: _REG", Concatenate(ToHexString(Arg0), Concatenate(" ", ToHexString(Arg1))))
|
Debug = Concatenate("EC: _REG", Concatenate(ToHexString(Arg0), Concatenate(" ", ToHexString(Arg1))))
|
||||||
If (((Arg0 == 0x03) && (Arg1 == One))) {
|
If (((Arg0 == 0x03) && (Arg1 == One))) {
|
||||||
// Enable software touchpad lock and airplane mode keys
|
// Enable hardware touchpad lock, airplane mode, and keyboard backlight keys
|
||||||
ECOS = 2
|
ECOS = 1
|
||||||
|
|
||||||
// Enable software backlight keys
|
// Enable software display brightness keys
|
||||||
WINF = 1
|
WINF = 1
|
||||||
|
|
||||||
// Set current AC state
|
// Set current AC state
|
||||||
@@ -56,12 +56,16 @@ Device (EC0)
|
|||||||
|
|
||||||
// EC is now available
|
// EC is now available
|
||||||
ECOK = Arg1
|
ECOK = Arg1
|
||||||
|
|
||||||
|
// Reset System76 Device
|
||||||
|
^^^^S76D.RSET()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Method (PTS, 1, Serialized) {
|
Method (PTS, 1, Serialized) {
|
||||||
Debug = Concatenate("EC: PTS: ", ToHexString(Arg0))
|
Debug = Concatenate("EC: PTS: ", ToHexString(Arg0))
|
||||||
If (ECOK) {
|
If (ECOK) {
|
||||||
|
// Clear wake cause
|
||||||
WFNO = Zero
|
WFNO = Zero
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,11 +75,19 @@ Device (EC0)
|
|||||||
If (ECOK) {
|
If (ECOK) {
|
||||||
// Set current AC state
|
// Set current AC state
|
||||||
^^^^AC.ACFG = ADP
|
^^^^AC.ACFG = ADP
|
||||||
|
|
||||||
// Update battery information and status
|
// Update battery information and status
|
||||||
^^^^BAT0.UPBI()
|
^^^^BAT0.UPBI()
|
||||||
^^^^BAT0.UPBS()
|
^^^^BAT0.UPBS()
|
||||||
|
|
||||||
|
// Notify of changes
|
||||||
Notify(^^^^AC, Zero)
|
Notify(^^^^AC, Zero)
|
||||||
Notify(^^^^BAT0, Zero)
|
Notify(^^^^BAT0, Zero)
|
||||||
|
|
||||||
|
Sleep (1000)
|
||||||
|
|
||||||
|
// Reset System76 Device
|
||||||
|
^^^^S76D.RSET()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,8 +146,11 @@ Device (EC0)
|
|||||||
Method (_Q14, 0, NotSerialized) // Airplane Mode
|
Method (_Q14, 0, NotSerialized) // Airplane Mode
|
||||||
{
|
{
|
||||||
Debug = "EC: Airplane Mode"
|
Debug = "EC: Airplane Mode"
|
||||||
|
// Only send HIDD message when hardware airplane mode not in use
|
||||||
|
If (ECOS == 2) {
|
||||||
^^^^HIDD.HPEM (8)
|
^^^^HIDD.HPEM (8)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Method (_Q15, 0, NotSerialized) // Suspend Button
|
Method (_Q15, 0, NotSerialized) // Suspend Button
|
||||||
{
|
{
|
||||||
|
@@ -20,6 +20,7 @@ Scope (\_SB) {
|
|||||||
#include "hid.asl"
|
#include "hid.asl"
|
||||||
#include "lid.asl"
|
#include "lid.asl"
|
||||||
#include "s76.asl"
|
#include "s76.asl"
|
||||||
|
#include "sleep.asl"
|
||||||
}
|
}
|
||||||
|
|
||||||
Scope (_GPE) {
|
Scope (_GPE) {
|
||||||
|
@@ -23,6 +23,39 @@ Device (S76D) {
|
|||||||
Name (_HID, "17761776")
|
Name (_HID, "17761776")
|
||||||
Name (_UID, 0)
|
Name (_UID, 0)
|
||||||
|
|
||||||
|
Method (RSET, 0, Serialized) {
|
||||||
|
Debug = "S76D: RSET"
|
||||||
|
SAPL(0)
|
||||||
|
SKBL(0)
|
||||||
|
#if COLOR_KEYBOARD
|
||||||
|
SKBC(0xFFFFFF)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
// Get Airplane LED
|
||||||
Method (GAPL, 0, Serialized) {
|
Method (GAPL, 0, Serialized) {
|
||||||
If (^^PCI0.LPCB.EC0.ECOK) {
|
If (^^PCI0.LPCB.EC0.ECOK) {
|
||||||
|
24
src/mainboard/system76/cfl-h/acpi/sleep.asl
Normal file
24
src/mainboard/system76/cfl-h/acpi/sleep.asl
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the coreboot project.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 System76
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; version 2 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Method called from _PTS prior to enter sleep state */
|
||||||
|
Method (MPTS, 1) {
|
||||||
|
\_SB.PCI0.LPCB.EC0.PTS (Arg0)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Method called from _WAK prior to wakeup */
|
||||||
|
Method (MWAK, 1) {
|
||||||
|
\_SB.PCI0.LPCB.EC0.WAK (Arg0)
|
||||||
|
}
|
Reference in New Issue
Block a user