linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rajendra Nayak <rnayak@ti.com>
To: paul@pwsan.com, mturquette@ti.com
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Rajendra Nayak <rnayak@ti.com>
Subject: [PATCH 15/29] ARM: omap: clk: list all clk_hw_omap clks to enable/disable autoidle
Date: Thu, 14 Jun 2012 18:17:04 +0530	[thread overview]
Message-ID: <1339678038-23082-16-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1339678038-23082-1-git-send-email-rnayak@ti.com>

Platforms can call omap2_init_clk_hw_omap_clocks() to register a clock
using clk_hw_omap. omap2_clk_enable_autoidle_all() and
omap2_clk_disable_autoidle_all() can then be used to run through
all the clocks which support autoidle to enable/disable them.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/clock.c |   32 ++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/clock.h |    3 +++
 arch/arm/mach-omap2/io.c    |   27 +++++++++++++++++++++++++++
 3 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 42cdd9f..df7062d 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -50,6 +50,7 @@ u16 cpu_mask;
 static bool clkdm_control = true;
 
 #ifdef CONFIG_COMMON_CLK
+LIST_HEAD(clk_hw_omap_clocks);
 
 /*
  * Used for clocks that have the same value as the parent clock,
@@ -359,6 +360,37 @@ static int __init omap_clk_setup(char *str)
 }
 __setup("mpurate=", omap_clk_setup);
 
+void omap2_init_clk_hw_omap_clocks(struct clk *clk)
+{
+	struct clk_hw_omap *c;
+
+	if (__clk_get_flags(clk) & CLK_IS_BASIC)
+		return;
+
+	c = to_clk_hw_omap(__clk_get_hw(clk));
+	list_add(&c->node, &clk_hw_omap_clocks);
+}
+
+int omap2_clk_enable_autoidle_all(void)
+{
+	struct clk_hw_omap *c;
+
+	list_for_each_entry(c, &clk_hw_omap_clocks, node)
+		if (c->ops && c->ops->allow_idle)
+			c->ops->allow_idle(c);
+	return 0;
+}
+
+int omap2_clk_disable_autoidle_all(void)
+{
+	struct clk_hw_omap *c;
+
+	list_for_each_entry(c, &clk_hw_omap_clocks, node)
+		if (c->ops && c->ops->allow_idle)
+			c->ops->allow_idle(c);
+	return 0;
+}
+
 const struct clk_hw_omap_ops clkhwops_omap3_dpll = {
 	.allow_idle	= omap3_dpll_allow_idle,
 	.deny_idle	= omap3_dpll_deny_idle,
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 4fa1dda..0a38b56 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -175,6 +175,9 @@ void omap2_clk_dflt_find_companion(struct clk_hw_omap *clk, void __iomem **other
 				   u8 *other_bit);
 void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk, void __iomem **idlest_reg,
 				u8 *idlest_bit, u8 *idlest_val);
+void omap2_init_clk_hw_omap_clocks(struct clk *clk);
+int omap2_clk_enable_autoidle_all(void);
+int omap2_clk_disable_autoidle_all(void);
 #else
 int omap2_dflt_clk_enable(struct clk *clk);
 void omap2_dflt_clk_disable(struct clk *clk);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 8d014ba..43365df 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -356,6 +356,9 @@ void __init omap2420_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap2_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 #endif
 
@@ -378,6 +381,9 @@ void __init omap2430_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap2_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 #endif
 
@@ -439,6 +445,9 @@ void __init omap3_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init omap3430_init_late(void)
@@ -446,6 +455,9 @@ void __init omap3430_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init omap35xx_init_late(void)
@@ -453,6 +465,9 @@ void __init omap35xx_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init omap3630_init_late(void)
@@ -460,6 +475,9 @@ void __init omap3630_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init am35xx_init_late(void)
@@ -467,6 +485,9 @@ void __init am35xx_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 
 void __init ti81xx_init_late(void)
@@ -474,6 +495,9 @@ void __init ti81xx_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap3_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 #endif
 
@@ -497,6 +521,9 @@ void __init omap4430_init_late(void)
 	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap4_pm_init();
+#ifdef CONFIG_COMMON_CLK
+	omap2_clk_enable_autoidle_all();
+#endif
 }
 #endif
 
-- 
1.7.1


  parent reply	other threads:[~2012-06-14 12:48 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 12:46 [PATCH 00/29] Move OMAP2+ over to use COMMON clock Rajendra Nayak
2012-06-14 12:46 ` [PATCH 01/29] clk: Add support for rate table based dividers Rajendra Nayak
2012-06-18 20:04   ` Mike Turquette
2012-06-19  5:22     ` Rajendra Nayak
2012-06-14 12:46 ` [PATCH 02/29] clk: Add CLK_IS_BASIC flag to identify basic clocks Rajendra Nayak
2012-07-03 12:34   ` Rajendra Nayak
2012-07-04  6:18     ` Turquette, Mike
2012-07-04  6:39       ` Rajendra Nayak
2012-06-14 12:46 ` [PATCH 03/29] ARM: omap4: cm: add bitfield width values Rajendra Nayak
2012-06-14 12:46 ` [PATCH 04/29] ARM: omap: clk: use clk_prepare_enable and clk_disable_unprepare Rajendra Nayak
2012-06-14 19:11   ` Mike Turquette
2012-06-15  4:56     ` Rajendra Nayak
2012-06-20 11:41       ` Tony Lindgren
2012-06-21  5:36         ` Rajendra Nayak
2012-06-21  5:43           ` Paul Walmsley
2012-06-21  5:49             ` Rajendra Nayak
2012-06-14 12:46 ` [PATCH 05/29] mmc: omap_hsmmc: " Rajendra Nayak
2012-06-14 12:46 ` [PATCH 06/29] hwrng: omap: " Rajendra Nayak
2012-06-14 12:46 ` [PATCH 07/29] mfd: omap-usb: " Rajendra Nayak
2012-07-02 11:18   ` Samuel Ortiz
2012-07-02 11:16     ` Rajendra Nayak
2012-07-02 15:23       ` Samuel Ortiz
2012-06-14 12:46 ` [PATCH 08/29] ARM: omap: hwmod: get rid of all omap_clk_get_by_name usage Rajendra Nayak
2012-06-14 12:46 ` [PATCH 09/29] ARM: omap: clk: Nuke plat/clock.c & reuse struct clk as clk_hw_omap Rajendra Nayak
2012-06-19  1:38   ` Mike Turquette
2012-06-14 12:46 ` [PATCH 10/29] ARM: omap: clk: Remove all direct dereferncing of struct clk Rajendra Nayak
2012-06-14 12:47 ` [PATCH 11/29] ARM: omap: hwmod: Fix up hwmod based clkdm accesses Rajendra Nayak
2012-06-14 12:47 ` [PATCH 12/29] ARM: omap4: clk: Convert to common clk Rajendra Nayak
2012-06-14 12:47 ` [PATCH 13/29] ARM: omap3: " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 14/29] ARM: omap2: " Rajendra Nayak
2012-06-14 12:47 ` Rajendra Nayak [this message]
2012-06-14 12:47 ` [PATCH 16/29] ARM: omap: clk: Define a function to enable clocks at init Rajendra Nayak
2012-06-14 12:47 ` [PATCH 17/29] ARM: omap: clock: Get rid of unwanted clkdm assocations within clks Rajendra Nayak
2012-06-14 12:47 ` [PATCH 18/29] ARM: omap4: clk: Add 44xx data using common struct clk Rajendra Nayak
2012-06-14 12:47 ` [PATCH 19/29] ARM: omap3: clk: Add 3xxx " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 20/29] ARM: omap2: clk: Add 24xx " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 21/29] ARM: omap: clk: Switch to COMMON clk Rajendra Nayak
2012-06-14 12:47 ` [PATCH 22/29] ARM: omap: clk: Use plat/clock.c only for OMAP1 Rajendra Nayak
2012-06-14 12:47 ` [PATCH 23/29] ARM: omap: hwmod: Cleanup !CONFIG_COMMON_CLK parts Rajendra Nayak
2012-06-14 12:47 ` [PATCH 24/29] ARM: omap4: clk: " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 25/29] ARM: omap3: " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 26/29] ARM: omap2: " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 27/29] ARM: omap4: clk: Delete old OMAP clock data Rajendra Nayak
2012-06-14 12:47 ` [PATCH 28/29] ARM: omap3: " Rajendra Nayak
2012-06-14 12:47 ` [PATCH 29/29] ARM: omap2: " Rajendra Nayak
2012-06-18  4:27 ` [PATCH 00/29] Move OMAP2+ over to use COMMON clock Paul Walmsley
2012-06-18 11:03   ` Rajendra Nayak
2012-09-11  6:35 ` Paul Walmsley
2012-09-11  9:46   ` Vaibhav Hiremath
2012-09-11 23:10     ` Paul Walmsley
2012-09-12  3:53       ` Hiremath, Vaibhav
2012-09-11 20:09   ` Paul Walmsley
2012-09-15  5:32   ` Paul Walmsley
2012-09-15  5:49     ` Paul Walmsley
2012-09-16 20:36   ` Paul Walmsley
2012-09-17 21:26     ` Tony Lindgren
2012-09-17 22:12       ` Paul Walmsley

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=1339678038-23082-16-git-send-email-rnayak@ti.com \
    --to=rnayak@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@ti.com \
    --cc=paul@pwsan.com \
    /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).