summaryrefslogtreecommitdiff
path: root/board/lazor
diff options
context:
space:
mode:
Diffstat (limited to 'board/lazor')
-rw-r--r--board/lazor/battery.c2
-rw-r--r--board/lazor/board.c158
-rw-r--r--board/lazor/board.h20
-rw-r--r--board/lazor/build.mk2
-rw-r--r--board/lazor/ec.tasklist2
-rw-r--r--board/lazor/gpio.inc2
-rw-r--r--board/lazor/hibernate.c2
-rw-r--r--board/lazor/led.c27
-rw-r--r--board/lazor/sku.c6
-rw-r--r--board/lazor/sku.h2
-rw-r--r--board/lazor/switchcap.c6
-rw-r--r--board/lazor/usbc_config.c61
-rw-r--r--board/lazor/usbc_config.h2
13 files changed, 124 insertions, 168 deletions
diff --git a/board/lazor/battery.c b/board/lazor/battery.c
index 6cad716e2c..61de35da12 100644
--- a/board/lazor/battery.c
+++ b/board/lazor/battery.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 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/lazor/board.c b/board/lazor/board.c
index e25b83d7db..974f09e55f 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -33,8 +33,9 @@
#include "usbc_config.h"
#include "usbc_ppc.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+/* Disable debug messages to free flash space */
+#define CPRINTS(format, args...)
+#define CPRINTF(format, args...)
#include "gpio_list.h"
@@ -46,10 +47,8 @@ __override struct keyboard_scan_config keyscan_config = {
* Unmask 0x08 in [0] (KSO_00/KSI_03, the new location of Search key);
* as it still uses the legacy location (KSO_01/KSI_00).
*/
- .actual_key_mask = {
- 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff,
- 0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca
- },
+ .actual_key_mask = { 0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xa4,
+ 0xff, 0xfe, 0x55, 0xfa, 0xca },
/* Other values should be the same as the default configuration. */
.debounce_down_us = 9 * MSEC,
.debounce_up_us = 30 * MSEC,
@@ -64,55 +63,44 @@ __override struct keyboard_scan_config keyscan_config = {
* that we don't have pin 0.
*/
const int keyboard_factory_scan_pins[][2] = {
- {-1, -1}, {0, 5}, {1, 1}, {1, 0}, {0, 6},
- {0, 7}, {-1, -1}, {-1, -1}, {1, 4}, {1, 3},
- {-1, -1}, {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}, {-1, -1},
- {-1, -1},
+ { -1, -1 }, { 0, 5 }, { 1, 1 }, { 1, 0 }, { 0, 6 }, { 0, 7 },
+ { -1, -1 }, { -1, -1 }, { 1, 4 }, { 1, 3 }, { -1, -1 }, { 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 }, { -1, -1 },
+ { -1, -1 },
};
const int keyboard_factory_scan_pins_used =
- ARRAY_SIZE(keyboard_factory_scan_pins);
+ ARRAY_SIZE(keyboard_factory_scan_pins);
/* I2C port map */
const struct i2c_port_t i2c_ports[] = {
- {
- .name = "power",
- .port = I2C_PORT_POWER,
- .kbps = 100,
- .scl = GPIO_EC_I2C_POWER_SCL,
- .sda = GPIO_EC_I2C_POWER_SDA
- },
- {
- .name = "tcpc0",
- .port = I2C_PORT_TCPC0,
- .kbps = 1000,
- .scl = GPIO_EC_I2C_USB_C0_PD_SCL,
- .sda = GPIO_EC_I2C_USB_C0_PD_SDA
- },
- {
- .name = "tcpc1",
- .port = I2C_PORT_TCPC1,
- .kbps = 1000,
- .scl = GPIO_EC_I2C_USB_C1_PD_SCL,
- .sda = GPIO_EC_I2C_USB_C1_PD_SDA
- },
- {
- .name = "eeprom",
- .port = I2C_PORT_EEPROM,
- .kbps = 400,
- .scl = GPIO_EC_I2C_EEPROM_SCL,
- .sda = GPIO_EC_I2C_EEPROM_SDA
- },
- {
- .name = "sensor",
- .port = I2C_PORT_SENSOR,
- .kbps = 400,
- .scl = GPIO_EC_I2C_SENSOR_SCL,
- .sda = GPIO_EC_I2C_SENSOR_SDA
- },
+ { .name = "power",
+ .port = I2C_PORT_POWER,
+ .kbps = 100,
+ .scl = GPIO_EC_I2C_POWER_SCL,
+ .sda = GPIO_EC_I2C_POWER_SDA },
+ { .name = "tcpc0",
+ .port = I2C_PORT_TCPC0,
+ .kbps = 1000,
+ .scl = GPIO_EC_I2C_USB_C0_PD_SCL,
+ .sda = GPIO_EC_I2C_USB_C0_PD_SDA },
+ { .name = "tcpc1",
+ .port = I2C_PORT_TCPC1,
+ .kbps = 1000,
+ .scl = GPIO_EC_I2C_USB_C1_PD_SCL,
+ .sda = GPIO_EC_I2C_USB_C1_PD_SDA },
+ { .name = "eeprom",
+ .port = I2C_PORT_EEPROM,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_EEPROM_SCL,
+ .sda = GPIO_EC_I2C_EEPROM_SDA },
+ { .name = "sensor",
+ .port = I2C_PORT_SENSOR,
+ .kbps = 400,
+ .scl = GPIO_EC_I2C_SENSOR_SCL,
+ .sda = GPIO_EC_I2C_SENSOR_SDA },
};
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
@@ -120,37 +108,22 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Measure VBUS through a 1/10 voltage divider */
- [ADC_VBUS] = {
- "VBUS",
- NPCX_ADC_CH1,
- ADC_MAX_VOLT * 10,
- ADC_READ_MAX + 1,
- 0
- },
+ [ADC_VBUS] = { "VBUS", NPCX_ADC_CH1, ADC_MAX_VOLT * 10,
+ ADC_READ_MAX + 1, 0 },
/*
* Adapter current output or battery charging/discharging current (uV)
* 18x amplification on charger side.
*/
- [ADC_AMON_BMON] = {
- "AMON_BMON",
- NPCX_ADC_CH2,
- ADC_MAX_VOLT * 1000 / 18,
- ADC_READ_MAX + 1,
- 0
- },
+ [ADC_AMON_BMON] = { "AMON_BMON", NPCX_ADC_CH2, ADC_MAX_VOLT * 1000 / 18,
+ ADC_READ_MAX + 1, 0 },
/*
* ISL9238 PSYS output is 1.44 uA/W over 5.6K resistor, to read
* 0.8V @ 99 W, i.e. 124000 uW/mV. Using ADC_MAX_VOLT*124000 and
* ADC_READ_MAX+1 as multiplier/divider leads to overflows, so we
* only divide by 2 (enough to avoid precision issues).
*/
- [ADC_PSYS] = {
- "PSYS",
- NPCX_ADC_CH3,
- ADC_MAX_VOLT * 124000 * 2 / (ADC_READ_MAX + 1),
- 2,
- 0
- },
+ [ADC_PSYS] = { "PSYS", NPCX_ADC_CH3,
+ ADC_MAX_VOLT * 124000 * 2 / (ADC_READ_MAX + 1), 2, 0 },
};
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
@@ -177,29 +150,21 @@ enum base_accelgyro_type {
};
/* Matrix to rotate accelerometer into standard reference frame */
-const mat33_fp_t base_standard_ref_bmi160 = {
- { 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_bmi160 = { { 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_icm426xx = {
- { 0, FLOAT_TO_FP(1), 0},
- { FLOAT_TO_FP(1), 0, 0},
- { 0, 0, FLOAT_TO_FP(-1)}
-};
+const mat33_fp_t base_standard_ref_icm426xx = { { 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_bma255 = {
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t lid_standard_ref_bma255 = { { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
-static const mat33_fp_t lid_standard_ref_kx022 = {
- { FLOAT_TO_FP(-1), 0, 0},
- { 0, FLOAT_TO_FP(-1), 0},
- { 0, 0, FLOAT_TO_FP(1)}
-};
+static const mat33_fp_t lid_standard_ref_kx022 = { { FLOAT_TO_FP(-1), 0, 0 },
+ { 0, FLOAT_TO_FP(-1), 0 },
+ { 0, 0, FLOAT_TO_FP(1) } };
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
@@ -371,7 +336,7 @@ static void board_detect_motionsensor(void)
/* Check lid accel chip */
ret = i2c_read8(I2C_PORT_SENSOR, BMA2x2_I2C_ADDR1_FLAGS,
- BMA2x2_CHIP_ID_ADDR, &val);
+ BMA2x2_CHIP_ID_ADDR, &val);
if (ret)
motion_sensors[LID_ACCEL] = kx022_lid_accel;
@@ -384,10 +349,11 @@ static void board_detect_motionsensor(void)
motion_sensors[BASE_GYRO] = icm426xx_base_gyro;
}
- base_accelgyro_config = (val == ICM426XX_CHIP_ICM40608)
- ? BASE_GYRO_ICM426XX : BASE_GYRO_BMI160;
- CPRINTS("Base Accelgyro: %s", (val == ICM426XX_CHIP_ICM40608)
- ? "ICM40608" : "BMI160");
+ base_accelgyro_config = (val == ICM426XX_CHIP_ICM40608) ?
+ BASE_GYRO_ICM426XX :
+ BASE_GYRO_BMI160;
+ CPRINTS("Base Accelgyro: %s",
+ (val == ICM426XX_CHIP_ICM40608) ? "ICM40608" : "BMI160");
}
static void board_update_sensor_config_from_sku(void)
diff --git a/board/lazor/board.h b/board/lazor/board.h
index f4f722c6a2..427db5e82e 100644
--- a/board/lazor/board.h
+++ b/board/lazor/board.h
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -11,9 +11,10 @@
#include "baseboard.h"
/* Internal SPI flash on NPCX7 */
-#define CONFIG_FLASH_SIZE_BYTES (512 * 1024) /* 512KB internal spi flash */
+#define CONFIG_FLASH_SIZE_BYTES (512 * 1024) /* 512KB internal spi flash */
/* Reduce flash usage */
+#define CONFIG_LTO
#define CONFIG_USB_PD_DEBUG_LEVEL 2
/* Switchcap */
@@ -25,7 +26,7 @@
#define CONFIG_PWM_KBLIGHT
/* Battery */
-#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION"
+#define CONFIG_BATTERY_DEVICE_CHEMISTRY "LION"
#define CONFIG_BATTERY_REVIVE_DISCONNECT
#define CONFIG_BATTERY_FUEL_GAUGE
@@ -91,12 +92,7 @@
#include "registers.h"
#include "sku.h"
-enum adc_channel {
- ADC_VBUS,
- ADC_AMON_BMON,
- ADC_PSYS,
- ADC_CH_COUNT
-};
+enum adc_channel { ADC_VBUS, ADC_AMON_BMON, ADC_PSYS, ADC_CH_COUNT };
/* Motion sensors */
enum sensor_id {
@@ -106,11 +102,7 @@ enum sensor_id {
SENSOR_COUNT,
};
-enum pwm_channel {
- PWM_CH_KBLIGHT = 0,
- PWM_CH_DISPLIGHT,
- PWM_CH_COUNT
-};
+enum pwm_channel { PWM_CH_KBLIGHT = 0, PWM_CH_DISPLIGHT, PWM_CH_COUNT };
/* List of possible batteries */
enum battery_type {
diff --git a/board/lazor/build.mk b/board/lazor/build.mk
index 8cf8679e35..c17ab5e40c 100644
--- a/board/lazor/build.mk
+++ b/board/lazor/build.mk
@@ -1,5 +1,5 @@
# -*- makefile -*-
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2020 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/lazor/ec.tasklist b/board/lazor/ec.tasklist
index 2b55c26c20..92d5a1dde1 100644
--- a/board/lazor/ec.tasklist
+++ b/board/lazor/ec.tasklist
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 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/lazor/gpio.inc b/board/lazor/gpio.inc
index b5c15b3729..c7af05eb3b 100644
--- a/board/lazor/gpio.inc
+++ b/board/lazor/gpio.inc
@@ -1,6 +1,6 @@
/* -*- mode:c -*-
*
- * Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Copyright 2020 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/lazor/hibernate.c b/board/lazor/hibernate.c
index d262a33121..67d9b30791 100644
--- a/board/lazor/hibernate.c
+++ b/board/lazor/hibernate.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/lazor/led.c b/board/lazor/led.c
index f9c91c1c6a..cf1f68d77e 100644
--- a/board/lazor/led.c
+++ b/board/lazor/led.c
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
@@ -32,15 +32,15 @@ enum led_color {
LED_OFF = 0,
LED_AMBER,
LED_BLUE,
- LED_COLOR_COUNT /* Number of colors, not a color itself */
+ LED_COLOR_COUNT /* Number of colors, not a color itself */
};
static void led_set_color(enum led_color color)
{
gpio_set_level(GPIO_EC_CHG_LED_Y_C1,
- (color == LED_AMBER) ? BAT_LED_ON : BAT_LED_OFF);
+ (color == LED_AMBER) ? BAT_LED_ON : BAT_LED_OFF);
gpio_set_level(GPIO_EC_CHG_LED_B_C1,
- (color == LED_BLUE) ? BAT_LED_ON : BAT_LED_OFF);
+ (color == LED_BLUE) ? BAT_LED_ON : BAT_LED_OFF);
}
void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
@@ -66,7 +66,6 @@ static void board_led_set_battery(void)
static int battery_ticks;
int color = LED_OFF;
int period = 0;
- uint32_t chflags = charge_get_flags();
battery_ticks++;
@@ -106,16 +105,16 @@ static void board_led_set_battery(void)
color = LED_BLUE;
break;
case PWR_STATE_IDLE: /* External power connected in IDLE */
- if (chflags & CHARGE_FLAG_FORCE_IDLE) {
- /* Factory mode: Blue 2 sec, Amber 2 sec */
- period = (2 + 2) * LED_ONE_SEC;
- battery_ticks = battery_ticks % period;
- if (battery_ticks < 2 * LED_ONE_SEC)
- color = LED_BLUE;
- else
- color = LED_AMBER;
- } else
+ color = LED_BLUE;
+ break;
+ case PWR_STATE_FORCED_IDLE:
+ /* Factory mode: Blue 2 sec, Amber 2 sec */
+ period = (2 + 2) * LED_ONE_SEC;
+ battery_ticks = battery_ticks % period;
+ if (battery_ticks < 2 * LED_ONE_SEC)
color = LED_BLUE;
+ else
+ color = LED_AMBER;
break;
default:
/* Other states don't alter LED behavior */
diff --git a/board/lazor/sku.c b/board/lazor/sku.c
index 1f63d05bf6..625231f5a9 100644
--- a/board/lazor/sku.c
+++ b/board/lazor/sku.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.
*/
@@ -14,8 +14,8 @@
#include "system.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 uint8_t sku_id;
diff --git a/board/lazor/sku.h b/board/lazor/sku.h
index 85f549858a..3ba687939d 100644
--- a/board/lazor/sku.h
+++ b/board/lazor/sku.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.
*/
diff --git a/board/lazor/switchcap.c b/board/lazor/switchcap.c
index 16f4a54c79..f18378cab7 100644
--- a/board/lazor/switchcap.c
+++ b/board/lazor/switchcap.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.
*/
@@ -14,8 +14,8 @@
#include "system.h"
#include "sku.h"
-#define CPRINTS(format, args...) cprints(CC_I2C, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_I2C, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_I2C, format, ##args)
+#define CPRINTF(format, args...) cprintf(CC_I2C, format, ##args)
/* LN9310 switchcap */
const struct ln9310_config_t ln9310_config = {
diff --git a/board/lazor/usbc_config.c b/board/lazor/usbc_config.c
index 59951223ec..11cc649573 100644
--- a/board/lazor/usbc_config.c
+++ b/board/lazor/usbc_config.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,8 +27,9 @@
#include "usbc_ocp.h"
#include "usbc_ppc.h"
-#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
-#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+/* Disable debug messages to free flash space */
+#define CPRINTS(format, args...)
+#define CPRINTF(format, args...)
const struct charger_config_t chg_chips[] = {
{
@@ -149,16 +150,12 @@ void tcpc_alert_event(enum gpio_signal signal)
/* Power Path Controller */
struct ppc_config_t ppc_chips[] = {
- {
- .i2c_port = I2C_PORT_TCPC0,
- .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
- .drv = &sn5s330_drv
- },
- {
- .i2c_port = I2C_PORT_TCPC1,
- .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
- .drv = &sn5s330_drv
- },
+ { .i2c_port = I2C_PORT_TCPC0,
+ .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
+ .drv = &sn5s330_drv },
+ { .i2c_port = I2C_PORT_TCPC1,
+ .i2c_addr_flags = SN5S330_ADDR0_FLAGS,
+ .drv = &sn5s330_drv },
};
unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
@@ -189,16 +186,22 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
* to AP. But the TCPC chip is also needed to know the HPD status; otherwise,
* the mux misbehaves.
*/
-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,
+ },
}
};
@@ -271,7 +274,7 @@ void board_tcpc_init(void)
*/
for (int port = 0; port < CONFIG_USB_PD_PORT_MAX_COUNT; ++port)
usb_mux_hpd_update(port, USB_PD_MUX_HPD_LVL_DEASSERTED |
- USB_PD_MUX_HPD_IRQ_DEASSERTED);
+ USB_PD_MUX_HPD_IRQ_DEASSERTED);
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C + 1);
@@ -316,8 +319,7 @@ void board_overcurrent_event(int port, int is_overcurrented)
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;
if (!is_real_port && port != CHARGE_PORT_NONE)
@@ -345,7 +347,6 @@ int board_set_active_charge_port(int port)
return EC_ERROR_INVAL;
}
-
CPRINTS("New charge port: p%d", port);
/*
@@ -369,23 +370,21 @@ 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)
{
/*
* Ignore lower charge ceiling on PD transition if our battery is
* critical, as we may brownout.
*/
- if (supplier == CHARGE_SUPPLIER_PD &&
- charge_ma < 1500 &&
+ if (supplier == CHARGE_SUPPLIER_PD && charge_ma < 1500 &&
charge_get_percent() < CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON) {
CPRINTS("Using max ilim %d", max_ma);
charge_ma = max_ma;
}
- charge_set_input_current_limit(MAX(charge_ma,
- CONFIG_CHARGER_INPUT_CURRENT),
- charge_mv);
+ charge_set_input_current_limit(
+ MAX(charge_ma, CONFIG_CHARGER_INPUT_CURRENT), charge_mv);
}
uint16_t tcpc_get_alert_status(void)
diff --git a/board/lazor/usbc_config.h b/board/lazor/usbc_config.h
index 9c1d8d1e74..53d6df3983 100644
--- a/board/lazor/usbc_config.h
+++ b/board/lazor/usbc_config.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.
*/