summaryrefslogtreecommitdiff
path: root/board/volteer
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-08 11:34:48 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-12 21:03:43 +0000
commit3c5b65d91e32e89d428bef7fb2520d3c91c59bef (patch)
tree52a4a565aa758fba3330bf3245fbda0d8b209308 /board/volteer
parent3775fdbf7e863603eb65ec52348a45d7139db628 (diff)
downloadchrome-ec-3c5b65d91e32e89d428bef7fb2520d3c91c59bef.tar.gz
volteer: Move tcpc_get_alert_status() to usbc_config
Move this function over so we can use it from Zephyr. BUG=b:175434113 BRANCH=none TEST=make BOARD=volteer -j30 build volteer on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Id84781093ff518c29e1829dc3933cb1c31803995 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2617365 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board/volteer')
-rw-r--r--board/volteer/board.c15
-rw-r--r--board/volteer/usbc_config.c17
2 files changed, 17 insertions, 15 deletions
diff --git a/board/volteer/board.c b/board/volteer/board.c
index 39a6b13059..dd92ee499c 100644
--- a/board/volteer/board.c
+++ b/board/volteer/board.c
@@ -381,21 +381,6 @@ static void board_tcpc_init(void)
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_CHIPSET);
/******************************************************************************/
-/* TCPC support routines */
-uint16_t tcpc_get_alert_status(void)
-{
- uint16_t status = 0;
-
- /*
- * Check which port has the ALERT line set
- */
- if (!gpio_get_level(GPIO_USB_C0_TCPC_INT_ODL))
- status |= PD_STATUS_TCPC_ALERT_0;
- if (!gpio_get_level(GPIO_USB_C1_TCPC_INT_ODL))
- status |= PD_STATUS_TCPC_ALERT_1;
-
- return status;
-}
int ppc_get_alert_status(int port)
{
diff --git a/board/volteer/usbc_config.c b/board/volteer/usbc_config.c
index 3e2aa2ef26..089f9e1221 100644
--- a/board/volteer/usbc_config.c
+++ b/board/volteer/usbc_config.c
@@ -242,3 +242,20 @@ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = {
},
};
BUILD_ASSERT(ARRAY_SIZE(pi3usb9201_bc12_chips) == USBC_PORT_COUNT);
+
+/******************************************************************************/
+/* TCPC support routines */
+uint16_t tcpc_get_alert_status(void)
+{
+ uint16_t status = 0;
+
+ /*
+ * Check which port has the ALERT line set
+ */
+ if (!gpio_get_level(GPIO_USB_C0_TCPC_INT_ODL))
+ status |= PD_STATUS_TCPC_ALERT_0;
+ if (!gpio_get_level(GPIO_USB_C1_TCPC_INT_ODL))
+ status |= PD_STATUS_TCPC_ALERT_1;
+
+ return status;
+}