diff options
Diffstat (limited to 'board/brya/sensors.c')
-rw-r--r-- | board/brya/sensors.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/board/brya/sensors.c b/board/brya/sensors.c index 55f6e6906c..6eebc070d2 100644 --- a/board/brya/sensors.c +++ b/board/brya/sensors.c @@ -16,7 +16,7 @@ #include "temp_sensor/thermistor.h" /* ADC configuration */ -const struct adc_t adc_channels[] = { +struct adc_t adc_channels[] = { [ADC_TEMP_SENSOR_1_DDR_SOC] = { .name = "TEMP_DDR_SOC", .input_ch = NPCX_ADC_CH0, @@ -386,3 +386,20 @@ struct ec_thermal_config thermal_params[] = { [TEMP_SENSOR_4_WWAN] = thermal_wwan, }; BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); + +static void board_thermals_init(void) +{ + if (get_board_id() == 1) { + /* + * Board ID 1 only has 3 sensors and the AMBIENT sensor + * ADC pins have been reassigned, so we're down to 2 + * sensors that can easily be configured. So, alias the + * AMBIENT sensor ADC channel to the unimplemented ADC + * slots. + */ + adc_channels[ADC_TEMP_SENSOR_3_CHARGER].input_ch = NPCX_ADC_CH1; + adc_channels[ADC_TEMP_SENSOR_4_WWAN].input_ch = NPCX_ADC_CH1; + } +} + +DECLARE_HOOK(HOOK_INIT, board_thermals_init, HOOK_PRIO_INIT_CHIPSET); |