summaryrefslogtreecommitdiff
path: root/board/waddledoo
diff options
context:
space:
mode:
authorSooraj Govindan <sooraj.govindan@intel.com>2020-08-11 19:49:59 +0530
committerCommit Bot <commit-bot@chromium.org>2020-08-11 22:31:00 +0000
commite834efc7488bc98211084f54fad9da9b584daec1 (patch)
tree153cfb63f3fd6fa29c3c2f22b68e3641e95f9a97 /board/waddledoo
parent63d68b10fb72d0072b6dc3e2d2a9313a7c3213c2 (diff)
downloadchrome-ec-e834efc7488bc98211084f54fad9da9b584daec1.tar.gz
Waddledoo: Add thermistors
This change adds temperature sensors for waddledoo. BUG=b:163486924 BRANCH=None TEST=Verify console "temps" can read temperature. Check ectool tempsinfo all and ectool temps all. Signed-off-by: Sooraj Govindan <sooraj.govindan@intel.com> Change-Id: Icce66d8b57af7932a9737d8d74a2d2139ba82371 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2348744 Tested-by: Sooraj Govindan <sooraj.govindan@intel.corp-partner.google.com> Reviewed-by: Justin TerAvest <teravest@chromium.org> Commit-Queue: Justin TerAvest <teravest@chromium.org>
Diffstat (limited to 'board/waddledoo')
-rw-r--r--board/waddledoo/board.c15
-rw-r--r--board/waddledoo/board.h12
2 files changed, 27 insertions, 0 deletions
diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c
index 085ae07f44..8df0c93c88 100644
--- a/board/waddledoo/board.c
+++ b/board/waddledoo/board.c
@@ -16,6 +16,8 @@
#include "compile_time_macros.h"
#include "driver/accel_bma2x2.h"
#include "driver/accelgyro_bmi_common.h"
+#include "driver/temp_sensor/thermistor.h"
+#include "temp_sensor.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/charger/isl923x.h"
#include "driver/retimer/nb7v904m.h"
@@ -113,6 +115,19 @@ const struct adc_t adc_channels[] = {
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
+/* Thermistors */
+const struct temp_sensor_t temp_sensors[] = {
+ [TEMP_SENSOR_1] = {.name = "Memory",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = get_temp_3v3_51k1_47k_4050b,
+ .idx = ADC_TEMP_SENSOR_1},
+ [TEMP_SENSOR_2] = {.name = "Ambient",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = get_temp_3v3_51k1_47k_4050b,
+ .idx = ADC_TEMP_SENSOR_2},
+};
+BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
+
void board_init(void)
{
int on;
diff --git a/board/waddledoo/board.h b/board/waddledoo/board.h
index d71d8c149b..e008c89814 100644
--- a/board/waddledoo/board.h
+++ b/board/waddledoo/board.h
@@ -116,6 +116,12 @@
#define CONFIG_MKBP_EVENT
#define CONFIG_MKBP_USE_GPIO
+/* Thermistors */
+#define CONFIG_TEMP_SENSOR
+#define CONFIG_THERMISTOR
+#define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B
+#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_EN_PP3300_A
+
#ifndef __ASSEMBLER__
#include "gpio_signal.h"
@@ -150,6 +156,12 @@ enum pwm_channel {
PWM_CH_COUNT,
};
+enum temp_sensor_id {
+ TEMP_SENSOR_1,
+ TEMP_SENSOR_2,
+ TEMP_SENSOR_COUNT
+};
+
int board_is_sourcing_vbus(int port);
#endif /* !__ASSEMBLER__ */