From eaa219b5bba95cfdc03b9b20d1c06d84bd33c702 Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Thu, 4 Jun 2020 02:16:23 -0700 Subject: libpayload: drivers/usb: add a USB pre-poll hook This adds a hook so that a payload can optionally perform USB service functions in conjunction with regular USB port status polling. In particular, this allows depthcharge to control the state of an external USB mux. Some SoCs like Tiger Lake have a USB mux for Type-C ports that must be kept in sync with the state of the port as reported by the TCPC. This can be achieved by hooking into the poll routine to refresh the state of the USB mux. BUG=b:149883933 TEST=booted into recovery from Type-C flash drive on volteer Change-Id: Ic6c23756f64b891b3c5683cd650c605b8630b0fb Signed-off-by: Caveh Jalali Reviewed-on: https://review.coreboot.org/c/coreboot/+/42072 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- payloads/libpayload/drivers/usb/usb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'payloads/libpayload/drivers/usb') diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index accb228b95..b14abb4b35 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -86,6 +86,10 @@ usb_poll (void) { if (usb_hcs == 0) return; + + if (usb_poll_prepare) + usb_poll_prepare(); + hci_t *controller = usb_hcs; while (controller != NULL) { int i; -- cgit v1.2.3