diff options
author | Caveh Jalali <caveh@chromium.org> | 2021-06-10 01:56:46 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-12 02:26:00 +0000 |
commit | 077bb92c4a41db95d1dd1f824c19f87ac0b1d715 (patch) | |
tree | 4d2c32cfdef977c991cc96ff15ce0e4d881e11c2 /include/driver | |
parent | fd2276ad5b6403338df5dd096195cb5ceadaeae6 (diff) | |
download | chrome-ec-077bb92c4a41db95d1dd1f824c19f87ac0b1d715.tar.gz |
bb_retimer: Return status from bb_retimer_power_handle()
This allows the implementation of bb_retimer_power_handle() to return a
status value indicating whether the request was successful. The default
implementation simply controls a GPIO and is expected to succeed
unconditionally. More complex implementations may run into failure cases
that leave the BB unreachable. When this happens, device initialization
returns an error so the caller can take mitigating action.
USB MUX operations tend to be called from timing sensitive code paths in
the TCPM, so careful error handling helps avoid cascading problems like
PD negotiation failures.
BRANCH=none
BUG=b:181743576,b:188826559
TEST=buildall passes, PD still works on brya
Change-Id: If79078be26e47d758e2cd6cc385ff2b34fecff63
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954198
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Diffstat (limited to 'include/driver')
-rw-r--r-- | include/driver/retimer/bb_retimer_public.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/driver/retimer/bb_retimer_public.h b/include/driver/retimer/bb_retimer_public.h index c13ec67685..7d9832f4ea 100644 --- a/include/driver/retimer/bb_retimer_public.h +++ b/include/driver/retimer/bb_retimer_public.h @@ -36,8 +36,9 @@ extern struct bb_usb_control bb_controls[]; * @param me Pointer to USB mux * @param on_off BB retimer state to be changed * + * @return EC_SUCCESS, or non-zero on error. */ -__override_proto void bb_retimer_power_handle(const struct usb_mux *me, - int on_off); +__override_proto int bb_retimer_power_handle(const struct usb_mux *me, + int on_off); #endif /* __CROS_EC_DRIVER_RETIMER_BB_RETIMER_PUBLIC_H */ |