diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-09-21 14:08:36 -0700 |
---|---|---|
committer | Tom Hughes <tomhughes@chromium.org> | 2022-09-22 12:59:38 -0700 |
commit | c453fd704268ef72de871b0c5ac7a989de662334 (patch) | |
tree | fcf6ce5810f9ff9e3c8cce434812dd75492269ed /board/beetley | |
parent | 6c1587ca70f558b4f96b3f0b18ad8b027d3ba99d (diff) | |
parent | 28712dae9d7ed1e694f7622cc083afa71090d4d5 (diff) | |
download | chrome-ec-c453fd704268ef72de871b0c5ac7a989de662334.tar.gz |
Merge remote-tracking branch cros/main into firmware-fpmcu-dartmonkey-releasefirmware-fpmcu-dartmonkey-release
Generated by: ./util/update_release_branch.py --board dartmonkey --relevant_paths_file
./util/fingerprint-relevant-paths.txt firmware-fpmcu-dartmonkey-release
Relevant changes:
git log --oneline 6c1587ca70..28712dae9d -- board/nocturne_fp
board/dartmonkey common/fpsensor docs/fingerprint driver/fingerprint
util/getversion.sh
ded9307b79 util/getversion.sh: Fix version when not in a git repo
956055e692 board: change Google USB vendor info
71b2ef709d Update license boilerplate text in source code files
33e11afda0 Revert "fpsensor: Build fpsensor source file with C++"
c8d0360723 fpsensor: Build fpsensor source file with C++
bc113abd53 fpsensor: Fix g++ compiler error
150a58a0dc fpsensor: Fix fp_set_sensor_mode return type
b33b5ce85b fpsensor: Remove nested designators for C++ compatibility
2e864b2539 tree-wide: const-ify argv for console commands
56d8b360f9 test: Add test for get ikm failure when seed not set
3a3d6c3690 test: Add test for fpsensor trivial key failure
233e6bbd08 fpsensor_crypto: Abstract calls to hmac_SHA256
0a041b285b docs/fingerprint: Typo correction
c03fab67e2 docs/fingerprint: Fix the path of fputils.py
0b5d4baf5a util/getversion.sh: Fix empty file list handling
6e128fe760 FPMCU dev board environment with Satlab
3eb29b6aa5 builtin: Move ssize_t to sys/types.h
345d62ebd1 docs/fingerprint: Update power numbers for latest dartmonkey release
c25ffdb316 common: Conditionally support printf %l and %i modifiers
9a3c514b45 test: Add a test to check if the debugger is connected
54e603413f Move standard library tests to their own file
43fa6b4bf8 docs/fingerprint: Update power numbers for latest bloonchipper release
25536f9a84 driver/fingerprint/fpc/bep/fpc_sensor_spi.c: Format with clang-format
4face99efd driver/fingerprint/fpc/libfp/fpc_sensor_pal.h: Format with clang-format
738de2b575 trng: Rename rand to trng_rand
14b8270edd docs/fingerprint: Update dragonclaw power numbers
0b268f93d1 driver/fingerprint/fpc/libfp/fpc_private.c: Format with clang-format
f80da163f2 driver/fingerprint/fpc/libfp/fpc_private.h: Format with clang-format
a0751778f4 board/nocturne_fp/ro_workarounds.c: Format with clang-format
5e9c85c9b1 driver/fingerprint/fpc/libfp/fpc_sensor_pal.c: Format with clang-format
c1f9dd3cf8 driver/fingerprint/fpc/libfp/fpc_bio_algorithm.h: Format with clang-format
eb1e1bed8d driver/fingerprint/fpc/libfp/fpc1145_private.h: Format with clang-format
6e7b611821 driver/fingerprint/fpc/bep/fpc_bio_algorithm.h: Format with clang-format
e0589cd5e2 driver/fingerprint/fpc/bep/fpc1035_private.h: Format with clang-format
58f0246dbe board/nocturne_fp/board_ro.c: Format with clang-format
7905e556a0 common/fpsensor/fpsensor_crypto.c: Format with clang-format
21289d170c driver/fingerprint/fpc/bep/fpc1025_private.h: Format with clang-format
98a20f937e common/fpsensor/fpsensor_state.c: Format with clang-format
a2d255d8af common/fpsensor/fpsensor.c: Format with clang-format
84e53a65da board/nocturne_fp/board.h: Format with clang-format
73055eeb3f driver/fingerprint/fpc/bep/fpc_private.c: Format with clang-format
0f7b5cb509 common/fpsensor/fpsensor_private.h: Format with clang-format
1ceade6e65 driver/fingerprint/fpc/bep/fpc_private.h: Format with clang-format
dca9d74321 Revert "trng: Rename rand to trng_rand"
a6b0b3554f trng: Rename rand to trng_rand
28d0b75b70 third_party/boringssl: Remove unused header
BRANCH=None
BUG=b:244387210 b:242720240 b:215613183 b:242720910 b:236386294
BUG=b:234181908 b:244781166 b:234781655 b:234143158 b:234181908
BUG=b:237344361 b:236025198 b:234181908 b:180945056 chromium:1098010
BUG=b:246424843 b:234181908 b:131913998
TEST=`make -j buildall`
TEST=./util/run_device_tests.py --board dartmonkey
Test "aes": PASSED
Test "cec": PASSED
Test "cortexm_fpu": PASSED
Test "crc": PASSED
Test "flash_physical": PASSED
Test "flash_write_protect": PASSED
Test "fpsensor_hw": PASSED
Test "fpsensor_spi_ro": PASSED
Test "fpsensor_spi_rw": PASSED
Test "fpsensor_uart_ro": PASSED
Test "fpsensor_uart_rw": PASSED
Test "mpu_ro": PASSED
Test "mpu_rw": PASSED
Test "mutex": PASSED
Test "pingpong": PASSED
Test "printf": PASSED
Test "queue": PASSED
Test "rollback_region0": PASSED
Test "rollback_region1": PASSED
Test "rollback_entropy": PASSED
Test "rtc": PASSED
Test "sha256": PASSED
Test "sha256_unrolled": PASSED
Test "static_if": PASSED
Test "stdlib": PASSED
Test "system_is_locked_wp_on": PASSED
Test "system_is_locked_wp_off": PASSED
Test "timer_dos": PASSED
Test "utils": PASSED
Test "utils_str": PASSED
Test "panic_data_dartmonkey_v2.0.2887": PASSED
Test "panic_data_nocturne_fp_v2.2.64": PASSED
Test "panic_data_nami_fp_v2.2.144": PASSED
Force-Relevant-Builds: all
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2c312583a709fedae8fe11d92c22328c3b634bc7
Diffstat (limited to 'board/beetley')
-rw-r--r-- | board/beetley/battery.c | 2 | ||||
-rw-r--r-- | board/beetley/board.c | 114 | ||||
-rw-r--r-- | board/beetley/board.h | 16 | ||||
-rw-r--r-- | board/beetley/build.mk | 2 | ||||
-rw-r--r-- | board/beetley/cbi_ssfc.c | 6 | ||||
-rw-r--r-- | board/beetley/cbi_ssfc.h | 3 | ||||
-rw-r--r-- | board/beetley/ec.tasklist | 2 | ||||
-rw-r--r-- | board/beetley/gpio.inc | 2 | ||||
-rw-r--r-- | board/beetley/led.c | 60 | ||||
-rw-r--r-- | board/beetley/usb_pd_policy.c | 6 |
10 files changed, 99 insertions, 114 deletions
diff --git a/board/beetley/battery.c b/board/beetley/battery.c index 94f5dbb630..0402ef33fd 100644 --- a/board/beetley/battery.c +++ b/board/beetley/battery.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. * diff --git a/board/beetley/board.c b/board/beetley/board.c index 0e6c88b24b..f6b1f1008c 100644 --- a/board/beetley/board.c +++ b/board/beetley/board.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. */ @@ -43,7 +43,7 @@ #include "usb_pd.h" #include "usb_pd_tcpm.h" -#define CPRINTUSB(format, args...) cprints(CC_USBCHARGE, format, ## args) +#define CPRINTUSB(format, args...) cprints(CC_USBCHARGE, format, ##args) #define INT_RECHECK_US 5000 __override struct keyboard_scan_config keyscan_config = { @@ -100,7 +100,6 @@ static void usb_c0_interrupt(enum gpio_signal s) /* Check the line again in 5ms */ hook_call_deferred(&check_c0_line_data, INT_RECHECK_US); - } static void c0_ccsbu_ovp_interrupt(enum gpio_signal s) @@ -114,34 +113,26 @@ static void c0_ccsbu_ovp_interrupt(enum gpio_signal s) /* ADC channels */ const struct adc_t adc_channels[] = { - [ADC_VSNS_PP3300_A] = { - .name = "PP3300_A_PGOOD", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH0 - }, - [ADC_TEMP_SENSOR_1] = { - .name = "TEMP_SENSOR1", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH2 - }, - [ADC_TEMP_SENSOR_2] = { - .name = "TEMP_SENSOR2", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH3 - }, - [ADC_TEMP_SENSOR_3] = { - .name = "TEMP_SENSOR3", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH15 - }, + [ADC_VSNS_PP3300_A] = { .name = "PP3300_A_PGOOD", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH0 }, + [ADC_TEMP_SENSOR_1] = { .name = "TEMP_SENSOR1", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH2 }, + [ADC_TEMP_SENSOR_2] = { .name = "TEMP_SENSOR2", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH3 }, + [ADC_TEMP_SENSOR_3] = { .name = "TEMP_SENSOR3", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH15 }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); @@ -177,12 +168,15 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }; /* USB Muxes */ -const struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { +const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = { { - .usb_port = 0, - .i2c_port = I2C_PORT_USB_C0, - .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS, - .driver = &it5205_usb_mux_driver, + .mux = + &(const struct usb_mux){ + .usb_port = 0, + .i2c_port = I2C_PORT_USB_C0, + .i2c_addr_flags = IT5205_I2C_ADDR1_FLAGS, + .driver = &it5205_usb_mux_driver, + }, }, }; @@ -203,27 +197,23 @@ static const struct ec_response_keybd_config beetley_keybd = { .capabilities = KEYBD_CAP_SCRNLOCK_KEY | KEYBD_CAP_NUMERIC_KEYPAD, }; -__override const struct ec_response_keybd_config -*board_vivaldi_keybd_config(void) +__override const struct ec_response_keybd_config * +board_vivaldi_keybd_config(void) { return &beetley_keybd; } /* USB-A charging control */ -const int usb_port_enable[USB_PORT_COUNT] = { - GPIO_EN_USB_A0_VBUS -}; +const int usb_port_enable[USB_PORT_COUNT] = { GPIO_EN_USB_A0_VBUS }; /* Sensors */ static struct mutex g_lid_mutex; static struct mutex g_base_mutex; /* Matrices to rotate accelerometers into the standard reference. */ -static const mat33_fp_t base_lsm6dsm_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_lsm6dsm_ref = { { 0, FLOAT_TO_FP(1), 0 }, + { FLOAT_TO_FP(-1), 0, 0 }, + { 0, 0, FLOAT_TO_FP(1) } }; static struct lsm6dsm_data lsm6dsm_data = LSM6DSM_DATA; @@ -331,7 +321,6 @@ void board_init(void) keyscan_config.actual_key_mask[12] = 0xff; keyscan_config.actual_key_mask[13] = 0xff; keyscan_config.actual_key_mask[14] = 0xff; - } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); @@ -422,7 +411,6 @@ int board_is_sourcing_vbus(int port) tcpc_read(port, TCPC_REG_POWER_STATUS, ®val); return !!(regval & TCPC_REG_POWER_STATUS_SOURCING_VBUS); - } int board_set_active_charge_port(int port) @@ -434,8 +422,7 @@ int board_set_active_charge_port(int port) /* Disable all ports. */ if (port == CHARGE_PORT_NONE) { - tcpc_write(0, TCPC_REG_COMMAND, - TCPC_REG_COMMAND_SNK_CTRL_LOW); + tcpc_write(0, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_LOW); raa489000_enable_asgate(0, false); return EC_SUCCESS; } @@ -448,8 +435,7 @@ int board_set_active_charge_port(int port) /* Enable requested charge port. */ if (raa489000_enable_asgate(port, true) || - tcpc_write(0, TCPC_REG_COMMAND, - TCPC_REG_COMMAND_SNK_CTRL_HIGH)) { + tcpc_write(0, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_HIGH)) { CPRINTUSB("p%d: sink path enable failed.", port); return EC_ERROR_UNKNOWN; } @@ -481,18 +467,18 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /* Thermistors */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1] = {.name = "Charge", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_1}, - [TEMP_SENSOR_2] = {.name = "Ambient", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_2}, - [TEMP_SENSOR_3] = {.name = "5V_Inductor", - .type = TEMP_SENSOR_TYPE_BOARD, - .read = get_temp_3v3_51k1_47k_4050b, - .idx = ADC_TEMP_SENSOR_3}, + [TEMP_SENSOR_1] = { .name = "Charge", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_1 }, + [TEMP_SENSOR_2] = { .name = "Ambient", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_2 }, + [TEMP_SENSOR_3] = { .name = "5V_Inductor", + .type = TEMP_SENSOR_TYPE_BOARD, + .read = get_temp_3v3_51k1_47k_4050b, + .idx = ADC_TEMP_SENSOR_3 }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); diff --git a/board/beetley/board.h b/board/beetley/board.h index 15eac0d3f8..a70ee73ebb 100644 --- a/board/beetley/board.h +++ b/board/beetley/board.h @@ -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. */ @@ -27,6 +27,7 @@ /* Charger */ #define CONFIG_CHARGE_RAMP_HW #define CONFIG_CHARGER_RAA489000 +#define PD_MAX_VOLTAGE_MV 20000 #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 #define CONFIG_CHARGER_SENSE_RESISTOR 10 #undef CONFIG_USB_PD_TCPC_LPM_EXIT_DEBOUNCE @@ -42,13 +43,13 @@ #define CONFIG_CMD_ACCELS #define CONFIG_CMD_ACCEL_INFO -#define CONFIG_ACCEL_LIS2DWL /* Lid accel */ -#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ +#define CONFIG_ACCEL_LIS2DWL /* Lid accel */ +#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ /* Lid operates in forced mode, base in FIFO */ #define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) #define CONFIG_ACCEL_FIFO -#define CONFIG_ACCEL_FIFO_SIZE 256 /* Must be a power of 2 */ +#define CONFIG_ACCEL_FIFO_SIZE 256 /* Must be a power of 2 */ #define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_ACCEL_LSM6DSM_INT_EVENT \ @@ -112,12 +113,7 @@ enum pwm_channel { }; /* Motion sensors */ -enum sensor_id { - LID_ACCEL, - BASE_ACCEL, - BASE_GYRO, - SENSOR_COUNT -}; +enum sensor_id { LID_ACCEL, BASE_ACCEL, BASE_GYRO, SENSOR_COUNT }; /* ADC channels */ enum adc_channel { diff --git a/board/beetley/build.mk b/board/beetley/build.mk index 8167ca9966..01b890bf29 100644 --- a/board/beetley/build.mk +++ b/board/beetley/build.mk @@ -1,5 +1,5 @@ # -*- makefile -*- -# 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. # diff --git a/board/beetley/cbi_ssfc.c b/board/beetley/cbi_ssfc.c index c4b859f133..81f3ee0dad 100644 --- a/board/beetley/cbi_ssfc.c +++ b/board/beetley/cbi_ssfc.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. */ @@ -27,10 +27,10 @@ DECLARE_HOOK(HOOK_INIT, cbi_ssfc_init, HOOK_PRIO_FIRST); enum ec_ssfc_base_sensor get_cbi_ssfc_base_sensor(void) { - return (enum ec_ssfc_base_sensor) cached_ssfc.base_sensor; + return (enum ec_ssfc_base_sensor)cached_ssfc.base_sensor; } enum ec_ssfc_lid_sensor get_cbi_ssfc_lid_sensor(void) { - return (enum ec_ssfc_lid_sensor) cached_ssfc.lid_sensor; + return (enum ec_ssfc_lid_sensor)cached_ssfc.lid_sensor; } diff --git a/board/beetley/cbi_ssfc.h b/board/beetley/cbi_ssfc.h index 935049b6ae..bf8853a43a 100644 --- a/board/beetley/cbi_ssfc.h +++ b/board/beetley/cbi_ssfc.h @@ -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. */ @@ -56,5 +56,4 @@ enum ec_ssfc_base_sensor get_cbi_ssfc_base_sensor(void); */ enum ec_ssfc_lid_sensor get_cbi_ssfc_lid_sensor(void); - #endif /* _DEDEDE_CBI_SSFC__H_ */ diff --git a/board/beetley/ec.tasklist b/board/beetley/ec.tasklist index bdcbcdf074..8ccdfc81b2 100644 --- a/board/beetley/ec.tasklist +++ b/board/beetley/ec.tasklist @@ -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. */ diff --git a/board/beetley/gpio.inc b/board/beetley/gpio.inc index bbb793ee44..0677e5a2ac 100644 --- a/board/beetley/gpio.inc +++ b/board/beetley/gpio.inc @@ -1,6 +1,6 @@ /* -*- mode:c -*- * - * 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. */ diff --git a/board/beetley/led.c b/board/beetley/led.c index bf64b33dcf..e3d4eb543e 100644 --- a/board/beetley/led.c +++ b/board/beetley/led.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. * @@ -11,42 +11,46 @@ #include "gpio.h" #include "pwm.h" -#define LED_OFF_LVL 0 -#define LED_ON_LVL 1 +#define LED_OFF_LVL 0 +#define LED_ON_LVL 1 __override const int led_charge_lvl_1 = 5; __override const int led_charge_lvl_2 = 97; __override struct led_descriptor - led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = { - [STATE_CHARGING_LVL_1] = {{EC_LED_COLOR_RED, LED_INDEFINITE} }, - [STATE_CHARGING_LVL_2] = {{EC_LED_COLOR_AMBER, LED_INDEFINITE} }, - [STATE_CHARGING_FULL_CHARGE] = {{EC_LED_COLOR_GREEN, LED_INDEFINITE} }, - [STATE_DISCHARGE_S0] = {{LED_OFF, LED_INDEFINITE} }, - [STATE_DISCHARGE_S3] = {{LED_OFF, LED_INDEFINITE} }, - [STATE_DISCHARGE_S5] = {{LED_OFF, LED_INDEFINITE} }, - [STATE_BATTERY_ERROR] = {{EC_LED_COLOR_RED, 1 * LED_ONE_SEC}, - {LED_OFF, 1 * LED_ONE_SEC} }, - [STATE_FACTORY_TEST] = {{EC_LED_COLOR_RED, 2 * LED_ONE_SEC}, - {EC_LED_COLOR_GREEN, 2 * LED_ONE_SEC} }, -}; + led_bat_state_table[LED_NUM_STATES][LED_NUM_PHASES] = { + [STATE_CHARGING_LVL_1] = { { EC_LED_COLOR_RED, + LED_INDEFINITE } }, + [STATE_CHARGING_LVL_2] = { { EC_LED_COLOR_AMBER, + LED_INDEFINITE } }, + [STATE_CHARGING_FULL_CHARGE] = { { EC_LED_COLOR_GREEN, + LED_INDEFINITE } }, + [STATE_DISCHARGE_S0] = { { LED_OFF, LED_INDEFINITE } }, + [STATE_DISCHARGE_S3] = { { LED_OFF, LED_INDEFINITE } }, + [STATE_DISCHARGE_S5] = { { LED_OFF, LED_INDEFINITE } }, + [STATE_BATTERY_ERROR] = { { EC_LED_COLOR_RED, 1 * LED_ONE_SEC }, + { LED_OFF, 1 * LED_ONE_SEC } }, + [STATE_FACTORY_TEST] = { { EC_LED_COLOR_RED, 2 * LED_ONE_SEC }, + { EC_LED_COLOR_GREEN, + 2 * LED_ONE_SEC } }, + }; __override const struct led_descriptor - led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES] = { - [PWR_LED_STATE_ON] = {{EC_LED_COLOR_WHITE, LED_INDEFINITE} }, - [PWR_LED_STATE_SUSPEND_AC] = {{EC_LED_COLOR_WHITE, 1 * LED_ONE_SEC}, - {LED_OFF, 3 * LED_ONE_SEC} }, - [PWR_LED_STATE_SUSPEND_NO_AC] = {{EC_LED_COLOR_WHITE, 1 * LED_ONE_SEC}, - {LED_OFF, 3 * LED_ONE_SEC} }, - [PWR_LED_STATE_OFF] = {{LED_OFF, LED_INDEFINITE} }, -}; + led_pwr_state_table[PWR_LED_NUM_STATES][LED_NUM_PHASES] = { + [PWR_LED_STATE_ON] = { { EC_LED_COLOR_WHITE, LED_INDEFINITE } }, + [PWR_LED_STATE_SUSPEND_AC] = { { EC_LED_COLOR_WHITE, + 1 * LED_ONE_SEC }, + { LED_OFF, 3 * LED_ONE_SEC } }, + [PWR_LED_STATE_SUSPEND_NO_AC] = { { EC_LED_COLOR_WHITE, + 1 * LED_ONE_SEC }, + { LED_OFF, + 3 * LED_ONE_SEC } }, + [PWR_LED_STATE_OFF] = { { LED_OFF, LED_INDEFINITE } }, + }; - -const enum ec_led_id supported_led_ids[] = { - EC_LED_ID_BATTERY_LED, - EC_LED_ID_POWER_LED -}; +const enum ec_led_id supported_led_ids[] = { EC_LED_ID_BATTERY_LED, + EC_LED_ID_POWER_LED }; const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); __override void led_set_color_battery(enum ec_led_colors color) diff --git a/board/beetley/usb_pd_policy.c b/board/beetley/usb_pd_policy.c index b7c0ca21df..a7633b73ac 100644 --- a/board/beetley/usb_pd_policy.c +++ b/board/beetley/usb_pd_policy.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. */ @@ -13,8 +13,8 @@ #include "driver/tcpm/tcpci.h" #include "usb_pd.h" -#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ## args) -#define CPRINTS(format, args...) cprints(CC_USBPD, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_USBPD, format, ##args) +#define CPRINTS(format, args...) cprints(CC_USBPD, format, ##args) int pd_check_vconn_swap(int port) { |