WIP usb fixups
authorJohn Stultz <john.stultz@linaro.org>
Fri, 18 May 2018 17:08:56 +0000 (10:08 -0700)
committerDouglas RAILLARD <douglas.raillard@arm.com>
Tue, 14 Aug 2018 15:32:10 +0000 (16:32 +0100)
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-otg.c
drivers/usb/dwc3/dwc3-otg.h

index 12154c7f5548a85fa7232b73ca63d3a42ca6e6a1..496c6c92dc3291edfd65f313b111aef1d7e08934 100644 (file)
@@ -93,9 +93,6 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc)
        return 0;
 }
 
-static void dwc3_event_buffers_cleanup(struct dwc3 *dwc);
-static int dwc3_event_buffers_setup(struct dwc3 *dwc);
-
 void dwc3_set_prtcap(struct dwc3 *dwc, u32 mode)
 {
        u32 reg;
@@ -1080,7 +1077,7 @@ static int dwc3_core_init_mode(struct dwc3 *dwc)
                #else
                dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_OTG);
 
-               ret = dwc3_otg_init(dwc);
+               ret = dwc3_hisi_otg_init(dwc);
                if (ret) {
                        dev_err(dev, "failed to initialize otg\n");
                        return ret;
@@ -1540,6 +1537,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
                phy_pm_runtime_put_sync(dwc->usb2_generic_phy);
                phy_pm_runtime_put_sync(dwc->usb3_generic_phy);
                break;
+#if 0
        case DWC3_GCTL_PRTCAP_OTG:
                /* do nothing during runtime_suspend */
                if (PMSG_IS_AUTO(msg))
@@ -1554,6 +1552,7 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
                dwc3_otg_exit(dwc);
                dwc3_core_exit(dwc);
                break;
+#endif
        default:
                /* do nothing */
                break;
@@ -1606,7 +1605,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
                phy_pm_runtime_get_sync(dwc->usb2_generic_phy);
                phy_pm_runtime_get_sync(dwc->usb3_generic_phy);
                break;
-       case DWC3_GCTL_PRTCAP_OTG:
+#if 0
                /* nothing to do on runtime_resume */
                if (PMSG_IS_AUTO(msg))
                        break;
@@ -1627,6 +1626,7 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg)
                }
 
                break;
+#endif
        default:
                /* do nothing */
                break;
index 34a082ea96e38887310a584b87aeb066b8acb0d9..483da6f6f96165edb2fe9915d9eeaf6c1af128d0 100644 (file)
@@ -296,7 +296,7 @@ static void dwc3_otg_work_fun(struct work_struct *w)
        mutex_unlock(&dwc_otg->lock);
 }
 
-int dwc3_otg_init(struct dwc3 *dwc)
+int dwc3_hisi_otg_init(struct dwc3 *dwc)
 {
        struct dwc3_otg *dwc_otg;
        u32 reg;
@@ -352,7 +352,7 @@ int dwc3_otg_init(struct dwc3 *dwc)
        return 0;
 }
 
-void dwc3_otg_exit(struct dwc3 *dwc)
+void dwc3_hisi_otg_exit(struct dwc3 *dwc)
 {
        DBG("+\n");
        dwc_otg_handler = NULL;
index b9114b16f050f8e3236dc46573cde15575c114f8..88b0deeabec2901ea8dab67af58134a52092c6a0 100644 (file)
@@ -36,7 +36,7 @@
 #define DWC3_OCFG_OTGHIBDISMASK                BIT(4)
 #define DWC3_OCFG_OTGSFTRSTMSK         BIT(3)
 #define DWC3_OCFG_HNPCAP               BIT(1)
-#define DWC3_OCFG_SRPCAP               1
+#define DWC3_OCFG_SRPCAP_OLD           1
 
 /*  OTG Control Register */
 #define        DWC3_OCTL_OTG3_GOERR            BIT(7)
@@ -92,20 +92,20 @@ struct dwc3_otg {
 
 #ifdef CONFIG_USB_DWC3_OTG
 extern struct dwc3_otg *dwc_otg_handler;
-int dwc3_otg_init(struct dwc3 *dwc);
-void dwc3_otg_exit(struct dwc3 *dwc);
+int dwc3_hisi_otg_init(struct dwc3 *dwc);
+void dwc3_hisi_otg_exit(struct dwc3 *dwc);
 int dwc3_otg_work(struct dwc3_otg *dwc_otg, int evt);
 int dwc3_otg_resume(struct dwc3 *dwc);
 int dwc3_otg_suspend(struct dwc3 *dwc);
 int dwc3_otg_id_value(struct dwc3_otg *dwc_otg);
 #else
 #define dwc_otg_handler ((struct dwc3_otg *)NULL)
-static inline int dwc3_otg_init(struct dwc3 *dwc)
+static inline int dwc3_hisi_otg_init(struct dwc3 *dwc)
 {
        return 0;
 }
 
-static inline void dwc3_otg_exit(struct dwc3 *dwc)
+static inline void dwc3_hisi_otg_exit(struct dwc3 *dwc)
 {
 }