diff options
Diffstat (limited to 'drivers/usb/dwc2/platform.c')
-rw-r--r-- | drivers/usb/dwc2/platform.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index fc6f5251de5d..530959a8a6d1 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/platform_device.h> | 45 | #include <linux/platform_device.h> |
46 | #include <linux/phy/phy.h> | 46 | #include <linux/phy/phy.h> |
47 | #include <linux/platform_data/s3c-hsotg.h> | 47 | #include <linux/platform_data/s3c-hsotg.h> |
48 | #include <linux/reset.h> | ||
48 | 49 | ||
49 | #include <linux/usb/of.h> | 50 | #include <linux/usb/of.h> |
50 | 51 | ||
@@ -337,6 +338,24 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg) | |||
337 | { | 338 | { |
338 | int i, ret; | 339 | int i, ret; |
339 | 340 | ||
341 | hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2"); | ||
342 | if (IS_ERR(hsotg->reset)) { | ||
343 | ret = PTR_ERR(hsotg->reset); | ||
344 | switch (ret) { | ||
345 | case -ENOENT: | ||
346 | case -ENOTSUPP: | ||
347 | hsotg->reset = NULL; | ||
348 | break; | ||
349 | default: | ||
350 | dev_err(hsotg->dev, "error getting reset control %d\n", | ||
351 | ret); | ||
352 | return ret; | ||
353 | } | ||
354 | } | ||
355 | |||
356 | if (hsotg->reset) | ||
357 | reset_control_deassert(hsotg->reset); | ||
358 | |||
340 | /* Set default UTMI width */ | 359 | /* Set default UTMI width */ |
341 | hsotg->phyif = GUSBCFG_PHYIF16; | 360 | hsotg->phyif = GUSBCFG_PHYIF16; |
342 | 361 | ||
@@ -434,6 +453,9 @@ static int dwc2_driver_remove(struct platform_device *dev) | |||
434 | if (hsotg->ll_hw_enabled) | 453 | if (hsotg->ll_hw_enabled) |
435 | dwc2_lowlevel_hw_disable(hsotg); | 454 | dwc2_lowlevel_hw_disable(hsotg); |
436 | 455 | ||
456 | if (hsotg->reset) | ||
457 | reset_control_assert(hsotg->reset); | ||
458 | |||
437 | return 0; | 459 | return 0; |
438 | } | 460 | } |
439 | 461 | ||