summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/platform.c
diff options
context:
space:
mode:
authorJohn Youn <John.Youn@synopsys.com>2015-12-17 20:16:58 +0100
committerFelipe Balbi <balbi@ti.com>2015-12-22 18:58:34 +0100
commit263b7fb557f797d9d4d1dcf93fb6bb2efc3f1d46 (patch)
tree71d324a632fa9d1af12ce8a3a73c0a20d8ef676c /drivers/usb/dwc2/platform.c
parentusb: dwc2: Move mode querying functions into core.h (diff)
downloadlinux-263b7fb557f797d9d4d1dcf93fb6bb2efc3f1d46.tar.xz
linux-263b7fb557f797d9d4d1dcf93fb6bb2efc3f1d46.zip
usb: dwc2: Move reset into dwc2_get_hwparams()
The reset is required to get reset values of the hardware parameters but the force mode is not. Move the base reset into dwc2_get_hwparams() and do the reset and force mode afterwards. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2/platform.c')
-rw-r--r--drivers/usb/dwc2/platform.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index f4366513acb6..bfa4a6a8a1f3 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -512,13 +512,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
if (retval)
return retval;
- /*
- * Reset before dwc2_get_hwparams() then it could get power-on real
- * reset value form registers.
- */
- dwc2_core_reset_and_force_dr_mode(hsotg);
-
- /* Detect config values from hardware */
+ /* Reset the controller and detect hardware config values */
retval = dwc2_get_hwparams(hsotg);
if (retval)
goto error;
@@ -526,6 +520,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
/* Validate parameter values */
dwc2_set_parameters(hsotg, params);
+ dwc2_core_reset_and_force_dr_mode(hsotg);
+
if (hsotg->dr_mode != USB_DR_MODE_HOST) {
retval = dwc2_gadget_init(hsotg, irq);
if (retval)