diff options
| -rw-r--r-- | drivers/usb/dwc2/core.c | 8 | ||||
| -rw-r--r-- | drivers/usb/dwc2/platform.c | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 39a0fa8a4c0a..1489d315f287 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c | |||
| @@ -3278,9 +3278,6 @@ static void dwc2_get_dev_hwparams(struct dwc2_hsotg *hsotg) | |||
| 3278 | /** | 3278 | /** |
| 3279 | * During device initialization, read various hardware configuration | 3279 | * During device initialization, read various hardware configuration |
| 3280 | * registers and interpret the contents. | 3280 | * registers and interpret the contents. |
| 3281 | * | ||
| 3282 | * This should be called during driver probe. It will perform a core | ||
| 3283 | * soft reset in order to get the reset values of the parameters. | ||
| 3284 | */ | 3281 | */ |
| 3285 | int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) | 3282 | int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) |
| 3286 | { | 3283 | { |
| @@ -3288,7 +3285,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) | |||
| 3288 | unsigned width; | 3285 | unsigned width; |
| 3289 | u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4; | 3286 | u32 hwcfg1, hwcfg2, hwcfg3, hwcfg4; |
| 3290 | u32 grxfsiz; | 3287 | u32 grxfsiz; |
| 3291 | int retval; | ||
| 3292 | 3288 | ||
| 3293 | /* | 3289 | /* |
| 3294 | * Attempt to ensure this device is really a DWC_otg Controller. | 3290 | * Attempt to ensure this device is really a DWC_otg Controller. |
| @@ -3308,10 +3304,6 @@ int dwc2_get_hwparams(struct dwc2_hsotg *hsotg) | |||
| 3308 | hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf, | 3304 | hw->snpsid >> 12 & 0xf, hw->snpsid >> 8 & 0xf, |
| 3309 | hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid); | 3305 | hw->snpsid >> 4 & 0xf, hw->snpsid & 0xf, hw->snpsid); |
| 3310 | 3306 | ||
| 3311 | retval = dwc2_core_reset(hsotg); | ||
| 3312 | if (retval) | ||
| 3313 | return retval; | ||
| 3314 | |||
| 3315 | hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1); | 3307 | hwcfg1 = dwc2_readl(hsotg->regs + GHWCFG1); |
| 3316 | hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); | 3308 | hwcfg2 = dwc2_readl(hsotg->regs + GHWCFG2); |
| 3317 | hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3); | 3309 | hwcfg3 = dwc2_readl(hsotg->regs + GHWCFG3); |
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 510f787434b3..690b9fd98b55 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
| @@ -530,7 +530,13 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
| 530 | if (retval) | 530 | if (retval) |
| 531 | return retval; | 531 | return retval; |
| 532 | 532 | ||
| 533 | /* Reset the controller and detect hardware config values */ | 533 | /* |
| 534 | * Reset before dwc2_get_hwparams() then it could get power-on real | ||
| 535 | * reset value form registers. | ||
| 536 | */ | ||
| 537 | dwc2_core_reset_and_force_dr_mode(hsotg); | ||
| 538 | |||
| 539 | /* Detect config values from hardware */ | ||
| 534 | retval = dwc2_get_hwparams(hsotg); | 540 | retval = dwc2_get_hwparams(hsotg); |
| 535 | if (retval) | 541 | if (retval) |
| 536 | goto error; | 542 | goto error; |
