summaryrefslogtreecommitdiff
path: root/driver/temp_sensor/ec_adc.h
diff options
context:
space:
mode:
authorWonjoon Lee <woojoo.lee@samsung.com>2015-09-02 13:41:27 +0900
committerchrome-bot <chrome-bot@chromium.org>2015-09-11 00:45:38 -0700
commit8acda59faaf9b71768a95ec2c36eb756c7643194 (patch)
tree8fb56f59b64716bb4d2c3bcb7b6390e128f398a9 /driver/temp_sensor/ec_adc.h
parent502dc50f04c5df787e95982cef4971b20e501cba (diff)
downloadchrome-ec-8acda59faaf9b71768a95ec2c36eb756c7643194.tar.gz
driver/temp_sensor: Add support thermistor on EC's own ADC
Add support for ADC / thermistor reads on the EC's ADC This will support now only ncp15wb but we can expand it at future time. BUG=chrome-os-partner:44764 TEST=make buildall -j Manual on celes with subsequent commit. Boot to S0, run "temps". Verify that temperatures are. See temperature is changing BRANCH=None Change-Id: If26d24b803dcff00c4c24e4e1f71d3b0de8e6738 Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/296872 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'driver/temp_sensor/ec_adc.h')
-rw-r--r--driver/temp_sensor/ec_adc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/driver/temp_sensor/ec_adc.h b/driver/temp_sensor/ec_adc.h
new file mode 100644
index 0000000000..8ff213e95d
--- /dev/null
+++ b/driver/temp_sensor/ec_adc.h
@@ -0,0 +1,24 @@
+/* Copyright 2015 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* ec_adc which uses adc and thermistors module for Chrome EC
+ * Some EC has it's own ADC modules, define here EC's max ADC channels.
+ * We can consider every channel as a thermal sensor.
+ */
+
+#ifndef __CROS_EC_TEMP_SENSOR_EC_ADC_H
+#define __CROS_EC_TEMP_SENSOR_EC_ADC_H
+
+/**
+ * Get the latest value from the sensor.
+ *
+ * @param idx ADC channel to read.
+ * @param temp_ptr Destination for temperature in K.
+ *
+ * @return EC_SUCCESS if successful, non-zero if error.
+ */
+int ec_adc_get_val(int idx, int *temp_ptr);
+
+#endif /* __CROS_EC_TEMP_SENSOR_EC_ADC_H */