From bbc523146cfe732eef2ed81fee73c93b1c8e3b34 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 4 Nov 2011 12:06:06 +0100 Subject: libpayload: Implement usb_exit So far it was empty and never published. It now exists and shuts down all controllers (esp. EHCI which resets the port routers). Change-Id: I81e355e8a05778d6397675417b085a094a6f48ee Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/397 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/drivers/usb/usb.c | 16 ++++++++++++++++ payloads/libpayload/drivers/usb/usbinit.c | 5 ----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'payloads/libpayload/drivers/usb') diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c index 4f423327d5..995b4c2918 100644 --- a/payloads/libpayload/drivers/usb/usb.c +++ b/payloads/libpayload/drivers/usb/usb.c @@ -67,6 +67,22 @@ detach_controller (hci_t *controller) } } +/** + * Shut down all controllers + */ +int +usb_exit (void) +{ + if (usb_hcs == 0) + return 0; + hci_t *controller = usb_hcs; + while (controller != 0) { + controller->shutdown(controller); + controller = controller->next; + } + return 0; +} + /** * Polls all hubs on all USB controllers, to find out about device changes */ diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c index 3964197038..8499b82411 100644 --- a/payloads/libpayload/drivers/usb/usbinit.c +++ b/payloads/libpayload/drivers/usb/usbinit.c @@ -139,8 +139,3 @@ usb_initialize (void) return 0; } -int -usb_exit (void) -{ - return 0; -} -- cgit v1.2.3