public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-omap@vger.kernel.org
Subject: Re: [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access
Date: Wed, 9 Apr 2008 21:54:33 +0000	[thread overview]
Message-ID: <20080409215433.GQ31071@atomide.com> (raw)
In-Reply-To: <20080409212203.GA31636@flint.arm.linux.org.uk>

* Russell King - ARM Linux <linux@arm.linux.org.uk> [080409 21:22]:
> On Wed, Apr 09, 2008 at 08:57:13PM +0000, Tony Lindgren wrote:
> > Here's how it now looks:
> 
> Not quite.  The point I was trying to make is:
> 
> > @@ -302,15 +288,17 @@
> >  	int eth_cs;
> >  	unsigned long cs_mem_base;
> >  	unsigned int muxed, rate;
> > -	struct clk *l3ck;
> > +	struct clk *gpmc_fck;
> >  
> >  	eth_cs	= H4_SMC91X_CS;
> >  
> > -	l3ck = clk_get(NULL, "core_l3_ck");
> > -	if (IS_ERR(l3ck))
> > -		rate = 100000000;
> > -	else
> > -		rate = clk_get_rate(l3ck);
> > +	gpmc_fck = clk_get(NULL, "gpmc_fck");	/* Always on ENABLE_ON_INIT */
> > +	if (IS_ERR(gpmc_fck)) {
> > +		WARN_ON(1);
> > +		return;
> > +	}
> > +
> 
> that there should be a call to clk_enable() here - if even if it's
> apparantly "always on".  (If it's always enabled then the call won't
> do any harm anyway - it just serves to ensure that the API conditions
> are followed.)

OK, I'll clk_enable() before clk_get_rate() and then clk_disable() to
make usecounts happy as rate is only needed for setting GPMC timings:

@@ -302,15 +288,19 @@
 	int eth_cs;
 	unsigned long cs_mem_base;
 	unsigned int muxed, rate;
-	struct clk *l3ck;
+	struct clk *gpmc_fck;
 
 	eth_cs	= H4_SMC91X_CS;
 
-	l3ck = clk_get(NULL, "core_l3_ck");
-	if (IS_ERR(l3ck))
-		rate = 100000000;
-	else
-		rate = clk_get_rate(l3ck);
+	gpmc_fck = clk_get(NULL, "gpmc_fck");	/* Always on ENABLE_ON_INIT */
+	if (IS_ERR(gpmc_fck)) {
+		WARN_ON(1);
+		return;
+	}
+
+	clk_enable(gpmc_fck);
+	rate = clk_get_rate(gpmc_fck);
+	clk_disable(gpmc_fck);
 
 	if (is_gpmc_muxed())
 		muxed = 0x200;

Regards,

Tony

  reply	other threads:[~2008-04-09 21:54 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 14:01 [PATCH 0/17] omap2 patches for post 2.6.25, take #2 Tony Lindgren
2008-03-18 14:01 ` [PATCH 1/17] ARM: OMAP2: Add new pin multiplexing configurations Tony Lindgren
2008-03-18 14:02   ` [PATCH 2/17] ARM: OMAP2: Clean-up mux code Tony Lindgren
2008-03-18 14:02     ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-03-18 14:02       ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-03-18 14:02         ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Tony Lindgren
2008-03-18 14:02           ` [PATCH 6/17] ARM: OMAP2: Remove old 24xx PM code Tony Lindgren
2008-03-18 14:02             ` [PATCH 7/17] ARM: OMAP2: Move clock.h to clock24xx.h Tony Lindgren
2008-03-18 14:02               ` [PATCH 8/17] ARM: OMAP2: Move clock.c to clock24xx.c Tony Lindgren
2008-03-18 14:02                 ` [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx Tony Lindgren
2008-03-18 14:02                   ` [PATCH 10/17] ARM: OMAP2: Change 24xx to use shared clock code and new reg access Tony Lindgren
2008-03-18 14:02                     ` [PATCH 11/17] ARM: OMAP: Add rest of 24xx clocks Tony Lindgren
2008-03-18 14:02                       ` [PATCH 12/17] ARM: OMAP2: Remove old 24xx specific clock functions Tony Lindgren
2008-03-18 14:02                         ` [PATCH 13/17] ARM: OMAP2: Clean up 24xx clock code Tony Lindgren
2008-03-18 14:02                           ` [PATCH 14/17] ARM: OMAP2: Remove old PRCM register access code Tony Lindgren
2008-03-18 14:02                             ` [PATCH 15/17] ARM: OMAP2: Add 34xx clocks Tony Lindgren
2008-03-18 14:02                               ` [PATCH 16/17] ARM: OMAP2: Add 34xx clock code Tony Lindgren
2008-03-18 14:02                                 ` [PATCH 17/17] ARM: OMAP2: New DPLL clock framework Tony Lindgren
2008-03-28 12:39                                   ` Tony Lindgren
2008-03-28 12:39                                 ` [PATCH 16/17] ARM: OMAP2: Add 34xx clock code Tony Lindgren
2008-03-28 12:38                     ` [PATCH 10/17] ARM: OMAP2: Change 24xx to use shared clock code and new reg access Tony Lindgren
2008-03-28 12:38                   ` [PATCH 9/17] ARM: OMAP2: Add common clock framework for 24xx and 34xx Tony Lindgren
2008-03-30 18:49                     ` Eduardo Valentin
2008-03-31  7:56                       ` Tony Lindgren
2008-04-07 16:48           ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Russell King - ARM Linux
2008-04-09 20:57             ` Tony Lindgren
2008-04-09 21:22               ` Russell King - ARM Linux
2008-04-09 21:54                 ` Tony Lindgren [this message]
2008-04-09 23:24                   ` Tony Lindgren
2008-03-28 12:37         ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-03-28 12:36       ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-04-07 16:20       ` Russell King - ARM Linux
2008-04-09 20:50         ` Tony Lindgren
2008-04-14 14:05           ` Russell King - ARM Linux
2008-04-14 17:39             ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-04-09 21:03 [PATCH 0/17] omap2 patches for post 2.6.25, take #3 Tony Lindgren
2008-04-09 21:03 ` [PATCH 1/17] ARM: OMAP2: Add new pin multiplexing configurations Tony Lindgren
2008-04-09 21:03   ` [PATCH 2/17] ARM: OMAP2: Clean-up mux code Tony Lindgren
2008-04-09 21:03     ` [PATCH 3/17] ARM: OMAP2: Add common register access for 24xx and 34xx Tony Lindgren
2008-04-09 21:03       ` [PATCH 4/17] ARM: OMAP2: Add register access for 34xx Tony Lindgren
2008-04-09 21:03         ` [PATCH 5/17] ARM: OMAP2: Change 24xx to use new register access Tony Lindgren
2008-04-09 22:01           ` Tony Lindgren
2008-04-09 23:21             ` Tony Lindgren

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=20080409215433.GQ31071@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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