From patchwork Wed Sep 27 10:58:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 9973765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 314E86037F for ; Wed, 27 Sep 2017 10:59:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2084A291A6 for ; Wed, 27 Sep 2017 10:59:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 150A3291AE; Wed, 27 Sep 2017 10:59:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B910291A6 for ; Wed, 27 Sep 2017 10:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hqhvF9dsvyh05ff6uwLL90erriKR84MIKszWCvh9vwU=; b=nGJQ7PqA6D/bT5 u0gr8Mht/5u/y6kCMegEkcMj6ygny+vi5nEeig1ECdG1eW/Sx51bw2NfjMbYGUv+lefi7aX+8p4FA ayIsOEwRLQg4EQB0DP2TGWY6On1xYMu99LaQ1heZFt7ZHZftryl9eyjIvszbrLI1g3VkpQz8zkDaA 8lAUkhSIDU4m0hygV5bRRpiwHkavfNhh0QZyTfC7GQmxFEXvXOdD5FLnOK1K452AtHt+P9GALOCxB 0nNbQLt2FWeEsj2qzC0s5KjLP9ZfPBwSc16RF5fldl0bgTG12xXVtBsXFa40KK5Kyfo6MTjJykIBP njlVN59a301OIcY1RnWQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxA3q-0001Sn-7I; Wed, 27 Sep 2017 10:59:26 +0000 Received: from [218.249.47.111] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxA3f-0001Cj-Ba; Wed, 27 Sep 2017 10:59:17 +0000 X-UUID: 1c51a8b7f3114e0294603ee0f1255339-20170927 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2120112710; Wed, 27 Sep 2017 18:58:39 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 27 Sep 2017 18:58:42 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 27 Sep 2017 18:58:25 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Felipe Balbi , Rob Herring Subject: [PATCH 03/12] usb: mtu3: remove dummy wakeup debounce clocks Date: Wed, 27 Sep 2017 18:58:32 +0800 Message-ID: <6713eb6ffe4160efe9219cba5be81a228d4b30a3.1506509658.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170927_035915_847387_72208E8F X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Mathias Nyman , Ian Campbell , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The wakeup debounce clocks for each ports in fact are not needed, so remove them. Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3.h | 4 --- drivers/usb/mtu3/mtu3_host.c | 57 +++--------------------------------------- 2 files changed, 4 insertions(+), 57 deletions(-) diff --git a/drivers/usb/mtu3/mtu3.h b/drivers/usb/mtu3/mtu3.h index 112723d..6d3278e 100644 --- a/drivers/usb/mtu3/mtu3.h +++ b/drivers/usb/mtu3/mtu3.h @@ -214,8 +214,6 @@ struct otg_switch_mtk { * disable u3port0, bit1==1 to disable u3port1,... etc * @dbgfs_root: only used when supports manual dual-role switch via debugfs * @wakeup_en: it's true when supports remote wakeup in host mode - * @wk_deb_p0: port0's wakeup debounce clock - * @wk_deb_p1: it's optional, and depends on port1 is supported or not */ struct ssusb_mtk { struct device *dev; @@ -238,8 +236,6 @@ struct ssusb_mtk { struct dentry *dbgfs_root; /* usb wakeup for host mode */ bool wakeup_en; - struct clk *wk_deb_p0; - struct clk *wk_deb_p1; struct regmap *pericfg; }; diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c index 4dd9508..edcc591 100644 --- a/drivers/usb/mtu3/mtu3_host.c +++ b/drivers/usb/mtu3/mtu3_host.c @@ -79,20 +79,6 @@ int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb, if (!ssusb->wakeup_en) return 0; - ssusb->wk_deb_p0 = devm_clk_get(dev, "wakeup_deb_p0"); - if (IS_ERR(ssusb->wk_deb_p0)) { - dev_err(dev, "fail to get wakeup_deb_p0\n"); - return PTR_ERR(ssusb->wk_deb_p0); - } - - if (of_property_read_bool(dn, "wakeup_deb_p1")) { - ssusb->wk_deb_p1 = devm_clk_get(dev, "wakeup_deb_p1"); - if (IS_ERR(ssusb->wk_deb_p1)) { - dev_err(dev, "fail to get wakeup_deb_p1\n"); - return PTR_ERR(ssusb->wk_deb_p1); - } - } - ssusb->pericfg = syscon_regmap_lookup_by_phandle(dn, "mediatek,syscon-wakeup"); if (IS_ERR(ssusb->pericfg)) { @@ -103,36 +89,6 @@ int ssusb_wakeup_of_property_parse(struct ssusb_mtk *ssusb, return 0; } -static int ssusb_wakeup_clks_enable(struct ssusb_mtk *ssusb) -{ - int ret; - - ret = clk_prepare_enable(ssusb->wk_deb_p0); - if (ret) { - dev_err(ssusb->dev, "failed to enable wk_deb_p0\n"); - goto usb_p0_err; - } - - ret = clk_prepare_enable(ssusb->wk_deb_p1); - if (ret) { - dev_err(ssusb->dev, "failed to enable wk_deb_p1\n"); - goto usb_p1_err; - } - - return 0; - -usb_p1_err: - clk_disable_unprepare(ssusb->wk_deb_p0); -usb_p0_err: - return -EINVAL; -} - -static void ssusb_wakeup_clks_disable(struct ssusb_mtk *ssusb) -{ - clk_disable_unprepare(ssusb->wk_deb_p1); - clk_disable_unprepare(ssusb->wk_deb_p0); -} - static void host_ports_num_get(struct ssusb_mtk *ssusb) { u32 xhci_cap; @@ -286,19 +242,14 @@ void ssusb_host_exit(struct ssusb_mtk *ssusb) int ssusb_wakeup_enable(struct ssusb_mtk *ssusb) { - int ret = 0; - - if (ssusb->wakeup_en) { - ret = ssusb_wakeup_clks_enable(ssusb); + if (ssusb->wakeup_en) ssusb_wakeup_ip_sleep_en(ssusb); - } - return ret; + + return 0; } void ssusb_wakeup_disable(struct ssusb_mtk *ssusb) { - if (ssusb->wakeup_en) { + if (ssusb->wakeup_en) ssusb_wakeup_ip_sleep_dis(ssusb); - ssusb_wakeup_clks_disable(ssusb); - } }