diff options
author | li feng <li1.feng@intel.com> | 2021-01-26 21:03:56 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-05 17:54:00 +0000 |
commit | f529543ee11ef105b904deaba9c7a8c0f5d76454 (patch) | |
tree | a2db787c00aaf676641d6c30e5f9445e8f04711d /driver/usb_mux/usb_mux.c | |
parent | 8ef0b2b959ef21d66ca450a31f633fc1f9dfd32f (diff) | |
download | chrome-ec-f529543ee11ef105b904deaba9c7a8c0f5d76454.tar.gz |
retimer: PD port retimer firmware update support
Added one field to struct usb_mux_driver, which returns true if
retimer update is supported.
Moved query function from usb_retimer_fw_update.c to usb_mux.c.
BUG=b:162528867
BRANCH=none
TEST=Tested on Voxel, together with related coreboot and kernel changes.
EC returns correct port information to kernel.
Signed-off-by: li feng <li1.feng@intel.com>
Change-Id: I5cab34a14adbf0470cffe6a13234ad53b6f6a90c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2651866
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'driver/usb_mux/usb_mux.c')
-rw-r--r-- | driver/usb_mux/usb_mux.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c index 01f8f0ab6f..6f2739de4a 100644 --- a/driver/usb_mux/usb_mux.c +++ b/driver/usb_mux/usb_mux.c @@ -348,6 +348,25 @@ void usb_mux_hpd_update(int port, int hpd_lvl, int hpd_irq) } } +int usb_mux_retimer_fw_update_port_info(void) +{ + int i; + int port_info = 0; + const struct usb_mux *mux_ptr; + + for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++) { + mux_ptr = &usb_muxes[i]; + while (mux_ptr) { + if (mux_ptr->driver && + mux_ptr->driver->is_retimer_fw_update_capable && + mux_ptr->driver->is_retimer_fw_update_capable()) + port_info |= BIT(i); + mux_ptr = mux_ptr->next_mux; + } + } + return port_info; +} + static void mux_chipset_reset(void) { int port; |