From patchwork Wed Mar 20 06:41:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: avinash philip X-Patchwork-Id: 2305461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 83BFA40213 for ; Wed, 20 Mar 2013 06:44:11 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UICiL-0007W2-DA; Wed, 20 Mar 2013 06:41:33 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UICiD-0007Ut-JK for linux-arm-kernel@lists.infradead.org; Wed, 20 Mar 2013 06:41:26 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2K6fGE6017286; Wed, 20 Mar 2013 01:41:17 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2K6fETw018636; Wed, 20 Mar 2013 12:11:14 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 20 Mar 2013 12:11:14 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r2K6fDve019633; Wed, 20 Mar 2013 12:11:13 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id DD926158002; Wed, 20 Mar 2013 12:11:13 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r2K6fDR20003; Wed, 20 Mar 2013 12:11:13 +0530 (IST) From: Philip Avinash To: , Subject: [PATCH v2 1/3] ARM: davinci: clk framework support for enable/disable functionality Date: Wed, 20 Mar 2013 12:11:52 +0530 Message-ID: <1363761714-15034-2-git-send-email-avinashphilip@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363761714-15034-1-git-send-email-avinashphilip@ti.com> References: <1363761714-15034-1-git-send-email-avinashphilip@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130320_024125_770000_E471ED9C X-CRM114-Status: GOOD ( 10.87 ) X-Spam-Score: -9.4 (---------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-9.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -2.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: davinci-linux-open-source@linux.davincidsp.com, Philip Avinash , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, prakash.pm@ti.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DAVINCI clock framework currently not supporting clock enable/disable functionality on clock nodes. In DAVINCI platform EHRPWM module requires support for clock enable/disable for TBCLK support. Hence this patch adds support for enabling/disabling clocks depends on the availability of the functionality. Signed-off-by: Philip Avinash --- Changes since v1: - Add support for clock enable/disable functionality. :100644 100644 d458558... aa89e5e... M arch/arm/mach-davinci/clock.c :100644 100644 8694b39... 1e4e836... M arch/arm/mach-davinci/clock.h arch/arm/mach-davinci/clock.c | 4 ++++ arch/arm/mach-davinci/clock.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index d458558..aa89e5e 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c @@ -35,6 +35,8 @@ static void __clk_enable(struct clk *clk) { if (clk->parent) __clk_enable(clk->parent); + if (clk->clk_enable) + clk->clk_enable(clk); if (clk->usecount++ == 0 && (clk->flags & CLK_PSC)) davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, true, clk->flags); @@ -44,6 +46,8 @@ static void __clk_disable(struct clk *clk) { if (WARN_ON(clk->usecount == 0)) return; + if (clk->clk_disable) + clk->clk_disable(clk); if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC)) davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc, diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index 8694b39..1e4e836 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h @@ -104,6 +104,8 @@ struct clk { int (*set_rate) (struct clk *clk, unsigned long rate); int (*round_rate) (struct clk *clk, unsigned long rate); int (*reset) (struct clk *clk, bool reset); + void (*clk_enable) (struct clk *clk); + void (*clk_disable) (struct clk *clk); }; /* Clock flags: SoC-specific flags start at BIT(16) */