From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Robert Baldyga <r.baldyga@samsung.com>,
John Youn <johnyoun@synopsys.com>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: [PATCH v3 2/4] usb: dwc2: remove non-functional clock gating
Date: Mon, 21 Sep 2015 12:16:10 +0200 [thread overview]
Message-ID: <1442830572-6765-3-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: <1442830572-6765-1-git-send-email-m.szyprowski@samsung.com>
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.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/usb/dwc2/gadget.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 410ea6e..3f656d9 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3068,8 +3068,6 @@ static int dwc2_hsotg_udc_start(struct usb_gadget *gadget,
hsotg->gadget.dev.of_node = hsotg->dev->of_node;
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
- clk_enable(hsotg->clk);
-
ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
hsotg->supplies);
if (ret) {
@@ -3139,8 +3137,6 @@ static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget)
regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
- clk_disable(hsotg->clk);
-
mutex_unlock(&hsotg->init_mutex);
return 0;
@@ -3174,7 +3170,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on)
mutex_lock(&hsotg->init_mutex);
spin_lock_irqsave(&hsotg->lock, flags);
if (is_on) {
- clk_enable(hsotg->clk);
hsotg->enabled = 1;
dwc2_hsotg_core_init_disconnected(hsotg, false);
dwc2_hsotg_core_connect(hsotg);
@@ -3182,7 +3177,6 @@ static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on)
dwc2_hsotg_core_disconnect(hsotg);
dwc2_hsotg_disconnect(hsotg);
hsotg->enabled = 0;
- clk_disable(hsotg->clk);
}
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
--
1.9.2
next prev parent reply other threads:[~2015-09-21 10:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 10:16 [PATCH v3 0/4] Exynos4412-based Trats2 USB gadget (DWC2) fixes Marek Szyprowski
2015-09-21 10:16 ` [PATCH v3 1/4] usb: dwc2: remove double call to dwc2_hsotg_of_probe Marek Szyprowski
2015-09-21 10:16 ` Marek Szyprowski [this message]
2015-09-21 10:16 ` [PATCH v3 3/4] usb: dwc2: fix unbalanced phy control Marek Szyprowski
2015-09-21 10:16 ` [PATCH v3 4/4] usb: dwc2: refactor common low-level hw code to platform.c Marek Szyprowski
2015-10-01 15:50 ` Felipe Balbi
2015-10-01 15:59 ` Felipe Balbi
2015-10-02 7:45 ` [PATCH v4 " Marek Szyprowski
2015-10-05 22:26 ` John Youn
2015-10-05 23:27 ` Felipe Balbi
2015-10-06 8:55 ` [PATCH v5 1/2] usb: dwc2: remove no longer needed init_mutex Marek Szyprowski
2015-10-06 8:55 ` [PATCH v5 2/2] usb: dwc2: refactor common low-level hw code to platform.c Marek Szyprowski
2015-10-07 2:37 ` John Youn
2015-10-14 6:52 ` [PATCH v6 1/2] usb: dwc2: remove no longer needed init_mutex Marek Szyprowski
2015-10-14 6:52 ` [PATCH v6 2/2] usb: dwc2: refactor common low-level hw code to platform.c Marek Szyprowski
2015-10-06 8:55 ` [PATCH v4 4/4] " Marek Szyprowski
2015-10-01 21:04 ` [PATCH v3 " John Youn
2015-10-01 22:03 ` Felipe Balbi
2015-10-01 22:21 ` John Youn
2015-10-01 22:31 ` Felipe Balbi
2015-10-02 7:47 ` Marek Szyprowski
2015-09-28 18:21 ` [PATCH v3 0/4] Exynos4412-based Trats2 USB gadget (DWC2) fixes John Youn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442830572-6765-3-git-send-email-m.szyprowski@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=johnyoun@synopsys.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=r.baldyga@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).