summaryrefslogtreecommitdiff
path: root/include/peci.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-11 10:23:16 -0700
committerGerrit <chrome-bot@google.com>2012-10-11 13:47:17 -0700
commit8f2e99da75152c428c6c92b20a13a62a5fcb40d1 (patch)
treec2d3dc52372a79a03c2d503c55ead568c066a7e1 /include/peci.h
parentd1bebbbe66f78d2dcfb9380456a80e7c2f26a662 (diff)
downloadchrome-ec-8f2e99da75152c428c6c92b20a13a62a5fcb40d1.tar.gz
link: Temp sensor read can return an error code
This will be used in a follow-up CL to return specific error codes (not powered, not calibrated, etc.) BUG=chrome-os-partner:15174 BRANCH=link TEST=manual Power on system. 'temps' should return all good temps. Power off system (into S5) Only ECInternal temp should work; others should return Error 1 'gpioset enable_vs 1' and wait a second Now all the I2C temps should display good data, but PECI will still be error 1. Change-Id: I925434e71653ad53ad76bad992a7a8fdeadb088c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35286 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'include/peci.h')
-rw-r--r--include/peci.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/peci.h b/include/peci.h
index e24a3d0c15..4776002a42 100644
--- a/include/peci.h
+++ b/include/peci.h
@@ -16,10 +16,15 @@
* error, retry a bit later. */
int peci_get_cpu_temp(void);
-/* Read the CPU temperature sensor via PECI. This interface is for the
- * temperature sensor module. Returns the temperature in degrees K, or -1 if
- * error. */
-int peci_temp_sensor_get_val(int idx);
+/**
+ * Get the last polled value of the PECI temp sensor.
+ *
+ * @param idx Sensor index to read.
+ * @param temp_ptr Destination for temperature in K.
+ *
+ * @return EC_SUCCESS if successful, non-zero if error.
+ */
+int peci_temp_sensor_get_val(int idx, int *temp_ptr);
/* Temperature polling of CPU temperature sensor via PECI. */
int peci_temp_sensor_poll(void);