From ac73b842b0f563577791d0c3ad15cb8cd2017cbe Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Mon, 27 Jun 2022 13:46:04 -0600 Subject: board/meep/board.c: Format with clang-format BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ib3e450c09c9bd7fff33d59f8d28d6287e274371a Signed-off-by: Jack Rosenthal Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728658 Reviewed-by: Jeremy Bettis --- board/meep/board.c | 110 +++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 58 deletions(-) (limited to 'board/meep/board.c') diff --git a/board/meep/board.c b/board/meep/board.c index 3771c72072..e20ca0987a 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -42,13 +42,13 @@ #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) -#define USB_PD_PORT_ANX7447 0 -#define USB_PD_PORT_PS8751 1 +#define USB_PD_PORT_ANX7447 0 +#define USB_PD_PORT_PS8751 1 #ifdef CONFIG_KEYBOARD_KEYPAD #error "KSO_14 was repurposed to PPC_ID pin so CONFIG_KEYBOARD_KEYPAD \ @@ -86,32 +86,32 @@ 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 }, /* Vbus C0 sensing (10x voltage divider). PPVAR_USB_C0_VBUS */ - [ADC_VBUS_C0] = { - "VBUS_C0", NPCX_ADC_CH9, ADC_MAX_VOLT*10, ADC_READ_MAX+1, 0}, + [ADC_VBUS_C0] = { "VBUS_C0", NPCX_ADC_CH9, ADC_MAX_VOLT * 10, + ADC_READ_MAX + 1, 0 }, /* Vbus C1 sensing (10x voltage divider). PPVAR_USB_C1_VBUS */ - [ADC_VBUS_C1] = { - "VBUS_C1", NPCX_ADC_CH4, ADC_MAX_VOLT*10, ADC_READ_MAX+1, 0}, + [ADC_VBUS_C1] = { "VBUS_C1", NPCX_ADC_CH4, ADC_MAX_VOLT * 10, + ADC_READ_MAX + 1, 0 }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); 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); @@ -121,17 +121,13 @@ static struct mutex g_lid_mutex; static struct mutex g_base_mutex; /* Matrix to rotate accelrator into standard reference frame */ -const mat33_fp_t lid_standrd_ref = { - { FLOAT_TO_FP(1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} -}; +const mat33_fp_t lid_standrd_ref = { { FLOAT_TO_FP(1), 0, 0 }, + { 0, FLOAT_TO_FP(-1), 0 }, + { 0, 0, FLOAT_TO_FP(-1) } }; -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)} -}; +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) } }; /* sensor private data */ static struct kionix_accel_data kx022_data; @@ -228,9 +224,9 @@ int board_is_convertible(void) * Vortininja: 49, 50, 51, 52 * Unprovisioned: 255 */ - return sku_id == 1 || sku_id == 2 || sku_id == 3 || - sku_id == 4 || sku_id == 49 || sku_id == 50 || - sku_id == 51 || sku_id == 52 || sku_id == 255; + return sku_id == 1 || sku_id == 2 || sku_id == 3 || sku_id == 4 || + sku_id == 49 || sku_id == 50 || sku_id == 51 || sku_id == 52 || + sku_id == 255; } static void board_update_sensor_config_from_sku(void) @@ -306,8 +302,8 @@ void board_hibernate_late(void) const uint32_t hibernate_pins[][2] = { /* Turn off LEDs before going to hibernate */ - {GPIO_BAT_LED_WHITE_L, GPIO_INPUT | GPIO_PULL_UP}, - {GPIO_BAT_LED_AMBER_L, GPIO_INPUT | GPIO_PULL_UP}, + { GPIO_BAT_LED_WHITE_L, GPIO_INPUT | GPIO_PULL_UP }, + { GPIO_BAT_LED_AMBER_L, GPIO_INPUT | GPIO_PULL_UP }, }; for (i = 0; i < ARRAY_SIZE(hibernate_pins); ++i) @@ -336,15 +332,15 @@ __override void lid_angle_peripheral_enable(int enable) * The connector has 24 pins total, and there is no pin 0. */ const int keyboard_factory_scan_pins[][2] = { - {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6}, - {0, 7}, {1, 4}, {1, 3}, {1, 6}, {1, 7}, - {3, 1}, {2, 0}, {1, 5}, {2, 6}, {2, 7}, - {2, 1}, {2, 4}, {2, 5}, {1, 2}, {2, 3}, - {2, 2}, {3, 0}, {-1, -1}, {-1, -1}, {-1, -1}, + { -1, -1 }, { 0, 5 }, { 1, 1 }, { 1, 0 }, { 0, 6 }, + { 0, 7 }, { 1, 4 }, { 1, 3 }, { 1, 6 }, { 1, 7 }, + { 3, 1 }, { 2, 0 }, { 1, 5 }, { 2, 6 }, { 2, 7 }, + { 2, 1 }, { 2, 4 }, { 2, 5 }, { 1, 2 }, { 2, 3 }, + { 2, 2 }, { 3, 0 }, { -1, -1 }, { -1, -1 }, { -1, -1 }, }; const int keyboard_factory_scan_pins_used = - ARRAY_SIZE(keyboard_factory_scan_pins); + ARRAY_SIZE(keyboard_factory_scan_pins); #endif void board_overcurrent_event(int port, int is_overcurrented) @@ -389,31 +385,29 @@ __override uint16_t board_get_ps8xxx_product_id(int port) } static const struct ppc_config_t ppc_syv682x_port0 = { - .i2c_port = I2C_PORT_TCPC0, - .i2c_addr_flags = SYV682X_ADDR0_FLAGS, - .drv = &syv682x_drv, + .i2c_port = I2C_PORT_TCPC0, + .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .drv = &syv682x_drv, }; static const struct ppc_config_t ppc_syv682x_port1 = { - .i2c_port = I2C_PORT_TCPC1, - .i2c_addr_flags = SYV682X_ADDR0_FLAGS, - .drv = &syv682x_drv, + .i2c_port = I2C_PORT_TCPC1, + .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .drv = &syv682x_drv, }; static void board_setup_ppc(void) { if (c0_port_ppc == PPC_SYV682X) { - memcpy(&ppc_chips[USB_PD_PORT_TCPC_0], - &ppc_syv682x_port0, - sizeof(struct ppc_config_t)); + memcpy(&ppc_chips[USB_PD_PORT_TCPC_0], &ppc_syv682x_port0, + sizeof(struct ppc_config_t)); gpio_set_flags(GPIO_USB_PD_C0_INT_ODL, GPIO_INT_BOTH); } if (c1_port_ppc == PPC_SYV682X) { - memcpy(&ppc_chips[USB_PD_PORT_TCPC_1], - &ppc_syv682x_port1, - sizeof(struct ppc_config_t)); + memcpy(&ppc_chips[USB_PD_PORT_TCPC_1], &ppc_syv682x_port1, + sizeof(struct ppc_config_t)); gpio_set_flags(GPIO_USB_PD_C1_INT_ODL, GPIO_INT_BOTH); } -- cgit v1.2.1