Merge tag 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux...
[deliverable/linux.git] / drivers / usb / dwc2 / hcd.c
index c78c8740db1d7855967d441a21ae1ffafe3d26fc..93bd4a10ab528694c8b706c5082562cca3dd5ae6 100644 (file)
@@ -257,6 +257,14 @@ static void dwc2_hcd_cleanup_channels(struct dwc2_hsotg *hsotg)
                 */
                channel->qh = NULL;
        }
+       /* All channels have been freed, mark them available */
+       if (hsotg->core_params->uframe_sched > 0) {
+               hsotg->available_host_channels =
+                       hsotg->core_params->host_channels;
+       } else {
+               hsotg->non_periodic_channels = 0;
+               hsotg->periodic_channels = 0;
+       }
 }
 
 /**
@@ -1521,7 +1529,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
                        dev_dbg(hsotg->dev,
                                "ClearPortFeature USB_PORT_FEAT_SUSPEND\n");
                        writel(0, hsotg->regs + PCGCTL);
-                       usleep_range(20000, 40000);
+                       msleep(USB_RESUME_TIMEOUT);
 
                        hprt0 = dwc2_read_hprt0(hsotg);
                        hprt0 |= HPRT0_RES;
@@ -1608,7 +1616,7 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
                dev_dbg(hsotg->dev, "GetHubDescriptor\n");
                hub_desc = (struct usb_hub_descriptor *)buf;
                hub_desc->bDescLength = 9;
-               hub_desc->bDescriptorType = 0x29;
+               hub_desc->bDescriptorType = USB_DT_HUB;
                hub_desc->bNbrPorts = 1;
                hub_desc->wHubCharacteristics =
                        cpu_to_le16(HUB_CHAR_COMMON_LPSM |
This page took 0.029559 seconds and 5 git commands to generate.