summaryrefslogtreecommitdiff
path: root/zephyr/projects/corsola/src/krabby/usbc_config.c
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-11-18 14:51:09 +0800
committerCommit Bot <commit-bot@chromium.org>2021-11-24 08:47:26 +0000
commit5f96a5bd38931aa7d935874ee6dcf611e9c1738e (patch)
tree26f8b044b8f5124d656645553822ca24cfa6f9c4 /zephyr/projects/corsola/src/krabby/usbc_config.c
parent9548d4102490b0a80d597499b7f4f3c2f4a3577d (diff)
downloadchrome-ec-5f96a5bd38931aa7d935874ee6dcf611e9c1738e.tar.gz
corsola: drop corsola cros-EC board
Move corsola baseboard files and krabby files under zephyr/projects/corsola. Also, drop kingler cros-ec board since we are not using it yet, all the development is under zephyr. BUG=b:206553789 TEST=zmake testall BRANCH=main Change-Id: I7b0b56e4598ec049c0a1fecb8920d9134e0b3ae1 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289582 Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'zephyr/projects/corsola/src/krabby/usbc_config.c')
-rw-r--r--zephyr/projects/corsola/src/krabby/usbc_config.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/zephyr/projects/corsola/src/krabby/usbc_config.c b/zephyr/projects/corsola/src/krabby/usbc_config.c
new file mode 100644
index 0000000000..ee5d9483eb
--- /dev/null
+++ b/zephyr/projects/corsola/src/krabby/usbc_config.c
@@ -0,0 +1,40 @@
+/* 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.
+ */
+
+/* Krabby board-specific USB-C configuration */
+
+#include "driver/tcpm/it83xx_pd.h"
+#include "driver/usb_mux/ps8743.h"
+#include "hooks.h"
+
+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);
+
+const struct cc_para_t *board_get_cc_tuning_parameter(enum usbpd_port port)
+{
+ const static struct cc_para_t
+ cc_parameter[CONFIG_USB_PD_ITE_ACTIVE_PORT_COUNT] = {
+ {
+ .rising_time = IT83XX_TX_PRE_DRIVING_TIME_1_UNIT,
+ .falling_time = IT83XX_TX_PRE_DRIVING_TIME_2_UNIT,
+ },
+ {
+ .rising_time = IT83XX_TX_PRE_DRIVING_TIME_1_UNIT,
+ .falling_time = IT83XX_TX_PRE_DRIVING_TIME_2_UNIT,
+ },
+ };
+
+ return &cc_parameter[port];
+}