summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/amd/picasso/acpi/cpu.asl29
-rw-r--r--src/soc/amd/picasso/acpi/sb_pci0_fch.asl11
2 files changed, 28 insertions, 12 deletions
diff --git a/src/soc/amd/picasso/acpi/cpu.asl b/src/soc/amd/picasso/acpi/cpu.asl
index 41d5bf5324..8b61b8f921 100644
--- a/src/soc/amd/picasso/acpi/cpu.asl
+++ b/src/soc/amd/picasso/acpi/cpu.asl
@@ -1,8 +1,35 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-/* Required function by EC, Notify OS to re-read CPU tables */
+/*
+ * Wrapper method that calls ALIB function 1 to report current AC/DC state.
+ */
+Method (WAL1)
+{
+ /* Send ALIB Function 1 the AC/DC state */
+ Local0 = Buffer (0x03) {}
+ CreateWordField (Local0, 0, F1SZ)
+ CreateByteField (Local0, 2, F1DA)
+
+ /* First argument is size i.e. 3 bytes */
+ F1SZ = 3
+
+ /*
+ * Second argument is power state i.e. AC or DC.
+ * ALIB expects AC = 0, DC = 1.
+ * PWRS reports AC = 1, DC = 0.
+ *
+ * Hence, need to invert the state of PWRS.
+ */
+ F1DA = \PWRS ^ 1
+
+ Printf ("ALIB call: func 1 params %o", Local0)
+ \_SB.ALIB (1, Local0)
+}
+
Method (PNOT)
{
+ /* Report AC/DC state to ALIB using WAL1() */
+ \WAL1 ()
}
/*
diff --git a/src/soc/amd/picasso/acpi/sb_pci0_fch.asl b/src/soc/amd/picasso/acpi/sb_pci0_fch.asl
index 751c178762..27c46611b3 100644
--- a/src/soc/amd/picasso/acpi/sb_pci0_fch.asl
+++ b/src/soc/amd/picasso/acpi/sb_pci0_fch.asl
@@ -128,17 +128,6 @@ Method(_INI, 0, Serialized) {
/* Determine the OS we're running on */
OSFL()
-
- /* Send ALIB Function 1 the AC/DC state */
- Name(F1BF, Buffer(0x03){})
- CreateWordField(F1BF, 0, F1SZ)
- CreateByteField(F1BF, 2, F1DA)
-
- Store(3, F1SZ)
- Store(\PWRS, F1DA)
-
- \_SB.ALIB(1, F1BF)
-
} /* End Method(_SB._INI) */
Method(OSFL, 0){