diff options
author | Simon Glass <sjg@chromium.org> | 2021-06-11 16:38:32 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-16 00:27:41 +0000 |
commit | 883cc02f5e47d42b274dc5ac313415a5423fcae5 (patch) | |
tree | 63c376ab275b0bfcb45b62ababc25901195a36af /board | |
parent | bcbf91613cd102a020463b0bde9234f11230a7aa (diff) | |
download | chrome-ec-883cc02f5e47d42b274dc5ac313415a5423fcae5.tar.gz |
asurada: Move board USB-C code into a separate file
Move this code into a new file so that zephyr can build it as well as
ECOS.
BUG=b:189855648
BRANCH=none
TEST=make BOARD=asurada -j30
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I86e10ff02154d09fb7c967cbe86034689d262e47
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2956087
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/asurada/board.c | 33 | ||||
-rw-r--r-- | board/asurada/build.mk | 1 | ||||
-rw-r--r-- | board/asurada/usbc_config.c | 28 |
3 files changed, 29 insertions, 33 deletions
diff --git a/board/asurada/board.c b/board/asurada/board.c index 5f6218299a..2fb93fbdbf 100644 --- a/board/asurada/board.c +++ b/board/asurada/board.c @@ -16,15 +16,8 @@ #include "driver/accel_lis2dw12.h" #include "driver/accelgyro_bmi_common.h" #include "driver/als_tcs3400.h" -#include "driver/bc12/mt6360.h" -#include "driver/bc12/pi3usb9201.h" -#include "driver/charger/isl923x.h" -#include "driver/ppc/syv682x.h" #include "driver/tcpm/it83xx_pd.h" #include "driver/temp_sensor/thermistor.h" -#include "driver/usb_mux/it5205.h" -#include "driver/usb_mux/ps8743.h" -#include "extpower.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -32,7 +25,6 @@ #include "lid_switch.h" #include "motion_sense.h" #include "power.h" -#include "power_button.h" #include "pwm.h" #include "pwm_chip.h" #include "regulator.h" @@ -43,13 +35,6 @@ #include "temp_sensor.h" #include "timer.h" #include "uart.h" -#include "usb_charge.h" -#include "usb_mux.h" -#include "usb_pd_tcpm.h" -#include "usbc_ppc.h" - -#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) -#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) /* Initialize board. */ static void board_init(void) @@ -344,21 +329,3 @@ static void board_resume(void) gpio_set_level(GPIO_EN_5V_USM, 1); } DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_resume, HOOK_PRIO_DEFAULT); - -__override int syv682x_board_is_syv682c(int port) -{ - return board_get_version() > 2; -} - -void board_usb_mux_init(void) -{ - if (board_get_sub_board() == SUB_BOARD_TYPEC) { - ps8743_tune_usb_eq(&usb_muxes[1], - PS8743_USB_EQ_TX_12_8_DB, - PS8743_USB_EQ_RX_12_8_DB); - ps8743_write(&usb_muxes[1], - PS8743_REG_HS_DET_THRESHOLD, - PS8743_USB_HS_THRESH_NEG_10); - } -} -DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); diff --git a/board/asurada/build.mk b/board/asurada/build.mk index 8ecba2f691..d6866f8568 100644 --- a/board/asurada/build.mk +++ b/board/asurada/build.mk @@ -14,3 +14,4 @@ BASEBOARD:=asurada board-$(BOARD_HAYATO)=led_hayato.o board-$(BOARD_ASURADA)=led.o board-y+=battery.o board.o +board-y+=usbc_config.o diff --git a/board/asurada/usbc_config.c b/board/asurada/usbc_config.c new file mode 100644 index 0000000000..2f35816abb --- /dev/null +++ b/board/asurada/usbc_config.c @@ -0,0 +1,28 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* Asurada board-specific USB-C configuration */ + +#include "driver/ppc/syv682x.h" +#include "driver/usb_mux/ps8743.h" +#include "hooks.h" + +__override int syv682x_board_is_syv682c(int port) +{ + return board_get_version() > 2; +} + +void board_usb_mux_init(void) +{ + if (board_get_sub_board() == SUB_BOARD_TYPEC) { + ps8743_tune_usb_eq(&usb_muxes[1], + PS8743_USB_EQ_TX_12_8_DB, + PS8743_USB_EQ_RX_12_8_DB); + ps8743_write(&usb_muxes[1], + PS8743_REG_HS_DET_THRESHOLD, + PS8743_USB_HS_THRESH_NEG_10); + } +} +DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1); |