From patchwork Mon Sep 21 10:16:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7229041 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 299819F30C for ; Mon, 21 Sep 2015 10:17:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A9C7207AD for ; Mon, 21 Sep 2015 10:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 277E9206B8 for ; Mon, 21 Sep 2015 10:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550AbbIUKQt (ORCPT ); Mon, 21 Sep 2015 06:16:49 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:24076 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756554AbbIUKQ0 (ORCPT ); Mon, 21 Sep 2015 06:16:26 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NV0005EQV7ASF10@mailout2.w1.samsung.com>; Mon, 21 Sep 2015 11:16:22 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-3b-55ffd8f652d1 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 18.B1.04846.6F8DFF55; Mon, 21 Sep 2015 11:16:22 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NV0008PPV71MDA0@eusync3.samsung.com>; Mon, 21 Sep 2015 11:16:22 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Robert Baldyga , John Youn , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 2/4] usb: dwc2: remove non-functional clock gating Date: Mon, 21 Sep 2015 12:16:10 +0200 Message-id: <1442830572-6765-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1442830572-6765-1-git-send-email-m.szyprowski@samsung.com> References: <1442830572-6765-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnluLIzCtJLcpLzFFi42I5/e/4Vd1vN/6HGnxZqGyxccZ6Vovdpy8x Wrx+YWhxedccNosZ5/cxWSxa1spssfbIXXaLB4d3sjtwePRtWcXosWX/Z0aPz5vkApijuGxS UnMyy1KL9O0SuDJ2NOxlLWjnq5jf28bUwPiVu4uRk0NCwETi6YEd7BC2mMSFe+vZuhi5OIQE ljJKnPw8lxnCaWKSWLP6HRtIFZuAoUTX2y4wW0QgQaJveT9YB7PAU0aJiS/Os4AkhAVcJeZ8 PQBmswioSuz5+gdsBa+Au8TLKdNZIdbJSfx/uYIJxOYU8JD4/fsG2FAhoJr2vs2sExh5FzAy rGIUTS1NLihOSs811CtOzC0uzUvXS87P3cQICaYvOxgXH7M6xCjAwajEw+sg8D9UiDWxrLgy 9xCjBAezkgivziygEG9KYmVValF+fFFpTmrxIUZpDhYlcd65u96HCAmkJ5akZqemFqQWwWSZ ODilGhi158/9Ydkn//Pv77PbpP13M6enb9/1jOX5Kgl/ze6Wah9p16yd3mF7mY+Yl8rZOueW vVpvYBMmeFn485Lst10GWybVddqIeMuVOnBLy0Yzr5zcZ2KlFKv2Yu3ue5vXBbc//mHMsZNZ z68khnlJpN8+0V/P3F4Wtq1Y7TL/z8Ub2qmN13YpciqxFGckGmoxFxUnAgCpZsnMIgIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;