diff options
author | Paul Ma <magf@bitland.corp-partner.google.com> | 2020-03-05 19:37:25 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-06 08:22:32 +0000 |
commit | cfd2561f5fa4d3d9044c34bd2ba082b4da88028f (patch) | |
tree | 2ab6627637cdbaff2fed88987eb3d5a26f3495e6 /baseboard/zork | |
parent | c56609d7ca4fcbc16d54a866435481c890861d96 (diff) | |
download | chrome-ec-cfd2561f5fa4d3d9044c34bd2ba082b4da88028f.tar.gz |
dalboz: add FSUSB42UMX driver
Add FSUSB42UMX support. This chip is used as SBU mux of usb
c0 port.
BUG=b:150398913
BRANCH=none
TEST=build dalboz ec successfully.
Change-Id: Ibd58c252b7e1256891df0626a0a7fb5292a9da84
Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2089213
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'baseboard/zork')
-rw-r--r-- | baseboard/zork/variant_dalboz.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/baseboard/zork/variant_dalboz.c b/baseboard/zork/variant_dalboz.c index 1d1a403203..3d7eb3de79 100644 --- a/baseboard/zork/variant_dalboz.c +++ b/baseboard/zork/variant_dalboz.c @@ -24,12 +24,47 @@ static void usba_retimer_off(void) } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, usba_retimer_off, HOOK_PRIO_DEFAULT); +/* + * USB C0 port SBU mux use standalone FSUSB42UMX + * chip and it need a board specific driver. + * Overall, it will use chained mux framework. + */ +static int fsusb42umx_set_mux(const struct usb_mux *me, mux_state_t mux_state) +{ + if (mux_state & USB_PD_MUX_POLARITY_INVERTED) + ioex_set_level(IOEX_USB_C0_SBU_FLIP, 1); + else + ioex_set_level(IOEX_USB_C0_SBU_FLIP, 0); + + return EC_SUCCESS; +} + +/* + * .init is not necessary here because it has nothing + * to do. Primary mux will handle mux state so .get is + * not needed as well. usb_mux.c can handle the situation + * properly. + */ +const struct usb_mux_driver usbc0_sbu_mux_driver = { + .set = fsusb42umx_set_mux, +}; + +/* + * Since FSUSB42UMX is not a i2c device, .i2c_port and + * .i2c_addr_flags are not required here. + */ +const struct usb_mux usbc0_sbu_mux = { + .usb_port = USBC_PORT_C0, + .driver = &usbc0_sbu_mux_driver, +}; + const struct usb_mux usb_muxes[] = { [USBC_PORT_C0] = { .usb_port = USBC_PORT_C0, .i2c_port = I2C_PORT_USB_AP_MUX, .i2c_addr_flags = AMD_FP5_MUX_I2C_ADDR_FLAGS, .driver = &amd_fp5_usb_mux_driver, + .next_mux = &usbc0_sbu_mux, }, [USBC_PORT_C1] = { .usb_port = USBC_PORT_C1, @@ -39,3 +74,4 @@ const struct usb_mux usb_muxes[] = { } }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); + |