From patchwork Wed Dec 7 17:09:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 87148 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp428463obb; Wed, 7 Dec 2016 09:15:07 -0800 (PST) X-Received: by 10.99.208.21 with SMTP id z21mr122850732pgf.79.1481130907235; Wed, 07 Dec 2016 09:15:07 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v69si24800137pgd.316.2016.12.07.09.15.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2016 09:15:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEfn4-0006SZ-BT; Wed, 07 Dec 2016 17:13:58 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEfn0-0006IT-5J for linux-arm-kernel@bombadil.infradead.org; Wed, 07 Dec 2016 17:13:54 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cEfj6-0001Mw-W6 for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2016 17:09:53 +0000 Received: by mail-wm0-x230.google.com with SMTP id a197so177602678wmd.0 for ; Wed, 07 Dec 2016 09:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=EEyPnvuGSqWiRSr3LzXeULzE4uXcpS2xGAvwuw7qvUQ=; b=KNsSzC+meejasjf1tema2dPRPvSGpHWL3NN333QonWu7BSkwEz/25sv0enkToAJnf+ BT+weBj++s3FHRm19OR6t8U+ShI5uU7Y+EOmO4JX99eIC7Hrdda6wplDrqe2kX2X16jY NgbfJlrZFKyWiz0sJtqTXdtKsbePBv4ouL5anrwzrXJDWaLP+C4JjUhiT+K+RkGF02PI n4yaLPH+zXPRTI36qd9t+PZkLwGWVUiQRdSaral4BlHQoqtNivnb7d4f/zil8p/ZewYs 2xzSww1jIj2wCdtd/c1N+8hjmof8te1NSI1fC+N3DIi2A8EMsgI/SckW3p5uwx4BrqD3 oakg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EEyPnvuGSqWiRSr3LzXeULzE4uXcpS2xGAvwuw7qvUQ=; b=UjKfLKyOF0boevliy2erGQNH5WUIM4VcISKUf7N4SE8NA3/L1aB3xcVaBQv7KjF2k5 gWj7l5vyQjDWPhHAyFPzV/obVtcgCbc6mv29/cNNOrQXYr+nbUH1yc4J1BbY+zE9M3N7 ZiG+mH9LRXWErZabG1vVb8Wm2RP/VZ5nUO+5gNHBi2wbHFh18/RLRKBW1DprwY8ToZbB qnVWTydbT1bAXtizKNVul8EQWeFFCpZOkgnQg5NP3UsSf12xKb7VXgAd2Vd5jCf7mWJ1 NQxJJmX9d+c4IkIvIdzI/v+fF/lR5F3RdhxZDDD0NmfgTYo70R7ZFQ1XiX6XbLxURNUc 02NA== X-Gm-Message-State: AKaTC03dsauBFC7156zVwvrig1+ZlXysNAd1SgzZwo9OqaYlFa7FkA/zeBgnlcnZu8u+PSYd X-Received: by 10.28.234.85 with SMTP id i82mr3506647wmh.6.1481130570971; Wed, 07 Dec 2016 09:09:30 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id v3sm32375638wjp.13.2016.12.07.09.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 09:09:30 -0800 (PST) From: Alexandre Bailon To: nsekhar@ti.com Subject: [PATCH v6 1/2] ARM: davinci: Export two clocks function Date: Wed, 7 Dec 2016 18:09:26 +0100 Message-Id: <1481130567-27829-1-git-send-email-abailon@baylibre.com> X-Mailer: git-send-email 2.7.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161207_170953_182312_DC3564A5 X-CRM114-Status: GOOD ( 12.89 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:230 listed in] [list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, ahaslam@baylibre.com, khilman@baylibre.com, Alexandre Bailon , ptitiano@baylibre.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Rename and export __clk_enable() and __clk_disable() in order to use them from usb-da8xx.c. This file implements the usb20 phy clock that must be able to enable or disable usb20 clock. To prevent a recurssive call to clk_enable() that would cause a recursive locking issue, we must use __clk_enable() and __clk_disable(). Rename these methods in davinci_clk_enable() and davinci_clk_disable(), and export them. Signed-off-by: Alexandre Bailon Suggested-by: David Lechner --- arch/arm/mach-davinci/clock.c | 14 ++++++++------ arch/arm/mach-davinci/clock.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) -- 2.7.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index df42c93..0f967c3 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c @@ -31,10 +31,10 @@ static LIST_HEAD(clocks); static DEFINE_MUTEX(clocks_mutex); static DEFINE_SPINLOCK(clockfw_lock); -static void __clk_enable(struct clk *clk) +void davinci_clk_enable(struct clk *clk) { if (clk->parent) - __clk_enable(clk->parent); + davinci_clk_enable(clk->parent); if (clk->usecount++ == 0) { if (clk->flags & CLK_PSC) davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, @@ -43,8 +43,9 @@ static void __clk_enable(struct clk *clk) clk->clk_enable(clk); } } +EXPORT_SYMBOL(davinci_clk_enable); -static void __clk_disable(struct clk *clk) +void davinci_clk_disable(struct clk *clk) { if (WARN_ON(clk->usecount == 0)) return; @@ -56,8 +57,9 @@ static void __clk_disable(struct clk *clk) clk->clk_disable(clk); } if (clk->parent) - __clk_disable(clk->parent); + davinci_clk_disable(clk->parent); } +EXPORT_SYMBOL(davinci_clk_disable); int davinci_clk_reset(struct clk *clk, bool reset) { @@ -103,7 +105,7 @@ int clk_enable(struct clk *clk) return -EINVAL; spin_lock_irqsave(&clockfw_lock, flags); - __clk_enable(clk); + davinci_clk_enable(clk); spin_unlock_irqrestore(&clockfw_lock, flags); return 0; @@ -118,7 +120,7 @@ void clk_disable(struct clk *clk) return; spin_lock_irqsave(&clockfw_lock, flags); - __clk_disable(clk); + davinci_clk_disable(clk); spin_unlock_irqrestore(&clockfw_lock, flags); } EXPORT_SYMBOL(clk_disable); diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index e2a5437..fa2b837 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h @@ -132,6 +132,8 @@ int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate); int davinci_set_refclk_rate(unsigned long rate); int davinci_simple_set_rate(struct clk *clk, unsigned long rate); int davinci_clk_reset(struct clk *clk, bool reset); +void davinci_clk_enable(struct clk *clk); +void davinci_clk_disable(struct clk *clk); extern struct platform_device davinci_wdt_device; extern void davinci_watchdog_reset(struct platform_device *);