Merge branch develop-3.10 into develop-3.10-next
[firefly-linux-kernel-4.4.55.git] / drivers / usb / dwc_otg_310 / dwc_otg_hcd.c
index 30a8bf1fa32cb9af86d694ae181c2ada69fc6718..1ad27556227caf31b4669e36be9979609617518c 100755 (executable)
@@ -281,13 +281,14 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p)
        dwc_otg_hcd->non_periodic_qh_ptr = &dwc_otg_hcd->non_periodic_sched_active;
        dwc_otg_hcd->non_periodic_channels = 0;
        dwc_otg_hcd->periodic_channels = 0;
+       dwc_otg_hcd->frame_number =0;
 
        hprt0.d32 = DWC_READ_REG32(dwc_otg_hcd->core_if->host_if->hprt0);
        /* In some case, we don't disconnect a usb device, but
         * disconnect intr was triggered, so check hprt0 here. */
        if ((!hprt0.b.prtenchng)
-           && (hprt0.d32 != 0x1000)
-           && (hprt0.d32 != 0x1100)) {
+           && (!hprt0.b.prtconndet)
+           && hprt0.b.prtconnsts) {
                DWC_PRINTF("%s: hprt0 = 0x%08x\n", __func__, hprt0.d32);
                return 1;
        }
@@ -443,11 +444,10 @@ static int dwc_otg_hcd_sleep_cb(void *p)
  *
  * @param p void pointer to the <code>struct usb_hcd</code>
  */
-extern inline struct usb_hcd *dwc_otg_hcd_to_hcd(dwc_otg_hcd_t *dwc_otg_hcd);
 static int dwc_otg_hcd_rem_wakeup_cb(void *p)
 {
        dwc_otg_hcd_t *dwc_otg_hcd = p;
-       struct usb_hcd *hcd = dwc_otg_hcd_to_hcd(dwc_otg_hcd);
+       struct usb_hcd *hcd = dwc_otg_hcd_get_priv_data(dwc_otg_hcd);
 
        if (dwc_otg_hcd->core_if->lx_state == DWC_OTG_L2) {
                dwc_otg_hcd->flags.b.port_suspend_change = 1;
@@ -513,12 +513,10 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t *hcd,
                DWC_ERROR("DWC OTG HCD URB Enqueue failed creating QTD\n");
                return -DWC_E_NO_MEMORY;
        }
-
+       DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
        retval =
-           dwc_otg_hcd_qtd_add(qtd, hcd, (dwc_otg_qh_t **) ep_handle,
-                               atomic_alloc);
+           dwc_otg_hcd_qtd_add(qtd, hcd, (dwc_otg_qh_t **) ep_handle, 1);
 
-       DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
        if (retval < 0) {
                DWC_ERROR("DWC OTG HCD URB Enqueue failed adding QTD. "
                          "Error status %d\n", retval);
@@ -1073,6 +1071,7 @@ static int assign_and_init_hc(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh)
         * Set the split attributes
         */
        hc->do_split = 0;
+       hc->csplit_nak = 0;
        if (qh->do_split) {
                uint32_t hub_addr, port_addr;
                hc->do_split = 1;