diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-09-21 06:16:10 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-10-01 13:40:28 -0400 |
commit | 4112905f90510fce7c8ccb1cdc05253a25595734 (patch) | |
tree | 557776056692d112c380fa375bf3ff3f75427fb9 | |
parent | 19dadca58a16741b2eeb1c31021b577ffb4b88ee (diff) |
usb: dwc2: remove non-functional clock gating
During typical gadget operation, dwc2 clock was enabled 3 times: from
dwc2_gadget_init(), dwc2_hsotg_udc_start() and dwc2_hsotg_pullup(), and
then disabled in s3c_hsotg_pullup(), s3c_hsotg_udc_stop() and
dwc2_hsotg_remove(). This really makes no sense, so leave clock control
code only in dwc2_gadget_init/remove functions.
Tested-by: John Youn <johnyoun@synopsys.com>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 7afd04cf64b1..19202c1c79ff 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c | |||
@@ -3146,8 +3146,6 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget, | |||
3146 | hsotg->gadget.dev.of_node = hsotg->dev->of_node; | 3146 | hsotg->gadget.dev.of_node = hsotg->dev->of_node; |
3147 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; | 3147 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; |
3148 | 3148 | ||
3149 | clk_enable(hsotg->clk); | ||
3150 | |||
3151 | ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies), | 3149 | ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies), |
3152 | hsotg->supplies); | 3150 | hsotg->supplies); |
3153 | if (ret) { | 3151 | if (ret) { |
@@ -3217,8 +3215,6 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget) | |||
3217 | 3215 | ||
3218 | regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); | 3216 | regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); |
3219 | 3217 | ||
3220 | clk_disable(hsotg->clk); | ||
3221 | |||
3222 | mutex_unlock(&hsotg->init_mutex); | 3218 | mutex_unlock(&hsotg->init_mutex); |
3223 | 3219 | ||
3224 | return 0; | 3220 | return 0; |
@@ -3259,7 +3255,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on) | |||
3259 | mutex_lock(&hsotg->init_mutex); | 3255 | mutex_lock(&hsotg->init_mutex); |
3260 | spin_lock_irqsave(&hsotg->lock, flags); | 3256 | spin_lock_irqsave(&hsotg->lock, flags); |
3261 | if (is_on) { | 3257 | if (is_on) { |
3262 | clk_enable(hsotg->clk); | ||
3263 | hsotg->enabled = 1; | 3258 | hsotg->enabled = 1; |
3264 | dwc2_hsotg_core_init_disconnected(hsotg, false); | 3259 | dwc2_hsotg_core_init_disconnected(hsotg, false); |
3265 | dwc2_hsotg_core_connect(hsotg); | 3260 | dwc2_hsotg_core_connect(hsotg); |
@@ -3267,7 +3262,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on) | |||
3267 | dwc2_hsotg_core_disconnect(hsotg); | 3262 | dwc2_hsotg_core_disconnect(hsotg); |
3268 | dwc2_hsotg_disconnect(hsotg); | 3263 | dwc2_hsotg_disconnect(hsotg); |
3269 | hsotg->enabled = 0; | 3264 | hsotg->enabled = 0; |
3270 | clk_disable(hsotg->clk); | ||
3271 | } | 3265 | } |
3272 | 3266 | ||
3273 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; | 3267 | hsotg->gadget.speed = USB_SPEED_UNKNOWN; |