linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] OMAP: clock: Enable clockdomain only for optional clocks
Date: Thu, 9 Jun 2011 16:24:13 +0530	[thread overview]
Message-ID: <1307616853-28395-9-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1307616853-28395-8-git-send-email-rnayak@ti.com>

Optional clocks have a requirement to have the clockdomain
force enabled (SW_WKUP) before the optional clock itself
is enabled.
Since optional clocks are currently handled directly by
drivers using the clock framework, this needs to be handled
at the clock framework. This sequence is already handled
in the omap_hwmod framework for the essential/main
clocks.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/clock.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2828d29..ff71ff7 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -286,6 +286,7 @@ void omap2_clk_disable(struct clk *clk)
 int omap2_clk_enable(struct clk *clk)
 {
 	int ret;
+	int hwsup = 0;
 
 	pr_debug("clock: %s: incrementing usecount\n", clk->name);
 
@@ -304,6 +305,17 @@ int omap2_clk_enable(struct clk *clk)
 			goto oce_err1;
 		}
 	}
+	/*
+	 * TODO: This is needed here only as long as drivers use
+	 * clock framework to enable optional clocks. For all the
+	 * essential clocks, this sequence is handled in the
+	 * omap_hwmod framework.
+	 */
+	/* Enable the clockdomain, if its an optional clock */
+	if ((clk->flags & CLOCK_OPTCLK) && (clk->clkdm)) {
+		hwsup = clkdm_is_idle(clk->clkdm);
+		clkdm_wakeup(clk->clkdm);
+	}
 
 	if (clk->ops && clk->ops->enable) {
 		trace_clock_enable(clk->name, 1, smp_processor_id());
@@ -315,6 +327,9 @@ int omap2_clk_enable(struct clk *clk)
 		}
 	}
 
+	if ((clk->flags & CLOCK_OPTCLK) && (clk->clkdm) && hwsup)
+		clkdm_allow_idle(clk->clkdm);
+
 	return 0;
 
 oce_err2:
-- 
1.7.0.4

  reply	other threads:[~2011-06-09 10:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 10:54 [PATCH 0/8] Fix module-mode enable sequence on OMAP4 Rajendra Nayak
2011-06-09 10:54 ` [PATCH 1/8] OMAP2+: clockdomain: Add an api to read idle mode Rajendra Nayak
2011-06-09 10:54   ` [PATCH 2/8] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle Rajendra Nayak
2011-06-09 10:54     ` [PATCH 3/8] OMAP2+: PM: Initialise sleep_switch to a non-valid value Rajendra Nayak
2011-06-09 10:54       ` [PATCH 4/8] OMAP2+: PM: idle clkdms only if already in idle Rajendra Nayak
2011-06-09 10:54         ` [PATCH 5/8] OMAP4: PM: TEMP: Prevent l3init from idling/force sleep Rajendra Nayak
2011-06-09 10:54           ` [PATCH 6/8] OMAP2+: hwmod: Follow the recomended PRCM clock enable sequence Rajendra Nayak
2011-06-09 10:54             ` [PATCH 7/8] OMAP: clock: Add flags to identify optional clock nodes Rajendra Nayak
2011-06-09 10:54               ` Rajendra Nayak [this message]
2011-06-23 15:04           ` [PATCH 5/8] OMAP4: PM: TEMP: Prevent l3init from idling/force sleep Paul Walmsley
2011-06-23 15:22             ` Russell King - ARM Linux
2011-07-06  5:30               ` Paul Walmsley
2011-06-10  0:15         ` [PATCH 4/8] OMAP2+: PM: idle clkdms only if already in idle Todd Poynor
2011-06-10 11:22           ` Rajendra Nayak
2011-06-27  6:34             ` Paul Walmsley
2011-06-27 23:36               ` Rajendra Nayak
2011-06-10  0:07   ` [PATCH 1/8] OMAP2+: clockdomain: Add an api to read idle mode Todd Poynor
2011-06-10 11:08     ` Rajendra Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307616853-28395-9-git-send-email-rnayak@ti.com \
    --to=rnayak@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).