diff options
Diffstat (limited to 'board/wheelie')
-rw-r--r-- | board/wheelie/battery.c | 2 | ||||
-rw-r--r-- | board/wheelie/board.c | 107 | ||||
-rw-r--r-- | board/wheelie/board.h | 50 | ||||
-rw-r--r-- | board/wheelie/build.mk | 2 | ||||
-rw-r--r-- | board/wheelie/cbi_ssfc.c | 6 | ||||
-rw-r--r-- | board/wheelie/cbi_ssfc.h | 3 | ||||
-rw-r--r-- | board/wheelie/ec.tasklist | 2 | ||||
-rw-r--r-- | board/wheelie/gpio.inc | 2 | ||||
-rw-r--r-- | board/wheelie/led.c | 16 | ||||
-rw-r--r-- | board/wheelie/usb_pd_policy.c | 6 |
10 files changed, 93 insertions, 103 deletions
diff --git a/board/wheelie/battery.c b/board/wheelie/battery.c index 96d967abec..bc2c5bec4d 100644 --- a/board/wheelie/battery.c +++ b/board/wheelie/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/wheelie/board.c b/board/wheelie/board.c index 0ad7590a31..9708dcca82 100644 --- a/board/wheelie/board.c +++ b/board/wheelie/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. */ @@ -40,7 +40,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) /* C0 interrupt line shared by BC 1.2 and charger */ static void usb_c0_interrupt(enum gpio_signal s) @@ -68,34 +68,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_SUB_ANALOG] = { - .name = "SUB_ANALOG", - .factor_mul = ADC_MAX_MVOLT, - .factor_div = ADC_READ_MAX + 1, - .shift = 0, - .channel = CHIP_ADC_CH13 - }, + [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_SUB_ANALOG] = { .name = "SUB_ANALOG", + .factor_mul = ADC_MAX_MVOLT, + .factor_div = ADC_READ_MAX + 1, + .shift = 0, + .channel = CHIP_ADC_CH13 }, }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); @@ -143,27 +135,36 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = { }; /* USB Retimer */ -const struct usb_mux usbc1_retimer = { - .usb_port = 1, - .i2c_port = I2C_PORT_SUB_USB_C1, - .i2c_addr_flags = TUSB544_I2C_ADDR_FLAGS0, - .driver = &tusb544_drv, +const struct usb_mux_chain usbc1_retimer = { + .mux = + &(const struct usb_mux){ + .usb_port = 1, + .i2c_port = I2C_PORT_SUB_USB_C1, + .i2c_addr_flags = TUSB544_I2C_ADDR_FLAGS0, + .driver = &tusb544_drv, + }, }; /* 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, + }, }, { - .usb_port = 1, - .i2c_port = I2C_PORT_SUB_USB_C1, - .i2c_addr_flags = AN7447_TCPC0_I2C_ADDR_FLAGS, - .driver = &anx7447_usb_mux_driver, - .next_mux = &usbc1_retimer, + .mux = + &(const struct usb_mux){ + .usb_port = 1, + .i2c_port = I2C_PORT_SUB_USB_C1, + .i2c_addr_flags = AN7447_TCPC0_I2C_ADDR_FLAGS, + .driver = &anx7447_usb_mux_driver, + }, + .next = &usbc1_retimer, }, }; @@ -445,14 +446,14 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); /* Thermistors */ const struct temp_sensor_t temp_sensors[] = { - [TEMP_SENSOR_1] = {.name = "Memory", - .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_1] = { .name = "Memory", + .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 }, }; BUILD_ASSERT(ARRAY_SIZE(temp_sensors) == TEMP_SENSOR_COUNT); diff --git a/board/wheelie/board.h b/board/wheelie/board.h index 194c49adb6..c53f22b512 100644 --- a/board/wheelie/board.h +++ b/board/wheelie/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. */ @@ -22,12 +22,13 @@ #define CONFIG_BC12_DETECT_PI3USB9201 /* Charger */ -#define CONFIG_CHARGER_SM5803 /* C0 and C1: Charger */ -#define CONFIG_FPU /* For charger calculations */ +#define CONFIG_CHARGER_SM5803 /* C0 and C1: Charger */ +#define PD_MAX_VOLTAGE_MV 15000 +#define CONFIG_FPU /* For charger calculations */ #define CONFIG_USB_PD_VBUS_DETECT_CHARGER #define CONFIG_USB_PD_5V_CHARGER_CTRL #define CONFIG_CHARGER_OTG -#undef CONFIG_CHARGER_SINGLE_CHIP +#undef CONFIG_CHARGER_SINGLE_CHIP /* LED */ #define CONFIG_LED_PWM @@ -37,9 +38,9 @@ #define CONFIG_PWM /* Sensors */ -#define CONFIG_ACCEL_LIS2DE /* Lid accel */ -#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ -#define CONFIG_SYNC /* Camera VSYNC */ +#define CONFIG_ACCEL_LIS2DE /* Lid accel */ +#define CONFIG_ACCELGYRO_LSM6DSM /* Base accel */ +#define CONFIG_SYNC /* Camera VSYNC */ #define CONFIG_ACCEL_LSM6DSM_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) /* Sensors without hardware FIFO are in forced mode */ @@ -56,8 +57,7 @@ #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL -#define CONFIG_SYNC_INT_EVENT \ - TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC) +#define CONFIG_SYNC_INT_EVENT TASK_EVENT_MOTION_SENSOR_INTERRUPT(VSYNC) #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH @@ -65,8 +65,8 @@ /* TCPC */ #define CONFIG_USB_PD_PORT_MAX_COUNT 2 -#define CONFIG_USB_PD_TCPM_ITE_ON_CHIP /* C0: ITE EC TCPC */ -#define CONFIG_USB_PD_TCPM_ANX7447 /* C1: ANX TCPC + Mux */ +#define CONFIG_USB_PD_TCPM_ITE_ON_CHIP /* C0: ITE EC TCPC */ +#define CONFIG_USB_PD_TCPM_ANX7447 /* C1: ANX TCPC + Mux */ #define CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT 1 /* Thermistors */ @@ -75,10 +75,10 @@ #define CONFIG_STEINHART_HART_3V3_51K1_47K_4050B /* USB Mux and Retimer */ -#define CONFIG_USB_MUX_IT5205 /* C1: ITE Mux */ -#define I2C_PORT_USB_MUX I2C_PORT_USB_C0 /* Required for ITE Mux */ +#define CONFIG_USB_MUX_IT5205 /* C1: ITE Mux */ +#define I2C_PORT_USB_MUX I2C_PORT_USB_C0 /* Required for ITE Mux */ -#define CONFIG_USBC_RETIMER_TUSB544 /* C1 Redriver: TUSB544 */ +#define CONFIG_USBC_RETIMER_TUSB544 /* C1 Redriver: TUSB544 */ #ifndef __ASSEMBLER__ @@ -100,28 +100,18 @@ enum pwm_channel { }; /* Motion sensors */ -enum sensor_id { - LID_ACCEL, - BASE_ACCEL, - BASE_GYRO, - VSYNC, - SENSOR_COUNT -}; +enum sensor_id { LID_ACCEL, BASE_ACCEL, BASE_GYRO, VSYNC, SENSOR_COUNT }; /* ADC channels */ enum adc_channel { - ADC_VSNS_PP3300_A, /* ADC0 */ - ADC_TEMP_SENSOR_1, /* ADC2 */ - ADC_TEMP_SENSOR_2, /* ADC3 */ - ADC_SUB_ANALOG, /* ADC13 */ + ADC_VSNS_PP3300_A, /* ADC0 */ + ADC_TEMP_SENSOR_1, /* ADC2 */ + ADC_TEMP_SENSOR_2, /* ADC3 */ + ADC_SUB_ANALOG, /* ADC13 */ ADC_CH_COUNT }; -enum temp_sensor_id { - TEMP_SENSOR_1, - TEMP_SENSOR_2, - TEMP_SENSOR_COUNT -}; +enum temp_sensor_id { TEMP_SENSOR_1, TEMP_SENSOR_2, TEMP_SENSOR_COUNT }; /* List of possible batteries */ enum battery_type { diff --git a/board/wheelie/build.mk b/board/wheelie/build.mk index 806168ea0d..9b862c7624 100644 --- a/board/wheelie/build.mk +++ b/board/wheelie/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/wheelie/cbi_ssfc.c b/board/wheelie/cbi_ssfc.c index c4b859f133..81f3ee0dad 100644 --- a/board/wheelie/cbi_ssfc.c +++ b/board/wheelie/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/wheelie/cbi_ssfc.h b/board/wheelie/cbi_ssfc.h index 935049b6ae..bf8853a43a 100644 --- a/board/wheelie/cbi_ssfc.h +++ b/board/wheelie/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/wheelie/ec.tasklist b/board/wheelie/ec.tasklist index 75181a4531..701c1fa099 100644 --- a/board/wheelie/ec.tasklist +++ b/board/wheelie/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/wheelie/gpio.inc b/board/wheelie/gpio.inc index 8979ca6ab9..eb96828e07 100644 --- a/board/wheelie/gpio.inc +++ b/board/wheelie/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/wheelie/led.c b/board/wheelie/led.c index 9524a68a84..59518dbe6c 100644 --- a/board/wheelie/led.c +++ b/board/wheelie/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. */ @@ -20,13 +20,13 @@ const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids); * Board has one physical LED with red, green, and blue */ struct pwm_led_color_map led_color_map[EC_LED_COLOR_COUNT] = { - /* Red, Green, Blue */ - [EC_LED_COLOR_RED] = { 100, 0, 0 }, - [EC_LED_COLOR_GREEN] = { 0, 100, 0 }, - [EC_LED_COLOR_BLUE] = { 0, 0, 100 }, - [EC_LED_COLOR_YELLOW] = { 50, 50, 0 }, - [EC_LED_COLOR_WHITE] = { 50, 50, 50 }, - [EC_LED_COLOR_AMBER] = { 70, 30, 0 }, + /* Red, Green, Blue */ + [EC_LED_COLOR_RED] = { 100, 0, 0 }, + [EC_LED_COLOR_GREEN] = { 0, 100, 0 }, + [EC_LED_COLOR_BLUE] = { 0, 0, 100 }, + [EC_LED_COLOR_YELLOW] = { 50, 50, 0 }, + [EC_LED_COLOR_WHITE] = { 50, 50, 50 }, + [EC_LED_COLOR_AMBER] = { 70, 30, 0 }, }; /* One logical LED with red, green, and blue channels. */ diff --git a/board/wheelie/usb_pd_policy.c b/board/wheelie/usb_pd_policy.c index 02ae21a420..3c7564fa12 100644 --- a/board/wheelie/usb_pd_policy.c +++ b/board/wheelie/usb_pd_policy.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. */ @@ -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) { |