public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch]
@ 2007-05-03 18:08 Paul Walmsley
  2007-05-04 16:19 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Walmsley @ 2007-05-03 18:08 UTC (permalink / raw)
  To: linux-omap-open-source


The current OMAP2 clock management code uses a magic number, 0xff, to 
indicate that the clock's parent will handle enabling and disabling the 
clock.  Move the magic number into a symbolic constant for readability.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
  arch/arm/mach-omap2/clock.c |    6 +++---
  arch/arm/mach-omap2/clock.h |   10 ++++++----
  2 files changed, 9 insertions(+), 7 deletions(-)

Index: linux-omap-2.6/arch/arm/mach-omap2/clock.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/clock.c
+++ linux-omap-2.6/arch/arm/mach-omap2/clock.c
@@ -97,7 +97,7 @@ static void omap2_clk_fixed_enable(struc
  {
  	u32 cval, i=0;

-	if (clk->enable_bit == 0xff)			/* Parent will do it */
+	if (clk->enable_bit == PARENT_CONTROLS_CLOCK)	/* Parent will do it */
  		return;

  	cval = CM_CLKEN_PLL;
@@ -205,8 +205,8 @@ static void omap2_clk_fixed_disable(stru
  {
  	u32 cval;

-	if(clk->enable_bit == 0xff)		/* let parent off do it */
-		return;
+	if (clk->enable_bit == PARENT_CONTROLS_CLOCK)
+		return;		/* let parent off do it */

  	cval = CM_CLKEN_PLL;
  	cval &= ~(0x3 << clk->enable_bit);
Index: linux-omap-2.6/arch/arm/mach-omap2/clock.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/clock.h
+++ linux-omap-2.6/arch/arm/mach-omap2/clock.h
@@ -29,6 +29,8 @@ static void omap2_sys_clk_recalc(struct
  static u32 omap2_clksel_to_divisor(u32 div_sel, u32 field_val);
  static u32 omap2_clksel_get_divisor(struct clk *clk);

+/* REVISIT: should use a clock flag for this, not a magic number */
+#define PARENT_CONTROLS_CLOCK	0xff

  #define RATE_IN_242X	(1 << 0)
  #define RATE_IN_243X	(1 << 1)
@@ -664,7 +666,7 @@ static struct clk func_54m_ck = {
  				RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
  	.src_offset	= 5,
  	.enable_reg	= (void __iomem *)&CM_CLKEN_PLL,
-	.enable_bit	= 0xff,
+	.enable_bit	= PARENT_CONTROLS_CLOCK,
  	.recalc		= &omap2_propagate_rate,
  };

@@ -691,7 +693,7 @@ static struct clk func_96m_ck = {
  	.flags		= CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X |
  				RATE_FIXED | RATE_PROPAGATES,
  	.enable_reg	= (void __iomem *)&CM_CLKEN_PLL,
-	.enable_bit	= 0xff,
+	.enable_bit	= PARENT_CONTROLS_CLOCK,
  	.recalc		= &omap2_propagate_rate,
  };

@@ -703,7 +705,7 @@ static struct clk func_48m_ck = {
  				RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES,
  	.src_offset	= 3,
  	.enable_reg	= (void __iomem *)&CM_CLKEN_PLL,
-	.enable_bit	= 0xff,
+	.enable_bit	= PARENT_CONTROLS_CLOCK,
  	.recalc		= &omap2_propagate_rate,
  };

@@ -715,7 +717,7 @@ static struct clk func_12m_ck = {
  				RATE_FIXED | RATE_PROPAGATES,
  	.recalc		= &omap2_propagate_rate,
  	.enable_reg	= (void __iomem *)&CM_CLKEN_PLL,
-	.enable_bit	= 0xff,
+	.enable_bit	= PARENT_CONTROLS_CLOCK,
  };

  /* Secure timer, only available in secure mode */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch]
  2007-05-03 18:08 omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch] Paul Walmsley
@ 2007-05-04 16:19 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2007-05-04 16:19 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap-open-source

* Paul Walmsley <paul@booyaka.com> [070503 11:08]:
> 
> The current OMAP2 clock management code uses a magic number, 0xff, to 
> indicate that the clock's parent will handle enabling and disabling the 
> clock.  Move the magic number into a symbolic constant for readability.

Thanks, pushing the unwrapped version of this today.

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-04 16:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-03 18:08 omap2: use symbolic constant to mark parent-controlled clocks in clock.[ch] Paul Walmsley
2007-05-04 16:19 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox