diff options
-rw-r--r-- | baseboard/volteer/baseboard.c | 36 | ||||
-rw-r--r-- | baseboard/volteer/baseboard.h | 8 | ||||
-rw-r--r-- | board/volteer/board.h | 3 |
3 files changed, 43 insertions, 4 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c index 7a2eb207dc..5c780d74b2 100644 --- a/baseboard/volteer/baseboard.c +++ b/baseboard/volteer/baseboard.c @@ -4,7 +4,7 @@ */ /* Volteer family-specific configuration */ -#include "baseboard.h" +#include "adc_chip.h" #include "battery.h" #include "charge_state.h" #include "gpio.h" @@ -14,6 +14,40 @@ #include "pwm_chip.h" /******************************************************************************/ +/* ADC configuration */ +const struct adc_t adc_channels[] = { + [ADC_TEMP_SENSOR_1_CHARGER] = { + .name = "TEMP_CHARGER", + .input_ch = NPCX_ADC_CH0, + .factor_mul = ADC_MAX_VOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + }, + [ADC_TEMP_SENSOR_2_PP3300_REGULATOR] = { + .name = "TEMP_PP3300_REGULATOR", + .input_ch = NPCX_ADC_CH1, + .factor_mul = ADC_MAX_VOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + }, + [ADC_TEMP_SENSOR_3_DDR_SOC] = { + .name = "TEMP_DDR_SOC", + .input_ch = NPCX_ADC_CH8, + .factor_mul = ADC_MAX_VOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + }, + [ADC_TEMP_SENSOR_4_FAN] = { + .name = "TEMP_FAN", + .input_ch = NPCX_ADC_CH3, + .factor_mul = ADC_MAX_VOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); + +/******************************************************************************/ /* Wake up pins */ const enum gpio_signal hibernate_wake_pins[] = { GPIO_LID_OPEN, diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h index c022a78b32..c60b75a5a3 100644 --- a/baseboard/volteer/baseboard.h +++ b/baseboard/volteer/baseboard.h @@ -85,6 +85,14 @@ #ifndef __ASSEMBLER__ +enum adc_channel { + ADC_TEMP_SENSOR_1_CHARGER, + ADC_TEMP_SENSOR_2_PP3300_REGULATOR, + ADC_TEMP_SENSOR_3_DDR_SOC, + ADC_TEMP_SENSOR_4_FAN, + ADC_CH_COUNT +}; + enum pwm_channel { PWM_CH_LED1_BLUE = 0, PWM_CH_LED2_GREEN, diff --git a/board/volteer/board.h b/board/volteer/board.h index b7e7671aff..990dd82194 100644 --- a/board/volteer/board.h +++ b/board/volteer/board.h @@ -22,9 +22,6 @@ #define CONFIG_POWER_BUTTON -/* Config options automatically enabled by NPCX, re-enable once support added */ -#undef CONFIG_ADC - #undef CONFIG_UART_TX_BUF_SIZE #define CONFIG_UART_TX_BUF_SIZE 4096 |