summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@secunet.com>2011-11-04 12:06:06 +0100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-11-04 22:14:29 +0100
commitbbc523146cfe732eef2ed81fee73c93b1c8e3b34 (patch)
treec5a2830a72d2c3dd134abd7c8c6adbc3a7e68f3f /payloads/libpayload
parent01178bb03b1ae9bf51962ad03f8f73929a48e4b2 (diff)
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 <patrick.georgi@secunet.com> Reviewed-on: http://review.coreboot.org/397 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/drivers/usb/usb.c16
-rw-r--r--payloads/libpayload/drivers/usb/usbinit.c5
-rw-r--r--payloads/libpayload/include/libpayload.h1
3 files changed, 17 insertions, 5 deletions
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
@@ -68,6 +68,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
*/
void
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;
-}
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 80eaaa40b7..0e892c80cd 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -123,6 +123,7 @@ void rtc_read_clock(struct tm *tm);
* @{
*/
int usb_initialize(void);
+int usb_exit (void);
int usbhid_havechar(void);
int usbhid_getchar(void);
/** @} */