From d3fab55f4daf3f6c0ecd4f583f83783c238b8796 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 27 Jun 2022 13:25:43 -0600 Subject: board/casta/board.c: Format with clang-format BUG=b:236386294 BRANCH=none TEST=none Change-Id: I85789ac69a93d5014d6e611102b2268b948d19db Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728115 Reviewed-by: Jeremy Bettis --- board/casta/board.c | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'board/casta/board.c') diff --git a/board/casta/board.c b/board/casta/board.c index 24dafc9fee..8fe51fe191 100644 --- a/board/casta/board.c +++ b/board/casta/board.c @@ -37,10 +37,10 @@ #include "usbc_ppc.h" #include "util.h" -#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ## args) -#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args) +#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ##args) +#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ##args) -#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) +#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ##args) static uint8_t sku_id; @@ -65,27 +65,27 @@ static void ppc_interrupt(enum gpio_signal signal) /* ADC channels */ const struct adc_t adc_channels[] = { - [ADC_TEMP_SENSOR_AMB] = { - "TEMP_AMB", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, - [ADC_TEMP_SENSOR_CHARGER] = { - "TEMP_CHARGER", NPCX_ADC_CH1, ADC_MAX_VOLT, ADC_READ_MAX+1, 0}, + [ADC_TEMP_SENSOR_AMB] = { "TEMP_AMB", NPCX_ADC_CH0, ADC_MAX_VOLT, + ADC_READ_MAX + 1, 0 }, + [ADC_TEMP_SENSOR_CHARGER] = { "TEMP_CHARGER", NPCX_ADC_CH1, + ADC_MAX_VOLT, ADC_READ_MAX + 1, 0 }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); /* TODO(b/119872005): Casta: confirm thermistor parts */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_BATTERY] = {.name = "Battery", - .type = TEMP_SENSOR_TYPE_BATTERY, - .read = charge_get_battery_temp, - .idx = 0}, - [TEMP_SENSOR_AMBIENT] = {.name = "Ambient", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_AMB}, - [TEMP_SENSOR_CHARGER] = {.name = "Charger", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_13k7_47k_4050b, - .idx = ADC_TEMP_SENSOR_CHARGER}, + [TEMP_SENSOR_BATTERY] = { .name = "Battery", + .type = TEMP_SENSOR_TYPE_BATTERY, + .read = charge_get_battery_temp, + .idx = 0 }, + [TEMP_SENSOR_AMBIENT] = { .name = "Ambient", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_AMB }, + [TEMP_SENSOR_CHARGER] = { .name = "Charger", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_13k7_47k_4050b, + .idx = ADC_TEMP_SENSOR_CHARGER }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); @@ -103,13 +103,12 @@ const unsigned int chg_cnt = ARRAY_SIZE(chg_chips); * I2C callbacks to ensure bus free time for battery I2C transactions is at * least 5ms. */ -#define BATTERY_FREE_MIN_DELTA_US (5 * MSEC) +#define BATTERY_FREE_MIN_DELTA_US (5 * MSEC) static timestamp_t battery_last_i2c_time; static int is_battery_i2c(const int port, const uint16_t addr_flags) { - return (port == I2C_PORT_BATTERY) - && (addr_flags == BATTERY_ADDR_FLAGS); + return (port == I2C_PORT_BATTERY) && (addr_flags == BATTERY_ADDR_FLAGS); } static int is_battery_port(int port) @@ -157,7 +156,7 @@ DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C); static void board_init(void) { - if(get_cbi_ssfc_charger() != SSFC_CHARGER_BQ25710) + if (get_cbi_ssfc_charger() != SSFC_CHARGER_BQ25710) return; chg_chips[0].drv = &bq25710_drv; @@ -174,7 +173,6 @@ static void set_input_limit_on_ac_removal(void) return; charger_set_input_current_limit(0, CONFIG_CHARGER_INPUT_CURRENT); - } DECLARE_HOOK(HOOK_AC_CHANGE, set_input_limit_on_ac_removal, HOOK_PRIO_DEFAULT); -- cgit v1.2.1 From 71b2ef709dcb14260f5fdaa3ab4ced005a29fb46 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 12 Sep 2022 14:54:36 -0400 Subject: Update license boilerplate text in source code files Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis Reviewed-by: Jack Rosenthal --- board/casta/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/casta/board.c') diff --git a/board/casta/board.c b/board/casta/board.c index 8fe51fe191..512a7c224b 100644 --- a/board/casta/board.c +++ b/board/casta/board.c @@ -1,4 +1,4 @@ -/* Copyright 2018 The Chromium OS Authors. All rights reserved. +/* Copyright 2018 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -- cgit v1.2.1