diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2021-03-15 16:47:01 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-19 22:14:43 +0000 |
commit | 1275c78e5e75df6e9016015051ae0452b148f83b (patch) | |
tree | 9c9e819cbf0b02f22af1b1f29342215b2515539e /baseboard/intelrvp/ite_ec.c | |
parent | ce1407c152ffc13998eef13ec3f2f030b8b2205e (diff) | |
download | chrome-ec-1275c78e5e75df6e9016015051ae0452b148f83b.tar.gz |
intelrvp: cleanup: Shuffle the code
Shuffled the code to cleanup following
1. Moved the temperature sensor code from CONFIG_FANS to
CONFIG_TEMP_SENSOR to avoid build errors when the FAN is disabled.
2. Moved ADC code to respective EC chip code as the ADC structure is
not same for all the EC chip variants.
3. Moved PD reset code from EC chip to MECC files so that PD specific
code can be added if needed.
BUG=none
BRANCH=none
TEST=make buildall -j
Change-Id: I614ce0c011f5080e46cd1095a534884925c13b2c
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2762806
Reviewed-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'baseboard/intelrvp/ite_ec.c')
-rw-r--r-- | baseboard/intelrvp/ite_ec.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/baseboard/intelrvp/ite_ec.c b/baseboard/intelrvp/ite_ec.c index 44ddf6d53e..9254a3b39b 100644 --- a/baseboard/intelrvp/ite_ec.c +++ b/baseboard/intelrvp/ite_ec.c @@ -5,6 +5,7 @@ /* Intel BASEBOARD-RVP ITE EC specific configuration */ +#include "adc_chip.h" #include "common.h" #include "it83xx_pd.h" #include "keyboard_scan.h" @@ -13,12 +14,6 @@ #include "timer.h" #include "usb_pd_tcpm.h" -/* Reset PD MCU */ -void board_reset_pd_mcu(void) -{ - /* Not applicable for ITE TCPC */ -} - /* Keyboard scan setting */ struct keyboard_scan_config keyscan_config = { .output_settle_us = 35, @@ -33,6 +28,39 @@ struct keyboard_scan_config keyscan_config = { }, }; +/* ADC channels */ +const struct adc_t adc_channels[] = { + [ADC_TEMP_SNS_AMBIENT] = { + .name = "ADC_TEMP_SNS_AMBIENT", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = ADC_TEMP_SNS_AMBIENT_CHANNEL, + }, + [ADC_TEMP_SNS_DDR] = { + .name = "ADC_TEMP_SNS_DDR", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = ADC_TEMP_SNS_DDR_CHANNEL, + }, + [ADC_TEMP_SNS_SKIN] = { + .name = "ADC_TEMP_SNS_SKIN", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = ADC_TEMP_SNS_SKIN_CHANNEL, + }, + [ADC_TEMP_SNS_VR] = { + .name = "ADC_TEMP_SNS_VR", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = ADC_TEMP_SNS_VR_CHANNEL, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); + /* * PWM HW channelx binding tachometer channelx for fan control. * Four tachometer input pins but two tachometer modules only, |