diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-21 17:06:35 +1300 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-22 18:42:13 +0000 |
commit | 0dd76c6b92179c27ce443d7703db536558710c8a (patch) | |
tree | 9e19ac6190439089aa999ab50945220e7341eb60 /board/lazor | |
parent | b0d3f94d6b0aed60d1ea63f5811e3963b6eae806 (diff) | |
download | chrome-ec-0dd76c6b92179c27ce443d7703db536558710c8a.tar.gz |
lazor: Create a new file for USB-C config
With Zephyr we cannot compile board.c so we need to move the USB-C
code into a file that can be built by both Zephyr and ECOS.
Make a start on a new ucbc_config.c file, moving just the
tcpc_alert_event() function for now.
Update build.mk to separate out the files, keeping them in order. This
will make it easier to read as the list grows.
BUG=b:183296099
BRANCH=none
TEST=make BOARD=lazor -j4
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: I8943a9732408a1d3ce6a80c99d6a7d3565fbd7e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774914
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board/lazor')
-rw-r--r-- | board/lazor/board.c | 19 | ||||
-rw-r--r-- | board/lazor/build.mk | 7 | ||||
-rw-r--r-- | board/lazor/usbc_config.c | 28 |
3 files changed, 34 insertions, 20 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c index c9bde9b4fd..74ef41ad92 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -45,25 +45,6 @@ #include "gpio_list.h" -/* GPIO Interrupt Handlers */ -void tcpc_alert_event(enum gpio_signal signal) -{ - int port = -1; - - switch (signal) { - case GPIO_USB_C0_PD_INT_ODL: - port = 0; - break; - case GPIO_USB_C1_PD_INT_ODL: - port = 1; - break; - default: - return; - } - - schedule_deferred_pd_interrupt(port); -} - void usb0_evt(enum gpio_signal signal) { task_set_event(TASK_ID_USB_CHG_P0, USB_CHG_EVENT_BC12); diff --git a/board/lazor/build.mk b/board/lazor/build.mk index b8b2cbaa0b..b51eda7cfd 100644 --- a/board/lazor/build.mk +++ b/board/lazor/build.mk @@ -11,4 +11,9 @@ CHIP_FAMILY:=npcx7 CHIP_VARIANT:=npcx7m6fc BASEBOARD:=trogdor -board-y=battery.o board.o led.o sku.o switchcap.o +board-y+=battery.o +board-y+=board.o +board-y+=led.o +board-y+=sku.o +board-y+=switchcap.o +board-y+=usbc_config.o diff --git a/board/lazor/usbc_config.c b/board/lazor/usbc_config.c new file mode 100644 index 0000000000..eb9d5a1c6a --- /dev/null +++ b/board/lazor/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. + */ + +/* Lazor board-specific USB-C configuration */ + +#include "usb_pd.h" +#include "usbc_config.h" + +/* GPIO Interrupt Handlers */ +void tcpc_alert_event(enum gpio_signal signal) +{ + int port = -1; + + switch (signal) { + case GPIO_USB_C0_PD_INT_ODL: + port = 0; + break; + case GPIO_USB_C1_PD_INT_ODL: + port = 1; + break; + default: + return; + } + + schedule_deferred_pd_interrupt(port); +} |