summaryrefslogtreecommitdiff
path: root/board/waddledoo
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2020-07-09 18:58:33 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-14 05:22:14 +0000
commitac66d1eb5c19e8c5b974617f2ccd0dc571027cf8 (patch)
tree1aa6f9f9bae66104e04eae8880dccce9e8d3b1a2 /board/waddledoo
parent81abfa1eba1195c87b206711f59d4a92675845b2 (diff)
downloadchrome-ec-ac66d1eb5c19e8c5b974617f2ccd0dc571027cf8.tar.gz
dedede: Move adc channel to board variant
Dedede family may have different temp sensors for other ADCs channel. This patch moves adc channel to board variant. BUG=none BRANCH=none TEST=make buildall -j Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Id34a924fc9431a553a1467068c6ccee6111102bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2289478 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/waddledoo')
-rw-r--r--board/waddledoo/board.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/board/waddledoo/board.c b/board/waddledoo/board.c
index 590a240add..41e93fc8ef 100644
--- a/board/waddledoo/board.c
+++ b/board/waddledoo/board.c
@@ -80,6 +80,39 @@ static void sub_hdmi_hpd_interrupt(enum gpio_signal s)
#include "gpio_list.h"
+/* ADC channels */
+const struct adc_t adc_channels[] = {
+ [ADC_TEMP_SENSOR_1] = {
+ .name = "TEMP_SENSOR1",
+ .input_ch = NPCX_ADC_CH0,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
+ [ADC_TEMP_SENSOR_2] = {
+ .name = "TEMP_SENSOR2",
+ .input_ch = NPCX_ADC_CH1,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
+ [ADC_SUB_ANALOG] = {
+ .name = "SUB_ANALOG",
+ .input_ch = NPCX_ADC_CH2,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
+ [ADC_VSNS_PP3300_A] = {
+ .name = "PP3300_A_PGOOD",
+ .input_ch = NPCX_ADC_CH9,
+ .factor_mul = ADC_MAX_VOLT,
+ .factor_div = ADC_READ_MAX + 1,
+ .shift = 0,
+ },
+};
+BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
+
void board_init(void)
{
int on;