diff options
Diffstat (limited to 'drivers/usb/dwc2/platform.c')
-rw-r--r-- | drivers/usb/dwc2/platform.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 185663e0b5f4..90935304185a 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -47,6 +47,7 @@ | |||
47 | 47 | ||
48 | #include "core.h" | 48 | #include "core.h" |
49 | #include "hcd.h" | 49 | #include "hcd.h" |
50 | #include "debug.h" | ||
50 | 51 | ||
51 | static const char dwc2_driver_name[] = "dwc2"; | 52 | static const char dwc2_driver_name[] = "dwc2"; |
52 | 53 | ||
@@ -76,6 +77,8 @@ static const struct dwc2_core_params params_bcm2835 = { | |||
76 | .reload_ctl = 0, | 77 | .reload_ctl = 0, |
77 | .ahbcfg = 0x10, | 78 | .ahbcfg = 0x10, |
78 | .uframe_sched = 0, | 79 | .uframe_sched = 0, |
80 | .external_id_pin_ctl = -1, | ||
81 | .hibernation = -1, | ||
79 | }; | 82 | }; |
80 | 83 | ||
81 | static const struct dwc2_core_params params_rk3066 = { | 84 | static const struct dwc2_core_params params_rk3066 = { |
@@ -104,6 +107,8 @@ static const struct dwc2_core_params params_rk3066 = { | |||
104 | .reload_ctl = -1, | 107 | .reload_ctl = -1, |
105 | .ahbcfg = 0x7, /* INCR16 */ | 108 | .ahbcfg = 0x7, /* INCR16 */ |
106 | .uframe_sched = -1, | 109 | .uframe_sched = -1, |
110 | .external_id_pin_ctl = -1, | ||
111 | .hibernation = -1, | ||
107 | }; | 112 | }; |
108 | 113 | ||
109 | /** | 114 | /** |
@@ -121,6 +126,7 @@ static int dwc2_driver_remove(struct platform_device *dev) | |||
121 | { | 126 | { |
122 | struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); | 127 | struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); |
123 | 128 | ||
129 | dwc2_debugfs_exit(hsotg); | ||
124 | if (hsotg->hcd_enabled) | 130 | if (hsotg->hcd_enabled) |
125 | dwc2_hcd_remove(hsotg); | 131 | dwc2_hcd_remove(hsotg); |
126 | if (hsotg->gadget_enabled) | 132 | if (hsotg->gadget_enabled) |
@@ -237,6 +243,21 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
237 | spin_lock_init(&hsotg->lock); | 243 | spin_lock_init(&hsotg->lock); |
238 | mutex_init(&hsotg->init_mutex); | 244 | mutex_init(&hsotg->init_mutex); |
239 | 245 | ||
246 | /* Detect config values from hardware */ | ||
247 | retval = dwc2_get_hwparams(hsotg); | ||
248 | if (retval) | ||
249 | return retval; | ||
250 | |||
251 | hsotg->core_params = devm_kzalloc(&dev->dev, | ||
252 | sizeof(*hsotg->core_params), GFP_KERNEL); | ||
253 | if (!hsotg->core_params) | ||
254 | return -ENOMEM; | ||
255 | |||
256 | dwc2_set_all_params(hsotg->core_params, -1); | ||
257 | |||
258 | /* Validate parameter values */ | ||
259 | dwc2_set_parameters(hsotg, params); | ||
260 | |||
240 | if (hsotg->dr_mode != USB_DR_MODE_HOST) { | 261 | if (hsotg->dr_mode != USB_DR_MODE_HOST) { |
241 | retval = dwc2_gadget_init(hsotg, irq); | 262 | retval = dwc2_gadget_init(hsotg, irq); |
242 | if (retval) | 263 | if (retval) |
@@ -245,7 +266,7 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
245 | } | 266 | } |
246 | 267 | ||
247 | if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) { | 268 | if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) { |
248 | retval = dwc2_hcd_init(hsotg, irq, params); | 269 | retval = dwc2_hcd_init(hsotg, irq); |
249 | if (retval) { | 270 | if (retval) { |
250 | if (hsotg->gadget_enabled) | 271 | if (hsotg->gadget_enabled) |
251 | s3c_hsotg_remove(hsotg); | 272 | s3c_hsotg_remove(hsotg); |
@@ -256,6 +277,8 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
256 | 277 | ||
257 | platform_set_drvdata(dev, hsotg); | 278 | platform_set_drvdata(dev, hsotg); |
258 | 279 | ||
280 | dwc2_debugfs_init(hsotg); | ||
281 | |||
259 | return retval; | 282 | return retval; |
260 | } | 283 | } |
261 | 284 | ||