diff options
Diffstat (limited to 'board/taniks/sensors.c')
-rw-r--r-- | board/taniks/sensors.c | 72 |
1 files changed, 30 insertions, 42 deletions
diff --git a/board/taniks/sensors.c b/board/taniks/sensors.c index d480849036..5371f94081 100644 --- a/board/taniks/sensors.c +++ b/board/taniks/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. */ @@ -22,8 +22,8 @@ #include "tablet_mode.h" #if 1 -#define CPRINTS(format, args...) ccprints(format, ## args) -#define CPRINTF(format, args...) ccprintf(format, ## args) +#define CPRINTS(format, args...) ccprints(format, ##args) +#define CPRINTF(format, args...) ccprintf(format, ##args) #else #define CPRINTS(format, args...) #define CPRINTF(format, args...) @@ -119,17 +119,13 @@ static struct lsm6dso_data lsm6dso_data; static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA; /* Matrix to rotate lid and base sensor into standard reference frame */ -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) } }; -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) } }; struct motion_sensor_t bma422_lid_accel = { .name = "Lid Accel - BMA", @@ -287,7 +283,6 @@ unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); #endif - static void board_detect_motionsensor(void) { int ret; @@ -304,8 +299,8 @@ static void board_detect_motionsensor(void) return; /* Check lid accel chip */ - ret = i2c_read8(I2C_PORT_SENSOR, LIS2DW12_ADDR1, - LIS2DW12_WHO_AM_I_REG, &val); + ret = i2c_read8(I2C_PORT_SENSOR, LIS2DW12_ADDR1, LIS2DW12_WHO_AM_I_REG, + &val); if (ret == 0 && val == LIS2DW12_WHO_AM_I) { CPRINTS("LID_ACCEL is LIS2DW12"); return; @@ -332,7 +327,7 @@ static void board_detect_motionsensor(void) CPRINTS("No LID_ACCEL are detected"); } DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_detect_motionsensor, - HOOK_PRIO_DEFAULT); + HOOK_PRIO_DEFAULT); static void baseboard_sensors_init(void) { @@ -344,27 +339,20 @@ DECLARE_HOOK(HOOK_INIT, baseboard_sensors_init, HOOK_PRIO_INIT_I2C + 1); /* Temperature sensor configuration */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1_DDR_SOC] = { - .name = "DDR and SOC", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_30k9_47k_4050b, - .idx = ADC_TEMP_SENSOR_1_DDR_SOC - }, - [TEMP_SENSOR_3_CHARGER] = { - .name = "CHARGER", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_30k9_47k_4050b, - .idx = ADC_TEMP_SENSOR_3_CHARGER - }, - [TEMP_SENSOR_4_CPUCHOKE] = { - .name = "CPU CHOKE", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_30k9_47k_4050b, - .idx = ADC_TEMP_SENSOR_4_CPUCHOKE - }, + [TEMP_SENSOR_1_DDR_SOC] = { .name = "DDR and SOC", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_30k9_47k_4050b, + .idx = ADC_TEMP_SENSOR_1_DDR_SOC }, + [TEMP_SENSOR_3_CHARGER] = { .name = "CHARGER", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_30k9_47k_4050b, + .idx = ADC_TEMP_SENSOR_3_CHARGER }, + [TEMP_SENSOR_4_CPUCHOKE] = { .name = "CPU CHOKE", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_30k9_47k_4050b, + .idx = ADC_TEMP_SENSOR_4_CPUCHOKE }, }; - BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); /* @@ -377,8 +365,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(90), \ [EC_TEMP_THRESH_HALT] = C_TO_K(100), \ @@ -387,7 +375,7 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ }, \ .temp_fan_off = C_TO_K(35), \ - .temp_fan_max = C_TO_K(60), \ + .temp_fan_max = C_TO_K(70), \ } __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; @@ -407,8 +395,8 @@ __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; /* * TODO(b/202062363): Remove when clang is fixed. */ -#define THERMAL_FAN \ - { \ +#define THERMAL_FAN \ + { \ .temp_host = { \ [EC_TEMP_THRESH_HIGH] = C_TO_K(90), \ [EC_TEMP_THRESH_HALT] = C_TO_K(100), \ @@ -417,7 +405,7 @@ __maybe_unused static const struct ec_thermal_config thermal_cpu = THERMAL_CPU; [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ }, \ .temp_fan_off = C_TO_K(35), \ - .temp_fan_max = C_TO_K(60), \ + .temp_fan_max = C_TO_K(70), \ } __maybe_unused static const struct ec_thermal_config thermal_fan = THERMAL_FAN; |