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 825c14d283732840544cb7c6195a5feb0c20adbc..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;
@@ -1071,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;