Commit 4112905f authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Felipe Balbi

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: default avatarJohn Youn <johnyoun@synopsys.com>
Acked-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 19dadca5
...@@ -3146,8 +3146,6 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget, ...@@ -3146,8 +3146,6 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget,
hsotg->gadget.dev.of_node = hsotg->dev->of_node; hsotg->gadget.dev.of_node = hsotg->dev->of_node;
hsotg->gadget.speed = USB_SPEED_UNKNOWN; hsotg->gadget.speed = USB_SPEED_UNKNOWN;
clk_enable(hsotg->clk);
ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies), ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
hsotg->supplies); hsotg->supplies);
if (ret) { if (ret) {
...@@ -3217,8 +3215,6 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget) ...@@ -3217,8 +3215,6 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget)
regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies); regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
clk_disable(hsotg->clk);
mutex_unlock(&hsotg->init_mutex); mutex_unlock(&hsotg->init_mutex);
return 0; return 0;
...@@ -3259,7 +3255,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on) ...@@ -3259,7 +3255,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on)
mutex_lock(&hsotg->init_mutex); mutex_lock(&hsotg->init_mutex);
spin_lock_irqsave(&hsotg->lock, flags); spin_lock_irqsave(&hsotg->lock, flags);
if (is_on) { if (is_on) {
clk_enable(hsotg->clk);
hsotg->enabled = 1; hsotg->enabled = 1;
dwc2_hsotg_core_init_disconnected(hsotg, false); dwc2_hsotg_core_init_disconnected(hsotg, false);
dwc2_hsotg_core_connect(hsotg); dwc2_hsotg_core_connect(hsotg);
...@@ -3267,7 +3262,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on) ...@@ -3267,7 +3262,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on)
dwc2_hsotg_core_disconnect(hsotg); dwc2_hsotg_core_disconnect(hsotg);
dwc2_hsotg_disconnect(hsotg); dwc2_hsotg_disconnect(hsotg);
hsotg->enabled = 0; hsotg->enabled = 0;
clk_disable(hsotg->clk);
} }
hsotg->gadget.speed = USB_SPEED_UNKNOWN; hsotg->gadget.speed = USB_SPEED_UNKNOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment