diff options
author | Diana Z <dzigterman@chromium.org> | 2022-06-02 11:39:42 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-02 22:48:36 +0000 |
commit | 8c159fefc0baa697263feacc5a217294056718d0 (patch) | |
tree | 65da5d4b5c102077021ae9f8a73fa8a94cec147e | |
parent | 48f6e378bec40a4550490367cc6ed9eb1aea9cc5 (diff) | |
download | chrome-ec-8c159fefc0baa697263feacc5a217294056718d0.tar.gz |
USB Mux: Set an event when AP mux sets complete
The AP will need to know when its selected mux has finished setting.
For now, most boards have at most one mux and one retimer, and so add
events for each of those.
BRANCH=None
BUG=b:208882941,b:155889939
TEST=on nipperkin, set muxes via the AP console and view the
corresponding events are set
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I52fcfe861f80e60bd01ab4bd610edb7cadf1e049
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3687080
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | driver/usb_mux/usb_mux.c | 10 | ||||
-rw-r--r-- | include/ec_commands.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/driver/usb_mux/usb_mux.c b/driver/usb_mux/usb_mux.c index 19596bd930..1dea4b8d29 100644 --- a/driver/usb_mux/usb_mux.c +++ b/driver/usb_mux/usb_mux.c @@ -332,6 +332,16 @@ static int configure_mux(int port, int index, if (mux_ptr->board_set) rv = mux_ptr->board_set(mux_ptr, lcl_state); + /* Inform the AP its selected mux is set */ + if (IS_ENABLED(CONFIG_USB_MUX_AP_CONTROL)) { + if (chip == 0) + pd_notify_event(port, + PD_STATUS_EVENT_MUX_0_SET_DONE); + else if (chip == 1) + pd_notify_event(port, + PD_STATUS_EVENT_MUX_1_SET_DONE); + } + break; case USB_MUX_GET_MODE: diff --git a/include/ec_commands.h b/include/ec_commands.h index d52c08fb75..3755acce19 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -6814,6 +6814,8 @@ enum tcpc_cc_polarity { #define PD_STATUS_EVENT_SOP_PRIME_DISC_DONE BIT(1) #define PD_STATUS_EVENT_HARD_RESET BIT(2) #define PD_STATUS_EVENT_DISCONNECTED BIT(3) +#define PD_STATUS_EVENT_MUX_0_SET_DONE BIT(4) +#define PD_STATUS_EVENT_MUX_1_SET_DONE BIT(5) /* * Encode and decode for BCD revision response |