summaryrefslogtreecommitdiff
path: root/drivers/usb/chipidea/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/chipidea/host.c')
-rw-r--r--drivers/usb/chipidea/host.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 237cd123fc68..e073462c487c 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -324,6 +324,20 @@ static void host_stop(struct ci_hdrc *ci)
ci->hcd = NULL;
}
+bool ci_hdrc_host_has_device(struct ci_hdrc *ci)
+{
+ struct usb_device *roothub;
+ int i;
+
+ if ((ci->role == CI_ROLE_HOST) && ci->hcd) {
+ roothub = ci->hcd->self.root_hub;
+ for (i = 0; i < roothub->maxchild; ++i) {
+ if (usb_hub_find_child(roothub, (i + 1)))
+ return true;
+ }
+ }
+ return false;
+}
void ci_hdrc_host_destroy(struct ci_hdrc *ci)
{