diff options
author | Devin Lu <Devin.Lu@quantatw.com> | 2020-07-09 18:58:33 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-14 05:22:14 +0000 |
commit | ac66d1eb5c19e8c5b974617f2ccd0dc571027cf8 (patch) | |
tree | 1aa6f9f9bae66104e04eae8880dccce9e8d3b1a2 /board/boten | |
parent | 81abfa1eba1195c87b206711f59d4a92675845b2 (diff) | |
download | chrome-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/boten')
-rw-r--r-- | board/boten/board.c | 34 | ||||
-rw-r--r-- | board/boten/board.h | 9 |
2 files changed, 43 insertions, 0 deletions
diff --git a/board/boten/board.c b/board/boten/board.c index 8a11679fc2..44670d2041 100644 --- a/board/boten/board.c +++ b/board/boten/board.c @@ -5,6 +5,7 @@ /* Waddledee board-specific configuration */ +#include "adc_chip.h" #include "button.h" #include "charge_manager.h" #include "charge_state_v2.h" @@ -64,6 +65,39 @@ static void c0_ccsbu_ovp_interrupt(enum gpio_signal s) /* Must come after other header files and interrupt handler declarations */ #include "gpio_list.h" +/* ADC channels */ +const struct adc_t adc_channels[] = { + [ADC_VSNS_PP3300_A] = { + .name = "PP3300_A_PGOOD", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH0 + }, + [ADC_TEMP_SENSOR_1] = { + .name = "TEMP_SENSOR1", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH2 + }, + [ADC_TEMP_SENSOR_2] = { + .name = "TEMP_SENSOR2", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH3 + }, + [ADC_SUB_ANALOG] = { + .name = "SUB_ANALOG", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH13 + }, +}; +BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); + /* BC 1.2 chips */ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = { { diff --git a/board/boten/board.h b/board/boten/board.h index b2f17ba47d..289925742d 100644 --- a/board/boten/board.h +++ b/board/boten/board.h @@ -96,6 +96,15 @@ enum sensor_id { SENSOR_COUNT }; +/* ADC channels */ +enum adc_channel { + ADC_VSNS_PP3300_A, /* ADC0 */ + ADC_TEMP_SENSOR_1, /* ADC2 */ + ADC_TEMP_SENSOR_2, /* ADC3 */ + ADC_SUB_ANALOG, /* ADC13 */ + ADC_CH_COUNT +}; + enum temp_sensor_id { TEMP_SENSOR_1, TEMP_SENSOR_2, |