All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/8] OMAP1 clock: convert test in disable_unused() to use ENABLE_ON_INIT
Date: Thu, 03 Dec 2009 03:07:07 -0700	[thread overview]
Message-ID: <20091203100706.1203.7214.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091203095830.1203.76290.stgit@localhost.localdomain>

mach-omap1/clock.c:omap1_clk_disable_unused() contains a test that
assumes that the clock structures are available in the file's
namespace.  After a following patch, this will no longer be the case.
So we need to reimplement that test.  It turns out that we already
have a facility in the clock framework to handle this case - the
ENABLE_ON_INIT flag - used on OMAP2/3.  Remove the offending test and
mark the clocks that it was intended to catch as ENABLE_ON_INIT.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/clock.c |   11 -----------
 arch/arm/mach-omap1/clock.h |   17 ++++++++++++++++-
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index e006493..26a887c 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -718,17 +718,6 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
 	if ((regval32 & (1 << clk->enable_bit)) == 0)
 		return;
 
-	/* FIXME: This clock seems to be necessary but no-one
-	 * has asked for its activation. */
-	if (clk == &tc2_ck		/* FIX: pm.c (SRAM), CCP, Camera */
-	    || clk == &ck_dpll1out.clk	/* FIX: SoSSI, SSR */
-	    || clk == &arm_gpio_ck	/* FIX: GPIO code for 1510 */
-		) {
-		printk(KERN_INFO "FIXME: Clock \"%s\" seems unused\n",
-		       clk->name);
-		return;
-	}
-
 	printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
 	clk->ops->disable(clk);
 	printk(" done\n");
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 29ffa97..70195ca 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -157,12 +157,17 @@ static struct clk ck_dpll1 = {
 	.parent		= &ck_ref,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ FIX: SoSSI, SSR ]
+ */
 static struct arm_idlect1_clk ck_dpll1out = {
 	.clk = {
 		.name		= "ck_dpll1out",
 		.ops		= &clkops_generic,
 		.parent		= &ck_dpll1,
-		.flags		= CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
+		.flags		= CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
+				  ENABLE_ON_INIT,
 		.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT2),
 		.enable_bit	= EN_CKOUT_ARM,
 		.recalc		= &followparent_recalc,
@@ -207,10 +212,15 @@ static struct arm_idlect1_clk armper_ck = {
 	.idlect_shift	= 2,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ GPIO code for 1510 ]
+ */
 static struct clk arm_gpio_ck = {
 	.name		= "arm_gpio_ck",
 	.ops		= &clkops_generic,
 	.parent		= &ck_dpll1,
+	.flags		= ENABLE_ON_INIT,
 	.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT2),
 	.enable_bit	= EN_GPIOCK,
 	.recalc		= &followparent_recalc,
@@ -372,10 +382,15 @@ static struct clk tc1_ck = {
 	.recalc		= &followparent_recalc,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ pm.c (SRAM), CCP, Camera ]
+ */
 static struct clk tc2_ck = {
 	.name		= "tc2_ck",
 	.ops		= &clkops_generic,
 	.parent		= &tc_ck.clk,
+	.flags		= ENABLE_ON_INIT,
 	.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT3),
 	.enable_bit	= EN_TC2_CK,
 	.recalc		= &followparent_recalc,



WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/8] OMAP1 clock: convert test in disable_unused() to use ENABLE_ON_INIT
Date: Thu, 03 Dec 2009 03:07:07 -0700	[thread overview]
Message-ID: <20091203100706.1203.7214.stgit@localhost.localdomain> (raw)
In-Reply-To: <20091203095830.1203.76290.stgit@localhost.localdomain>

mach-omap1/clock.c:omap1_clk_disable_unused() contains a test that
assumes that the clock structures are available in the file's
namespace.  After a following patch, this will no longer be the case.
So we need to reimplement that test.  It turns out that we already
have a facility in the clock framework to handle this case - the
ENABLE_ON_INIT flag - used on OMAP2/3.  Remove the offending test and
mark the clocks that it was intended to catch as ENABLE_ON_INIT.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/clock.c |   11 -----------
 arch/arm/mach-omap1/clock.h |   17 ++++++++++++++++-
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index e006493..26a887c 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -718,17 +718,6 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
 	if ((regval32 & (1 << clk->enable_bit)) == 0)
 		return;
 
-	/* FIXME: This clock seems to be necessary but no-one
-	 * has asked for its activation. */
-	if (clk == &tc2_ck		/* FIX: pm.c (SRAM), CCP, Camera */
-	    || clk == &ck_dpll1out.clk	/* FIX: SoSSI, SSR */
-	    || clk == &arm_gpio_ck	/* FIX: GPIO code for 1510 */
-		) {
-		printk(KERN_INFO "FIXME: Clock \"%s\" seems unused\n",
-		       clk->name);
-		return;
-	}
-
 	printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
 	clk->ops->disable(clk);
 	printk(" done\n");
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 29ffa97..70195ca 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -157,12 +157,17 @@ static struct clk ck_dpll1 = {
 	.parent		= &ck_ref,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ FIX: SoSSI, SSR ]
+ */
 static struct arm_idlect1_clk ck_dpll1out = {
 	.clk = {
 		.name		= "ck_dpll1out",
 		.ops		= &clkops_generic,
 		.parent		= &ck_dpll1,
-		.flags		= CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
+		.flags		= CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
+				  ENABLE_ON_INIT,
 		.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT2),
 		.enable_bit	= EN_CKOUT_ARM,
 		.recalc		= &followparent_recalc,
@@ -207,10 +212,15 @@ static struct arm_idlect1_clk armper_ck = {
 	.idlect_shift	= 2,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ GPIO code for 1510 ]
+ */
 static struct clk arm_gpio_ck = {
 	.name		= "arm_gpio_ck",
 	.ops		= &clkops_generic,
 	.parent		= &ck_dpll1,
+	.flags		= ENABLE_ON_INIT,
 	.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT2),
 	.enable_bit	= EN_GPIOCK,
 	.recalc		= &followparent_recalc,
@@ -372,10 +382,15 @@ static struct clk tc1_ck = {
 	.recalc		= &followparent_recalc,
 };
 
+/*
+ * FIXME: This clock seems to be necessary but no-one has asked for its
+ * activation.  [ pm.c (SRAM), CCP, Camera ]
+ */
 static struct clk tc2_ck = {
 	.name		= "tc2_ck",
 	.ops		= &clkops_generic,
 	.parent		= &tc_ck.clk,
+	.flags		= ENABLE_ON_INIT,
 	.enable_reg	= OMAP1_IO_ADDRESS(ARM_IDLECT3),
 	.enable_bit	= EN_TC2_CK,
 	.recalc		= &followparent_recalc,

  parent reply	other threads:[~2009-12-03 10:11 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 10:06 [PATCH 0/8] OMAP clock: convert static definitions in header files to C files Paul Walmsley
2009-12-03 10:06 ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 1/8] OMAP1/2/3 clock: remove paranoid checks in preparation for clock{, 2xxx, 3xxx}_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 2/8] OMAP2 clock: APLL code shouldn't rely on static clocks in its local namespace Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 3/8] OMAP2/3: move SDRC macros to mach-omap2/sdrc.h Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 4/8] OMAP2xxx clock: remove implicit dependency between rate CPU flag and clkdev_omap CPU flag Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` [PATCH 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:07 ` Paul Walmsley [this message]
2009-12-03 10:07   ` [PATCH 7/8] OMAP1 clock: convert test in disable_unused() to use ENABLE_ON_INIT Paul Walmsley
2009-12-03 10:07 ` [PATCH 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 10:07   ` Paul Walmsley
2009-12-03 10:27   ` Russell King
2009-12-03 10:27     ` Russell King
2009-12-03 10:36     ` Paul Walmsley
2009-12-03 10:36       ` Paul Walmsley
2009-12-03 10:43       ` Russell King - ARM Linux
2009-12-03 10:43         ` Russell King - ARM Linux
2009-12-03 10:57         ` Paul Walmsley
2009-12-03 10:57           ` Paul Walmsley
2009-12-03 11:22           ` [PATCH v2 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 11:22             ` Paul Walmsley
2009-12-03 11:23           ` [PATCH v2 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 11:23             ` Paul Walmsley
2009-12-03 11:24           ` [PATCH v2 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 11:24             ` Paul Walmsley
2009-12-03 12:11             ` Russell King - ARM Linux
2009-12-03 12:11               ` Russell King - ARM Linux
2009-12-03 12:33               ` Paul Walmsley
2009-12-03 12:33                 ` Paul Walmsley
2009-12-03 15:03                 ` Russell King - ARM Linux
2009-12-03 15:03                   ` Russell King - ARM Linux
2009-12-03 15:26                   ` Paul Walmsley
2009-12-03 15:26                     ` Paul Walmsley
2009-12-03 16:18                     ` [PATCH v3 5/8] OMAP3 clock: convert clock34xx.h to clock34xx_data.c Paul Walmsley
2009-12-03 16:18                       ` Paul Walmsley
2009-12-03 16:19                     ` [PATCH v3 6/8] OMAP2 clock: convert clock24xx.h to clock2xxx_data.c, opp2xxx* Paul Walmsley
2009-12-03 16:19                       ` Paul Walmsley
2009-12-03 16:20                     ` [PATCH v3 8/8] OMAP1 clock: convert mach-omap1/clock.h to mach-omap1/clock_data.c Paul Walmsley
2009-12-03 16:20                       ` Paul Walmsley
2009-12-03 10:29   ` [PATCH " Russell King
2009-12-03 10:29     ` Russell King
2009-12-03 10:37     ` Paul Walmsley
2009-12-03 10:37       ` Paul Walmsley
2009-12-03 10:41       ` Russell King - ARM Linux
2009-12-03 10:41         ` Russell King - ARM Linux
2009-12-04 10:05 ` [PATCH 0/8] OMAP clock: convert static definitions in header files to C files Nayak, Rajendra
2009-12-04 10:05   ` Nayak, Rajendra
2009-12-04 10:13   ` Russell King - ARM Linux
2009-12-04 10:13     ` Russell King - ARM Linux
2009-12-07 12:58   ` Paul Walmsley
2009-12-07 12:58     ` 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=20091203100706.1203.7214.stgit@localhost.localdomain \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.