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: 53961 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 35B9822B1E for ; Mon, 21 Sep 2015 10:17:14 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf36695607lbb.3 for ; Mon, 21 Sep 2015 03:17:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6tsiE0Se8Mss6Lydp6NWjk5hBZPiOFH0UtMlwLoHcLI=; b=jw/qQbPELpO9nVY373k9cejR95Q6/4xnpBtzj5ZGC0zbmE32SSe7UIogs88SpWmkA0 1f2ndHFNVorQJ8p2EO4N1U2tNdqyDK2VkR6r3ubey9kDv0da3rWlt2DppmOmnBNzjta3 a6BKjC7WH7b1a7JTtf4nBQvNx98XfckHHTHfp+9/cVSRRqXDqxL6L+oIvHMQgkXh5Ru/ ZbFwMjhxWJPrpoSYLIOvofouNZcdqB+0RXP6is9q5chvUqinXQU6Sfj5U0eg63QBwKqo QVcmoGJkVBD69cBlDO7ZWTrkooosNy5Lsq9sTJOObFiQTgaF6ywExwC+IAKcueImr+ns 0K2g== X-Gm-Message-State: ALoCoQkP3XLXH24uipT2z697u5iuH9c3yyv3ENOu+cu1M4Bk5p82kqubtz0n6XJ7uEjyrl9CUaOH X-Received: by 10.152.3.131 with SMTP id c3mr3110050lac.4.1442830633177; Mon, 21 Sep 2015 03:17:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.33 with SMTP id j1ls412635laf.56.gmail; Mon, 21 Sep 2015 03:17:13 -0700 (PDT) X-Received: by 10.112.148.38 with SMTP id tp6mr2511131lbb.110.1442830633008; Mon, 21 Sep 2015 03:17:13 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id nb5si15482999lbb.35.2015.09.21.03.17.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Sep 2015 03:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lamp12 with SMTP id p12so63735177lam.0 for ; Mon, 21 Sep 2015 03:17:12 -0700 (PDT) X-Received: by 10.112.125.134 with SMTP id mq6mr7225872lbb.19.1442830632832; Mon, 21 Sep 2015 03:17:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1633371lbq; Mon, 21 Sep 2015 03:17:11 -0700 (PDT) X-Received: by 10.68.211.67 with SMTP id na3mr24039644pbc.86.1442830631794; Mon, 21 Sep 2015 03:17:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kc9si1318534pbc.224.2015.09.21.03.17.11; Mon, 21 Sep 2015 03:17:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756632AbbIUKQu (ORCPT + 30 others); Mon, 21 Sep 2015 06:16:50 -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-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;