diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-22 14:18:41 +1300 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-24 19:54:15 +0000 |
commit | 301f79eec3b15786517983842c68621f72842db4 (patch) | |
tree | 97277d65da2136f68186e76678b335e912b87254 /board/lazor | |
parent | d66f859021c2d5d98df9641473a502a744940fa7 (diff) | |
download | chrome-ec-301f79eec3b15786517983842c68621f72842db4.tar.gz |
lazor: Move the USBC part of board init into usbc_config
Split the init function into two parts. Move the USBC part into the
common file so that zephyr can use it too.
BUG=b:183296099
BRANCH=none
TEST=build zephyr for lazor
Change-Id: Ib45e37fcd6123f8263f211ac2a3e7dec7ca12ec4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2777646
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board/lazor')
-rw-r--r-- | board/lazor/board.c | 7 | ||||
-rw-r--r-- | board/lazor/usbc_config.c | 12 |
2 files changed, 12 insertions, 7 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c index 15a647b831..bcd59419f8 100644 --- a/board/lazor/board.c +++ b/board/lazor/board.c @@ -388,13 +388,6 @@ DECLARE_HOOK(HOOK_INIT, board_update_sensor_config_from_sku, /* Initialize board. */ static void board_init(void) { - /* Enable BC1.2 interrupts */ - gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L); - gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L); - - /* Enable USB-A overcurrent interrupt */ - gpio_enable_interrupt(GPIO_USB_A0_OC_ODL); - /* * The H1 SBU line for CCD are behind PPC chip. The PPC internal FETs * for SBU may be disconnected after DP alt mode is off. Should enable diff --git a/board/lazor/usbc_config.c b/board/lazor/usbc_config.c index 0cd61e613a..b9ead659b2 100644 --- a/board/lazor/usbc_config.c +++ b/board/lazor/usbc_config.c @@ -184,6 +184,18 @@ __override int board_get_default_battery_type(void) return DEFAULT_BATTERY_TYPE; } +/* Initialize board USC-C things */ +static void board_init_usbc(void) +{ + /* Enable BC1.2 interrupts */ + gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L); + gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L); + + /* Enable USB-A overcurrent interrupt */ + gpio_enable_interrupt(GPIO_USB_A0_OC_ODL); +} +DECLARE_HOOK(HOOK_INIT, board_init_usbc, HOOK_PRIO_DEFAULT); + void board_tcpc_init(void) { /* Only reset TCPC if not sysjump */ |