summaryrefslogtreecommitdiff
path: root/board/nocturne
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-09-21 14:08:36 -0700
committerTom Hughes <tomhughes@chromium.org>2022-09-22 12:59:38 -0700
commitc453fd704268ef72de871b0c5ac7a989de662334 (patch)
treefcf6ce5810f9ff9e3c8cce434812dd75492269ed /board/nocturne
parent6c1587ca70f558b4f96b3f0b18ad8b027d3ba99d (diff)
parent28712dae9d7ed1e694f7622cc083afa71090d4d5 (diff)
downloadchrome-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/nocturne')
-rw-r--r--board/nocturne/base_detect.c40
-rw-r--r--board/nocturne/battery.c34
-rw-r--r--board/nocturne/board.c193
-rw-r--r--board/nocturne/board.h99
-rw-r--r--board/nocturne/build.mk2
-rw-r--r--board/nocturne/ec.tasklist2
-rw-r--r--board/nocturne/gpio.inc2
-rw-r--r--board/nocturne/led.c46
-rw-r--r--board/nocturne/usb_pd_policy.c14
9 files changed, 202 insertions, 230 deletions
diff --git a/board/nocturne/base_detect.c b/board/nocturne/base_detect.c
index 48c7b1f9dd..807aa3e14a 100644
--- a/board/nocturne/base_detect.c
+++ b/board/nocturne/base_detect.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.
*/
@@ -26,8 +26,8 @@
#include "timer.h"
#include "util.h"
-#define CPRINTS(format, args...) cprints(CC_USB, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USB, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_USB, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USB, format, ##args)
#define DEFAULT_POLL_TIMEOUT_US (250 * MSEC)
#define DEBOUNCE_TIMEOUT_US (20 * MSEC)
@@ -62,7 +62,6 @@
*/
#define WINDOW_SIZE 5
-
enum base_detect_state {
BASE_DETACHED = 0,
BASE_ATTACHED_DEBOUNCE,
@@ -82,7 +81,7 @@ static timestamp_t detached_decision_deadline;
static void enable_base_interrupts(int enable)
{
int (*fn)(enum gpio_signal) = enable ? gpio_enable_interrupt :
- gpio_disable_interrupt;
+ gpio_disable_interrupt;
/* This pin is present on boards newer than rev 0. */
if (board_get_version() > 0)
@@ -141,28 +140,26 @@ static void base_detect_changed(void)
static int base_seems_attached(int attach_pin_mv, int detach_pin_mv)
{
/* We can't tell if we don't have good readings. */
- if (attach_pin_mv == ADC_READ_ERROR ||
- detach_pin_mv == ADC_READ_ERROR)
+ if (attach_pin_mv == ADC_READ_ERROR || detach_pin_mv == ADC_READ_ERROR)
return 0;
if (gpio_get_level(GPIO_BASE_PWR_EN))
return (attach_pin_mv >= PWREN_ATTACH_MIN_MV) &&
- (detach_pin_mv >= DETACH_MIN_MV);
+ (detach_pin_mv >= DETACH_MIN_MV);
else
return (attach_pin_mv <= ATTACH_MAX_MV) &&
- (attach_pin_mv >= ATTACH_MIN_MV) &&
- (detach_pin_mv <= DETACH_MIN_MV);
+ (attach_pin_mv >= ATTACH_MIN_MV) &&
+ (detach_pin_mv <= DETACH_MIN_MV);
}
static int base_seems_detached(int attach_pin_mv, int detach_pin_mv)
{
/* We can't tell if we don't have good readings. */
- if (attach_pin_mv == ADC_READ_ERROR ||
- detach_pin_mv == ADC_READ_ERROR)
+ if (attach_pin_mv == ADC_READ_ERROR || detach_pin_mv == ADC_READ_ERROR)
return 0;
return (attach_pin_mv >= PWREN_ATTACH_MIN_MV) &&
- (detach_pin_mv <= DETACH_MIN_MV);
+ (detach_pin_mv <= DETACH_MIN_MV);
}
static void set_state(enum base_detect_state new_state)
@@ -194,9 +191,9 @@ static void base_detect_deferred(void)
if (forced_state != BASE_NO_FORCED_STATE) {
if (state != forced_state) {
- CPRINTS("BD forced %s",
- forced_state == BASE_ATTACHED ?
- "attached" : "detached");
+ CPRINTS("BD forced %s", forced_state == BASE_ATTACHED ?
+ "attached" :
+ "detached");
set_state(forced_state);
base_detect_changed();
}
@@ -212,8 +209,7 @@ static void base_detect_deferred(void)
if (debug) {
int i;
- CPRINTS("BD st%d: att: %dmV det: %dmV", state,
- attach_reading,
+ CPRINTS("BD st%d: att: %dmV det: %dmV", state, attach_reading,
detach_reading);
CPRINTF("det readings = [");
for (i = 0; i < WINDOW_SIZE; i++)
@@ -341,7 +337,6 @@ static void check_and_reapply_base_power_deferred(void)
hook_call_deferred(&clear_base_power_on_attempts_deferred_data,
SECOND);
}
-
}
DECLARE_DEFERRED(check_and_reapply_base_power_deferred);
@@ -366,20 +361,19 @@ void base_pwr_fault_interrupt(enum gpio_signal s)
}
}
-static int command_basedetectdebug(int argc, char **argv)
+static int command_basedetectdebug(int argc, const char **argv)
{
if ((argc > 1) && !parse_bool(argv[1], &debug))
return EC_ERROR_PARAM1;
- CPRINTS("BD: %sst%d", forced_state != BASE_NO_FORCED_STATE ?
- "forced " : "", state);
+ CPRINTS("BD: %sst%d",
+ forced_state != BASE_NO_FORCED_STATE ? "forced " : "", state);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(basedebug, command_basedetectdebug, "[ena|dis]",
"En/Disable base detection debug");
-
void base_force_state(enum ec_set_base_state_cmd state)
{
if (state == EC_SET_BASE_STATE_ATTACH)
diff --git a/board/nocturne/battery.c b/board/nocturne/battery.c
index 0e568ca6f9..c81640e983 100644
--- a/board/nocturne/battery.c
+++ b/board/nocturne/battery.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.
*
@@ -21,26 +21,26 @@
#include "usb_pd.h"
/* Shutdown mode parameter to write to manufacturer access register */
-#define SB_SHUTDOWN_DATA 0x0010
+#define SB_SHUTDOWN_DATA 0x0010
/*
* We need to stop charging the battery when the DRAM temperature sensor gets
* over 47 C (320 K), and resume charging once it cools back down.
*/
-#define DRAM_STOPCHARGE_TEMP_K 320
+#define DRAM_STOPCHARGE_TEMP_K 320
/* Battery info */
static const struct battery_info info = {
- .voltage_max = 8880,
- .voltage_normal = 7700,
- .voltage_min = 6000,
- .precharge_current = 160,
- .start_charging_min_c = 10,
- .start_charging_max_c = 50,
- .charging_min_c = 10,
- .charging_max_c = 50,
- .discharging_min_c = -20,
- .discharging_max_c = 60,
+ .voltage_max = 8880,
+ .voltage_normal = 7700,
+ .voltage_min = 6000,
+ .precharge_current = 160,
+ .start_charging_min_c = 10,
+ .start_charging_max_c = 50,
+ .charging_min_c = 10,
+ .charging_max_c = 50,
+ .discharging_min_c = -20,
+ .discharging_max_c = 60,
};
int board_cut_off_battery(void)
@@ -78,8 +78,8 @@ enum battery_disconnect_state battery_get_disconnect_state(void)
return BATTERY_NOT_DISCONNECTED;
/* Check if battery discharge FET is disabled. */
- rv = sb_read_mfgacc(PARAM_OPERATION_STATUS,
- SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data));
+ rv = sb_read_mfgacc(PARAM_OPERATION_STATUS, SB_ALT_MANUFACTURER_ACCESS,
+ data, sizeof(data));
if (rv)
return BATTERY_DISCONNECT_ERROR;
if (~data[3] & (BATTERY_DISCHARGING_DISABLED)) {
@@ -91,8 +91,8 @@ enum battery_disconnect_state battery_get_disconnect_state(void)
* Battery discharge FET is disabled. Verify that we didn't enter this
* state due to a safety fault.
*/
- rv = sb_read_mfgacc(PARAM_SAFETY_STATUS,
- SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data));
+ rv = sb_read_mfgacc(PARAM_SAFETY_STATUS, SB_ALT_MANUFACTURER_ACCESS,
+ data, sizeof(data));
if (rv || data[2] || data[3] || data[4] || data[5])
return BATTERY_DISCONNECT_ERROR;
diff --git a/board/nocturne/board.c b/board/nocturne/board.c
index ac29dfb942..d32f036844 100644
--- a/board/nocturne/board.c
+++ b/board/nocturne/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.
*/
@@ -30,6 +30,7 @@
#include "lpc.h"
#include "mkbp_event.h"
#include "motion_sense.h"
+#include "panic.h"
#include "power.h"
#include "power_button.h"
#include "pwm.h"
@@ -46,8 +47,8 @@
#include "usbc_ppc.h"
#include "util.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ##args)
static void tcpc_alert_event(enum gpio_signal s)
{
@@ -101,80 +102,67 @@ const enum gpio_signal hibernate_wake_pins[] = {
GPIO_AC_PRESENT,
GPIO_POWER_BUTTON_L,
};
-const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
+const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
const struct adc_t adc_channels[] = {
- [ADC_BASE_ATTACH] = {
- "BASE ATTACH", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX + 1, 0
- },
+ [ADC_BASE_ATTACH] = { "BASE ATTACH", NPCX_ADC_CH0, ADC_MAX_VOLT,
+ ADC_READ_MAX + 1, 0 },
- [ADC_BASE_DETACH] = {
- "BASE DETACH", NPCX_ADC_CH1, ADC_MAX_VOLT, ADC_READ_MAX + 1, 0
- },
+ [ADC_BASE_DETACH] = { "BASE DETACH", NPCX_ADC_CH1, ADC_MAX_VOLT,
+ ADC_READ_MAX + 1, 0 },
};
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
const struct pwm_t pwm_channels[] = {
- [PWM_CH_DB0_LED_RED] = { 3, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
- 986 },
+ [PWM_CH_DB0_LED_RED] = { 3, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
+ 986 },
[PWM_CH_DB0_LED_GREEN] = { 0, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
986 },
- [PWM_CH_DB0_LED_BLUE] = { 2, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
- 986 },
- [PWM_CH_DB1_LED_RED] = { 7, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
- 986 },
+ [PWM_CH_DB0_LED_BLUE] = { 2, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
+ 986 },
+ [PWM_CH_DB1_LED_RED] = { 7, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
+ 986 },
[PWM_CH_DB1_LED_GREEN] = { 5, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
986 },
- [PWM_CH_DB1_LED_BLUE] = { 6, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
- 986 },
+ [PWM_CH_DB1_LED_BLUE] = { 6, PWM_CONFIG_ACTIVE_LOW | PWM_CONFIG_DSLEEP,
+ 986 },
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
/* I2C port map */
const struct i2c_port_t i2c_ports[] = {
- {
- .name = "battery",
- .port = I2C_PORT_BATTERY,
- .kbps = 100,
- .scl = GPIO_EC_I2C4_BATTERY_SCL,
- .sda = GPIO_EC_I2C4_BATTERY_SDA
- },
-
- {
- .name = "power",
- .port = I2C_PORT_POWER,
- .kbps = 100,
- .scl = GPIO_EC_I2C0_POWER_SCL,
- .sda = GPIO_EC_I2C0_POWER_SDA
- },
-
- {
- .name = "als_gyro",
- .port = I2C_PORT_ALS_GYRO,
- .kbps = 400,
- .scl = GPIO_EC_I2C5_ALS_GYRO_SCL,
- .sda = GPIO_EC_I2C5_ALS_GYRO_SDA
- },
-
- {
- .name = "usbc0",
- .port = I2C_PORT_USB_C0,
- .kbps = 100,
- .scl = GPIO_USB_C0_SCL,
- .sda = GPIO_USB_C0_SDA
- },
-
- {
- .name = "usbc1",
- .port = I2C_PORT_USB_C1,
- .kbps = 100,
- .scl = GPIO_USB_C1_SCL,
- .sda = GPIO_USB_C1_SDA
- },
+ { .name = "battery",
+ .port = I2C_PORT_BATTERY,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C4_BATTERY_SCL,
+ .sda = GPIO_EC_I2C4_BATTERY_SDA },
+
+ { .name = "power",
+ .port = I2C_PORT_POWER,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C0_POWER_SCL,
+ .sda = GPIO_EC_I2C0_POWER_SDA },
+
+ { .name = "als_gyro",
+ .port = I2C_PORT_ALS_GYRO,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C5_ALS_GYRO_SCL,
+ .sda = GPIO_EC_I2C5_ALS_GYRO_SDA },
+
+ { .name = "usbc0",
+ .port = I2C_PORT_USB_C0,
+ .kbps = 100,
+ .scl = GPIO_USB_C0_SCL,
+ .sda = GPIO_USB_C0_SDA },
+
+ { .name = "usbc1",
+ .port = I2C_PORT_USB_C1,
+ .kbps = 100,
+ .scl = GPIO_USB_C1_SCL,
+ .sda = GPIO_USB_C1_SDA },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
-
/*
* Motion Sense
*/
@@ -191,11 +179,9 @@ static struct opt3001_drv_data_t g_opt3001_data = {
};
/* Matrix to rotate accel/gyro into standard reference frame. */
-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)}
-};
+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) } };
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
@@ -303,11 +289,9 @@ static void enable_sensor_irqs(void)
DECLARE_HOOK(HOOK_CHIPSET_RESUME, enable_sensor_irqs, HOOK_PRIO_DEFAULT);
struct ppc_config_t ppc_chips[] = {
- {
- .i2c_port = I2C_PORT_USB_C0,
- .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
- .drv = &sn5s330_drv
- },
+ { .i2c_port = I2C_PORT_USB_C0,
+ .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
+ .drv = &sn5s330_drv },
{
.i2c_port = I2C_PORT_USB_C1,
.i2c_addr_flags = SN5S330_ADDR0_FLAGS,
@@ -335,17 +319,23 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
-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,
- .driver = &tcpci_tcpm_usb_mux_driver,
- .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = 0,
+ .driver = &tcpci_tcpm_usb_mux_driver,
+ .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ },
},
{
- .usb_port = 1,
- .driver = &tcpci_tcpm_usb_mux_driver,
- .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ .mux =
+ &(const struct usb_mux){
+ .usb_port = 1,
+ .driver = &tcpci_tcpm_usb_mux_driver,
+ .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ },
},
};
@@ -366,8 +356,7 @@ DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_chipset_startup, HOOK_PRIO_DEFAULT);
static void imvp8_tune_deferred(void)
{
/* For the IMVP8, reduce the steps during decay from 3 to 1. */
- if (i2c_write16(I2C_PORT_POWER, I2C_ADDR_MP2949_FLAGS,
- 0xFA, 0x0AC5))
+ if (i2c_write16(I2C_PORT_POWER, I2C_ADDR_MP2949_FLAGS, 0xFA, 0x0AC5))
CPRINTS("Failed to change step decay!");
}
DECLARE_DEFERRED(imvp8_tune_deferred);
@@ -522,8 +511,7 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x38, 0x6a);
}
-__override void power_board_handle_host_sleep_event(
- enum host_sleep_event state)
+__override void power_board_handle_host_sleep_event(enum host_sleep_event state)
{
if (state == HOST_SLEEP_EVENT_S0IX_SUSPEND)
board_pmic_enable_slp_s0_vr_decay();
@@ -536,8 +524,7 @@ static void board_pmic_init(void)
int pgmask1;
/* Mask V5A_DS3_PG from PMIC PGMASK1. */
- if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
- 0x18, &pgmask1))
+ if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x18, &pgmask1))
return;
pgmask1 |= BIT(2);
i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x18, pgmask1);
@@ -611,19 +598,19 @@ static int read_gyro_sensor_temp(int idx, int *temp_ptr)
}
const struct temp_sensor_t temp_sensors[] = {
- {"Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0},
+ { "Battery", TEMP_SENSOR_TYPE_BATTERY, charge_get_battery_temp, 0 },
/* These BD99992GW temp sensors are only readable in S0 */
- {"Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM0},
- {"Charger", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM1},
- {"DRAM", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM2},
- {"eMMC", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
- BD99992GW_ADC_CHANNEL_SYSTHERM3},
+ { "Ambient", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
+ BD99992GW_ADC_CHANNEL_SYSTHERM0 },
+ { "Charger", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
+ BD99992GW_ADC_CHANNEL_SYSTHERM1 },
+ { "DRAM", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
+ BD99992GW_ADC_CHANNEL_SYSTHERM2 },
+ { "eMMC", TEMP_SENSOR_TYPE_BOARD, bd99992gw_get_val,
+ BD99992GW_ADC_CHANNEL_SYSTHERM3 },
/* The Gyro temperature sensor is only readable in S0. */
- {"Gyro", TEMP_SENSOR_TYPE_BOARD, read_gyro_sensor_temp, LID_GYRO}
+ { "Gyro", TEMP_SENSOR_TYPE_BOARD, read_gyro_sensor_temp, LID_GYRO }
};
BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
@@ -633,16 +620,15 @@ BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT);
*/
struct ec_thermal_config thermal_params[] = {
/* {Twarn, Thigh, Thalt}, fan_off, fan_max */
- {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Battery */
- {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Ambient */
- {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* Charger */
- {{0, C_TO_K(52), 0}, {0, 0, 0}, 0, 0}, /* DRAM */
- {{0, 0, 0}, {0, 0, 0}, 0, 0}, /* eMMC */
- {{0, 0, 0}, {0, 0, 0}, 0, 0} /* Gyro */
+ { { 0, 0, 0 }, { 0, 0, 0 }, 0, 0 }, /* Battery */
+ { { 0, 0, 0 }, { 0, 0, 0 }, 0, 0 }, /* Ambient */
+ { { 0, 0, 0 }, { 0, 0, 0 }, 0, 0 }, /* Charger */
+ { { 0, C_TO_K(52), 0 }, { 0, 0, 0 }, 0, 0 }, /* DRAM */
+ { { 0, 0, 0 }, { 0, 0, 0 }, 0, 0 }, /* eMMC */
+ { { 0, 0, 0 }, { 0, 0, 0 }, 0, 0 } /* Gyro */
};
BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT);
-
/*
* Check if PMIC fault registers indicate VR fault. If yes, print out fault
* register info to console. Additionally, set panic reason so that the OS can
@@ -655,8 +641,8 @@ static void board_report_pmic_fault(const char *str)
uint32_t info;
/* RESETIRQ1 -- Bit 4: VRFAULT */
- if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x8, &vrfault)
- != EC_SUCCESS)
+ if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x8, &vrfault) !=
+ EC_SUCCESS)
return;
if (!(vrfault & BIT(4)))
@@ -709,8 +695,7 @@ void board_set_tcpc_power_mode(int port, int mode)
int board_set_active_charge_port(int port)
{
- int is_real_port = (port >= 0 &&
- port < CONFIG_USB_PD_PORT_MAX_COUNT);
+ int is_real_port = (port >= 0 && port < CONFIG_USB_PD_PORT_MAX_COUNT);
int i;
int rv;
int old_port;
@@ -775,8 +760,8 @@ int board_set_active_charge_port(int port)
return EC_SUCCESS;
}
-void board_set_charge_limit(int port, int supplier, int charge_ma,
- int max_ma, int charge_mv)
+void board_set_charge_limit(int port, int supplier, int charge_ma, int max_ma,
+ int charge_mv)
{
int icl = MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT);
diff --git a/board/nocturne/board.h b/board/nocturne/board.h
index 2a21392313..279016ec98 100644
--- a/board/nocturne/board.h
+++ b/board/nocturne/board.h
@@ -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.
*/
@@ -12,14 +12,14 @@
* By default, enable all console messages excepted HC, ACPI and event:
* The sensor stack is generating a lot of activity.
*/
-#define CC_DEFAULT (CC_ALL & ~(CC_MASK(CC_EVENTS) | CC_MASK(CC_LPC)))
+#define CC_DEFAULT (CC_ALL & ~(CC_MASK(CC_EVENTS) | CC_MASK(CC_LPC)))
#undef CONFIG_HOSTCMD_DEBUG_MODE
#define CONFIG_HOSTCMD_DEBUG_MODE HCDEBUG_OFF
/* NPCX7 config */
-#define NPCX_UART_MODULE2 1 /* GPIO64/65 are used as UART pins. */
-#define NPCX_TACH_SEL2 0 /* No tach. */
-#define NPCX7_PWM1_SEL 0 /* GPIO C2 is not used as PWM1. */
+#define NPCX_UART_MODULE2 1 /* GPIO64/65 are used as UART pins. */
+#define NPCX_TACH_SEL2 0 /* No tach. */
+#define NPCX7_PWM1_SEL 0 /* GPIO C2 is not used as PWM1. */
#define CONFIG_HIBERNATE_PSL
/* Internal SPI flash on NPCX7 */
@@ -56,7 +56,7 @@
#define CONFIG_BATTERY_SMART
#define CONFIG_BATTERY_REVIVE_DISCONNECT
#define CONFIG_BATTERY_PRESENT_GPIO GPIO_BAT_PRESENT_L
-#define CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV 9000
+#define CONFIG_BATT_FULL_CHIPSET_OFF_INPUT_LIMIT_MV 9000
/* Buttons / Switches */
#define CONFIG_BASE_ATTACHED_SWITCH
@@ -85,7 +85,7 @@
/* MKBP */
#define CONFIG_MKBP_EVENT
-#define CONFIG_MKBP_EVENT_WAKEUP_MASK (1<<EC_MKBP_EVENT_SWITCH)
+#define CONFIG_MKBP_EVENT_WAKEUP_MASK (1 << EC_MKBP_EVENT_SWITCH)
#define CONFIG_MKBP_INPUT_DEVICES
#define CONFIG_MKBP_USE_GPIO_AND_HOST_EVENT
@@ -104,8 +104,7 @@
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT \
TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL)
#define CONFIG_SYNC
-#define CONFIG_SYNC_INT_EVENT \
- TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC)
+#define CONFIG_SYNC_INT_EVENT TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC)
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_BD99992GW
#define CONFIG_THERMISTOR_NCP15WB
@@ -160,9 +159,9 @@
#define CONFIG_USBC_VCONN_SWAP
/* Define typical operating power and max power. */
-#define PD_MAX_VOLTAGE_MV 20000
-#define PD_MAX_CURRENT_MA 3000
-#define PD_MAX_POWER_MW 45000
+#define PD_MAX_VOLTAGE_MV 20000
+#define PD_MAX_CURRENT_MA 3000
+#define PD_MAX_POWER_MW 45000
#define PD_OPERATING_POWER_MW 15000
/* TODO(aaboagye): Verify these timings. */
@@ -170,52 +169,52 @@
* delay to turn on the power supply max is ~16ms.
* delay to turn off the power supply max is about ~180ms.
*/
-#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
-#define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */
+#define PD_POWER_SUPPLY_TURN_ON_DELAY 30000 /* us */
+#define PD_POWER_SUPPLY_TURN_OFF_DELAY 250000 /* us */
/* I2C config */
-#define I2C_PORT_CHARGER I2C_PORT_POWER
-#define I2C_PORT_PMIC I2C_PORT_POWER
-#define I2C_PORT_POWER NPCX_I2C_PORT0_0
-#define I2C_PORT_BATTERY NPCX_I2C_PORT4_1
+#define I2C_PORT_CHARGER I2C_PORT_POWER
+#define I2C_PORT_PMIC I2C_PORT_POWER
+#define I2C_PORT_POWER NPCX_I2C_PORT0_0
+#define I2C_PORT_BATTERY NPCX_I2C_PORT4_1
#define I2C_PORT_ALS_GYRO NPCX_I2C_PORT5_0
-#define I2C_PORT_ACCEL I2C_PORT_ALS_GYRO
-#define I2C_PORT_USB_C0 NPCX_I2C_PORT1_0
-#define I2C_PORT_USB_C1 NPCX_I2C_PORT2_0
-#define I2C_PORT_THERMAL I2C_PORT_PMIC
+#define I2C_PORT_ACCEL I2C_PORT_ALS_GYRO
+#define I2C_PORT_USB_C0 NPCX_I2C_PORT1_0
+#define I2C_PORT_USB_C1 NPCX_I2C_PORT2_0
+#define I2C_PORT_THERMAL I2C_PORT_PMIC
#define GPIO_USB_C0_SCL GPIO_EC_I2C1_USB_C0_SCL
#define GPIO_USB_C0_SDA GPIO_EC_I2C1_USB_C0_SDA
#define GPIO_USB_C1_SCL GPIO_EC_I2C2_USB_C1_SCL
#define GPIO_USB_C1_SDA GPIO_EC_I2C2_USB_C1_SDA
-#define I2C_ADDR_MP2949_FLAGS 0x20
+#define I2C_ADDR_MP2949_FLAGS 0x20
#define I2C_ADDR_BD99992_FLAGS 0x30
/*
* Remapping of schematic GPIO names to common GPIO names expected (hardcoded)
* in the EC code base.
*/
-#define GPIO_AC_PRESENT GPIO_ACOK_OD
+#define GPIO_AC_PRESENT GPIO_ACOK_OD
#define GPIO_ENABLE_BACKLIGHT GPIO_EC_BL_DISABLE_ODL
-#define GPIO_BAT_PRESENT_L GPIO_EC_BATT_PRES_L
-#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
-#define GPIO_PCH_PWRBTN_L GPIO_EC_PCH_PWR_BTN_L
-#define GPIO_PCH_RSMRST_L GPIO_RSMRST_L
-#define GPIO_PCH_RTCRST GPIO_EC_PCH_RTCRST
-#define GPIO_PCH_SLP_S0_L GPIO_SLP_S0_L
-#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
-#define GPIO_PCH_SLP_S4_L GPIO_SLP_S4_L
-#define GPIO_PCH_SLP_SUS_L GPIO_SLP_SUS_L_PCH
-#define GPIO_PCH_WAKE_L GPIO_EC_PCH_WAKE_L
-#define GPIO_PMIC_DPWROK GPIO_ROP_DSW_PWROK_EC
-#define GPIO_PMIC_SLP_SUS_L GPIO_SLP_SUS_L_PMIC
-#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_IN_ODL
-#define GPIO_CPU_PROCHOT GPIO_EC_PROCHOT_ODL
+#define GPIO_BAT_PRESENT_L GPIO_EC_BATT_PRES_L
+#define GPIO_ENTERING_RW GPIO_EC_ENTERING_RW
+#define GPIO_PCH_PWRBTN_L GPIO_EC_PCH_PWR_BTN_L
+#define GPIO_PCH_RSMRST_L GPIO_RSMRST_L
+#define GPIO_PCH_RTCRST GPIO_EC_PCH_RTCRST
+#define GPIO_PCH_SLP_S0_L GPIO_SLP_S0_L
+#define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L
+#define GPIO_PCH_SLP_S4_L GPIO_SLP_S4_L
+#define GPIO_PCH_SLP_SUS_L GPIO_SLP_SUS_L_PCH
+#define GPIO_PCH_WAKE_L GPIO_EC_PCH_WAKE_L
+#define GPIO_PMIC_DPWROK GPIO_ROP_DSW_PWROK_EC
+#define GPIO_PMIC_SLP_SUS_L GPIO_SLP_SUS_L_PMIC
+#define GPIO_POWER_BUTTON_L GPIO_EC_PWR_BTN_IN_ODL
+#define GPIO_CPU_PROCHOT GPIO_EC_PROCHOT_ODL
#define GPIO_PG_EC_RSMRST_ODL GPIO_ROP_EC_RSMRST_L
-#define GPIO_VOLUME_UP_L GPIO_H1_EC_VOL_UP_ODL
-#define GPIO_VOLUME_DOWN_L GPIO_H1_EC_VOL_DOWN_ODL
-#define GPIO_WP_L GPIO_EC_WP_L
+#define GPIO_VOLUME_UP_L GPIO_H1_EC_VOL_UP_ODL
+#define GPIO_VOLUME_DOWN_L GPIO_H1_EC_VOL_DOWN_ODL
+#define GPIO_WP_L GPIO_EC_WP_L
#define PORT_TO_HPD(port) ((port) ? GPIO_USB_C1_DP_HPD : GPIO_USB_C0_DP_HPD)
@@ -225,19 +224,15 @@
#include "registers.h"
/* ADC signal */
-enum adc_channel {
- ADC_BASE_ATTACH,
- ADC_BASE_DETACH,
- ADC_CH_COUNT
-};
+enum adc_channel { ADC_BASE_ATTACH, ADC_BASE_DETACH, ADC_CH_COUNT };
enum temp_sensor_id {
- TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */
- TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */
- TEMP_SENSOR_CHARGER, /* BD99992GW SYSTHERM1 */
- TEMP_SENSOR_DRAM, /* BD99992GW SYSTHERM2 */
- TEMP_SENSOR_EMMC, /* BD99992GW SYSTHERM3 */
- TEMP_SENSOR_GYRO, /* BMI160 */
+ TEMP_SENSOR_BATTERY, /* BD99956GW TSENSE */
+ TEMP_SENSOR_AMBIENT, /* BD99992GW SYSTHERM0 */
+ TEMP_SENSOR_CHARGER, /* BD99992GW SYSTHERM1 */
+ TEMP_SENSOR_DRAM, /* BD99992GW SYSTHERM2 */
+ TEMP_SENSOR_EMMC, /* BD99992GW SYSTHERM3 */
+ TEMP_SENSOR_GYRO, /* BMI160 */
TEMP_SENSOR_COUNT
};
diff --git a/board/nocturne/build.mk b/board/nocturne/build.mk
index 1c2e1e04f2..3a43716534 100644
--- a/board/nocturne/build.mk
+++ b/board/nocturne/build.mk
@@ -1,5 +1,5 @@
# -*- makefile -*-
-# 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.
#
diff --git a/board/nocturne/ec.tasklist b/board/nocturne/ec.tasklist
index 4fb7a035a9..5c7988f1d6 100644
--- a/board/nocturne/ec.tasklist
+++ b/board/nocturne/ec.tasklist
@@ -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.
*/
diff --git a/board/nocturne/gpio.inc b/board/nocturne/gpio.inc
index 75d2275424..e820bca8f0 100644
--- a/board/nocturne/gpio.inc
+++ b/board/nocturne/gpio.inc
@@ -1,6 +1,6 @@
/* -*- mode:c -*-
*
- * 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.
*/
diff --git a/board/nocturne/led.c b/board/nocturne/led.c
index b214a8df84..ba3320cd22 100644
--- a/board/nocturne/led.c
+++ b/board/nocturne/led.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.
*/
@@ -19,35 +19,35 @@ const enum ec_led_id supported_led_ids[] = {
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
struct pwm_led_color_map led_color_map_v3[EC_LED_COLOR_COUNT] = {
- /* Red, Green, Blue */
- [EC_LED_COLOR_RED] = { 36, 0, 0 },
- [EC_LED_COLOR_GREEN] = { 0, 15, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 0, 100 },
- [EC_LED_COLOR_YELLOW] = { 36, 15, 0 },
- [EC_LED_COLOR_WHITE] = { 30, 9, 15 },
- [EC_LED_COLOR_AMBER] = { 30, 1, 0 },
+ /* Red, Green, Blue */
+ [EC_LED_COLOR_RED] = { 36, 0, 0 },
+ [EC_LED_COLOR_GREEN] = { 0, 15, 0 },
+ [EC_LED_COLOR_BLUE] = { 0, 0, 100 },
+ [EC_LED_COLOR_YELLOW] = { 36, 15, 0 },
+ [EC_LED_COLOR_WHITE] = { 30, 9, 15 },
+ [EC_LED_COLOR_AMBER] = { 30, 1, 0 },
};
/* Map for board rev 2 */
struct pwm_led_color_map led_color_map_v2[EC_LED_COLOR_COUNT] = {
- /* Red, Green, Blue */
- [EC_LED_COLOR_RED] = { 62, 0, 0 },
- [EC_LED_COLOR_GREEN] = { 0, 31, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 0, 100 },
- [EC_LED_COLOR_YELLOW] = { 100, 54, 0 },
- [EC_LED_COLOR_WHITE] = { 70, 54, 100 },
- [EC_LED_COLOR_AMBER] = { 100, 15, 0 },
+ /* Red, Green, Blue */
+ [EC_LED_COLOR_RED] = { 62, 0, 0 },
+ [EC_LED_COLOR_GREEN] = { 0, 31, 0 },
+ [EC_LED_COLOR_BLUE] = { 0, 0, 100 },
+ [EC_LED_COLOR_YELLOW] = { 100, 54, 0 },
+ [EC_LED_COLOR_WHITE] = { 70, 54, 100 },
+ [EC_LED_COLOR_AMBER] = { 100, 15, 0 },
};
/* Map for board rev 0 and 1 */
struct pwm_led_color_map led_color_map_v0_1[EC_LED_COLOR_COUNT] = {
- /* Red, Green, Blue */
- [EC_LED_COLOR_RED] = { 1, 0, 0 },
- [EC_LED_COLOR_GREEN] = { 0, 1, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 0, 1 },
- [EC_LED_COLOR_YELLOW] = { 1, 1, 0 },
- [EC_LED_COLOR_WHITE] = { 9, 15, 15 },
- [EC_LED_COLOR_AMBER] = { 15, 1, 0 },
+ /* Red, Green, Blue */
+ [EC_LED_COLOR_RED] = { 1, 0, 0 },
+ [EC_LED_COLOR_GREEN] = { 0, 1, 0 },
+ [EC_LED_COLOR_BLUE] = { 0, 0, 1 },
+ [EC_LED_COLOR_YELLOW] = { 1, 1, 0 },
+ [EC_LED_COLOR_WHITE] = { 9, 15, 15 },
+ [EC_LED_COLOR_AMBER] = { 15, 1, 0 },
};
struct pwm_led_color_map led_color_map[EC_LED_COLOR_COUNT] = { { 0 } };
@@ -135,4 +135,4 @@ static void select_color_map(void)
break;
}
}
-DECLARE_HOOK(HOOK_INIT, select_color_map, HOOK_PRIO_INIT_PWM-1);
+DECLARE_HOOK(HOOK_INIT, select_color_map, HOOK_PRIO_INIT_PWM - 1);
diff --git a/board/nocturne/usb_pd_policy.c b/board/nocturne/usb_pd_policy.c
index 14329b61b3..5f1e5af365 100644
--- a/board/nocturne/usb_pd_policy.c
+++ b/board/nocturne/usb_pd_policy.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.
*/
@@ -16,8 +16,8 @@
#include "usbc_ppc.h"
#include "util.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)
{
@@ -25,8 +25,7 @@ int pd_check_vconn_swap(int port)
return gpio_get_level(GPIO_EN_5V);
}
-__override void pd_execute_data_swap(int port,
- enum pd_data_role data_role)
+__override void pd_execute_data_swap(int port, enum pd_data_role data_role)
{
int level;
@@ -96,9 +95,8 @@ int pd_set_power_supply_ready(int port)
__override void svdm_safe_dp_mode(int port)
{
/* make DP interface safe until configure */
- usb_mux_set(port, USB_PD_MUX_NONE,
- USB_SWITCH_CONNECT,
- polarity_rm_dts(pd_get_polarity(port)));
+ usb_mux_set(port, USB_PD_MUX_NONE, USB_SWITCH_CONNECT,
+ polarity_rm_dts(pd_get_polarity(port)));
/*
* Isolate the SBU lines.