summaryrefslogtreecommitdiffstats
path: root/src/ec/system76
diff options
context:
space:
mode:
authorJeremy Soller <jeremy@system76.com>2021-01-14 16:38:39 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-01-18 07:27:26 +0000
commit7cc513557d41ea86e4c5ce4a9dba14b879c8b7b2 (patch)
treeb4392491c9af23cb409968d21d2518d497e77d7b /src/ec/system76
parenta2b21c23d58d7f8faa0c72e95b35f40c143b45f9 (diff)
downloadcoreboot-7cc513557d41ea86e4c5ce4a9dba14b879c8b7b2.tar.gz
coreboot-7cc513557d41ea86e4c5ce4a9dba14b879c8b7b2.tar.bz2
coreboot-7cc513557d41ea86e4c5ce4a9dba14b879c8b7b2.zip
ec/system76/ec: Add fan and temperature reporting
Signed-off-by: Jeremy Soller <jeremy@system76.com> Signed-off-by: Tim Crawford <tcrawford@system76.com> Change-Id: Iee19e7518ffaacd9a847cb6d28c839d4ec464514 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49465 Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/ec/system76')
-rw-r--r--src/ec/system76/ec/acpi/s76.asl47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ec/system76/ec/acpi/s76.asl b/src/ec/system76/ec/acpi/s76.asl
index 7beb50b8139e..a2bb310938bc 100644
--- a/src/ec/system76/ec/acpi/s76.asl
+++ b/src/ec/system76/ec/acpi/s76.asl
@@ -111,4 +111,51 @@ Device (S76D) {
}
}
#endif // CONFIG(EC_SYSTEM76_EC_COLOR_KEYBOARD)
+
+ // Fan names
+ Method (NFAN, 0, Serialized) {
+ Return (Package() {
+ "CPU fan",
+ })
+ }
+
+ // Get fan duty cycle and RPM as a single value
+ Method (GFAN, 1, Serialized) {
+ Local0 = 0
+ Local1 = 0
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ If (Arg0 == 0) {
+ Local0 = ^^PCI0.LPCB.EC0.DUT1
+ Local1 = ^^PCI0.LPCB.EC0.RPM1
+ } ElseIf (Arg0 == 1) {
+ Local0 = ^^PCI0.LPCB.EC0.DUT2
+ Local1 = ^^PCI0.LPCB.EC0.RPM2
+ }
+ }
+ If (Local1 != 0) {
+ // 60 * (EC frequency / 120) / 2
+ Local1 = 2156250 / Local1
+ }
+ Return ((Local1 << 8) | Local0)
+ }
+
+ // Temperature names
+ Method (NTMP, 0, Serialized) {
+ Return (Package() {
+ "CPU temp",
+ })
+ }
+
+ // Get temperature
+ Method (GTMP, 1, Serialized) {
+ Local0 = 0;
+ If (^^PCI0.LPCB.EC0.ECOK) {
+ If (Arg0 == 0) {
+ Local0 = ^^PCI0.LPCB.EC0.TMP1
+ } ElseIf (Arg0 == 1) {
+ Local0 = ^^PCI0.LPCB.EC0.TMP2
+ }
+ }
+ Return (Local0)
+ }
}