summaryrefslogtreecommitdiff
path: root/baseboard/cherry/baseboard.c
diff options
context:
space:
mode:
authorSue Chen <sue.chen@quanta.corp-partner.google.com>2021-05-12 16:02:37 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-21 06:33:36 +0000
commit0b39ad253f3e7a8ef8b55a2759a62c453e204102 (patch)
treef7beb78c5ce6404c286321e9769d0e914acc4d77 /baseboard/cherry/baseboard.c
parent7173c40fc78aea6797a8bcc402e28b4453ca2f1a (diff)
downloadchrome-ec-0b39ad253f3e7a8ef8b55a2759a62c453e204102.tar.gz
cherry: Add temp sensor for charger
Using ADC channel 7 to read charger temperature. BUG=b:187463588 BRANCH=none TEST=Console commad "temps" and ectool can read the temperature. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I031523859c0ff91f0041263ecf6a4a48048da819 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891283 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'baseboard/cherry/baseboard.c')
-rw-r--r--baseboard/cherry/baseboard.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/baseboard/cherry/baseboard.c b/baseboard/cherry/baseboard.c
index 55131ebce5..6fe3c359ef 100644
--- a/baseboard/cherry/baseboard.c
+++ b/baseboard/cherry/baseboard.c
@@ -107,9 +107,19 @@ const struct adc_t adc_channels[] = {
{"CHARGER_AMON_R", ADC_MAX_MVOLT * 1000 / 17.97, ADC_READ_MAX + 1, 0,
CHIP_ADC_CH3},
{"CHARGER_PMON", ADC_MAX_MVOLT, ADC_READ_MAX + 1, 0, CHIP_ADC_CH6},
+ {"TEMP_SENSOR_CHG", ADC_MAX_MVOLT, ADC_READ_MAX + 1, 0, CHIP_ADC_CH7},
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
+const struct temp_sensor_t temp_sensors[] = {
+ [TEMP_SENSOR_CHARGER] = {
+ .name = "Charger",
+ .type = TEMP_SENSOR_TYPE_BOARD,
+ .read = get_temp_3v3_30k9_47k_4050b,
+ .idx = ADC_TEMP_SENSOR_CHARGER,
+ },
+};
+
/* PPC */
struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_MAX_COUNT] = {
{