From d3fdf5e6f3243484328d3d954a1924b355ff9c21 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 12 Dec 2013 11:03:17 -0800 Subject: Add stubs for DPTF thermal thresholds This adds three new registers to the ACPI->EC interface, which will allow the AP to set/clear two DPTF thermal threshold points for each temp sensor. The registers are EC_ACPI_MEM_TEMP_ID 0x05 EC_ACPI_MEM_TEMP_THRESHOLD 0x06 EC_ACPI_MEM_TEMP_COMMIT 0x07 It doesn't actually do anything yet, but the AP can now write those values. BUG=chrome-os-partner:23970 BRANCH=none TEST=manual On the host: dptf() { [ "$#" -eq "2" ] || return; iotools io_write8 0x66 0x81 iotools io_write8 0x62 $1 iotools io_write8 0x62 $2 } Now watch the EC console while running on the host: dptf 5 1 dptf 6 80 dptf 7 2 dptf 7 3 The EC should say DPTF sensor 1, threshold 7 C, index 0, enabled DPTF sensor 1, threshold 7 C, index 1, enabled Change-Id: I71fa57e3ca7c7b5bb8892e63212bf294b44dece5 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/179778 Reviewed-by: Duncan Laurie Reviewed-by: Randall Spangler --- include/dptf.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/dptf.h') diff --git a/include/dptf.h b/include/dptf.h index 48be860f2d..4213426255 100644 --- a/include/dptf.h +++ b/include/dptf.h @@ -11,7 +11,13 @@ /* 0-100% sets fixed duty cycle, out of range means let the EC drive */ void dptf_set_fan_duty_target(int pct); -/* 0-100% if in duty mode. -1 if not */ +/* 0-100% if in duty mode. -1 if not */ int dptf_get_fan_duty_target(void); +/* Each temp sensor can have up to two thresholds */ +void dptf_set_temp_threshold(int sensor_id, /* zero-based sensor index */ + int temp, /* in degrees K */ + int idx, /* which threshold (0 or 1) */ + int enable); /* true = on, false = off */ + #endif /* __CROS_EC_DPTF_H */ -- cgit v1.2.1