diff options
Diffstat (limited to 'board/brya/sensors.c')
-rw-r--r-- | board/brya/sensors.c | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/board/brya/sensors.c b/board/brya/sensors.c index 51841b8599..8ab5b58d7e 100644 --- a/board/brya/sensors.c +++ b/board/brya/sensors.c @@ -1,4 +1,4 @@ -/* Copyright 2021 The Chromium OS Authors. All rights reserved. +/* Copyright 2021 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -55,18 +55,14 @@ static struct stprivate_data g_lis2dw12_data; static struct lsm6dso_data lsm6dso_data; /* TODO(b/184779333): calibrate the orientation matrix on later board stage */ -static const mat33_fp_t lid_standard_ref = { - { 0, FLOAT_TO_FP(1), 0}, - { FLOAT_TO_FP(1), 0, 0}, - { 0, 0, FLOAT_TO_FP(-1)} -}; +static const mat33_fp_t lid_standard_ref = { { 0, FLOAT_TO_FP(1), 0 }, + { FLOAT_TO_FP(1), 0, 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; /* TODO(b/184779743): verify orientation matrix */ -static const mat33_fp_t base_standard_ref = { - { FLOAT_TO_FP(1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} -}; +static const mat33_fp_t base_standard_ref = { { FLOAT_TO_FP(1), 0, 0 }, + { 0, FLOAT_TO_FP(-1), 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; /* TCS3400 private data */ static struct als_drv_data_t g_tcs3400_data = { @@ -292,8 +288,8 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); /* * TODO(b/202062363): Remove when clang is fixed. */ -#define THERMAL_CPU \ - { \ +#define THERMAL_CPU \ + { \ .temp_host = { \ [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ [EC_TEMP_THRESH_HALT] = C_TO_K(90), \ @@ -322,8 +318,8 @@ __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; /* * TODO(b/202062363): Remove when clang is fixed. */ -#define THERMAL_AMBIENT \ - { \ +#define THERMAL_AMBIENT \ + { \ .temp_host = { \ [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ [EC_TEMP_THRESH_HALT] = C_TO_K(90), \ @@ -351,8 +347,8 @@ __maybe_unused static const struct ec_thermal_config thermal_ambient = /* * TODO(b/202062363): Remove when clang is fixed. */ -#define THERMAL_CHARGER \ - { \ +#define THERMAL_CHARGER \ + { \ .temp_host = { \ [EC_TEMP_THRESH_HIGH] = C_TO_K(105), \ [EC_TEMP_THRESH_HALT] = C_TO_K(120), \ @@ -372,8 +368,8 @@ __maybe_unused static const struct ec_thermal_config thermal_charger = /* * TODO(b/202062363): Remove when clang is fixed. */ -#define THERMAL_WWAN \ - { \ +#define THERMAL_WWAN \ + { \ .temp_host = { \ [EC_TEMP_THRESH_HIGH] = C_TO_K(130), \ [EC_TEMP_THRESH_HALT] = C_TO_K(130), \ @@ -394,20 +390,3 @@ 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); |