diff options
author | Scott Collyer <scollyer@google.com> | 2021-03-24 13:09:09 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-17 22:05:23 +0000 |
commit | fba31a3ae244b6dfd18e4b59508aa45387161d81 (patch) | |
tree | 907e84f3517aa617a5eadfdbc9871268aad112f4 /baseboard/honeybuns/baseboard.c | |
parent | c01b28e5da86b783917523beaa97b1b81d38019c (diff) | |
download | chrome-ec-fba31a3ae244b6dfd18e4b59508aa45387161d81.tar.gz |
honeybuns: Add C2 initialization with power button on/off
This CL refactors code required for the user facing usbc port. This
port was only being initialized at init time and therefore would not
function properly following a power button off/on.
To avoid duplicating code, the functions used to initialize this port
and control VBUS were moved to usbc_support in baseboard so they can
be common and are now guarded by a GPIO macro so this can be board
specific for variants which don't have a PPC to control on this port.
BUG=b:164157329
BRANCH=quiche
TEST=Verifed that port C2 attaches as expected following power button
off/on sequence.
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I2f9500f7e58de674c6f7c12a95cebad45de166cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785198
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'baseboard/honeybuns/baseboard.c')
-rw-r--r-- | baseboard/honeybuns/baseboard.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/baseboard/honeybuns/baseboard.c b/baseboard/honeybuns/baseboard.c index 3425417b81..394a0bae28 100644 --- a/baseboard/honeybuns/baseboard.c +++ b/baseboard/honeybuns/baseboard.c @@ -200,6 +200,11 @@ static void baseboard_init(void) baseboard_set_mst_lane_control(dock_mf); } +#ifdef GPIO_USBC_UF_ATTACHED_SRC + /* Configure UF usbc ppc and check usbc state */ + baseboard_config_usbc_usb3_ppc(); +#endif /* GPIO_USBC_UF_ATTACHED_SRC */ + /* Enable power button interrupt */ gpio_enable_interrupt(GPIO_PWR_BTN); /* Set dock mf preference LED */ @@ -248,6 +253,10 @@ static void baseboard_power_on(void) } /* Enable usbc interrupts */ board_enable_usbc_interrupts(); + +#ifdef GPIO_USBC_UF_ATTACHED_SRC + baseboard_config_usbc_usb3_ppc(); +#endif } static void baseboard_power_off(void) |