All of lore.kernel.org
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] ARM: twd_smp: add clock api support
Date: Sat,  2 Oct 2010 09:34:46 -0500	[thread overview]
Message-ID: <1286030086-25556-4-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1286030086-25556-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <rob.herring@smooth-stone.com>

The private timer freq is currently dynamically detected
using jiffies count to determine the rate. This method adds
a delay to boot-up, so use the clock api instead to get the
clock rate.

Signed-off-by: Rob Herring <rob.herring@smooth-stone.com>
---
 arch/arm/include/asm/smp_twd.h |    1 +
 arch/arm/kernel/smp_twd.c      |   11 +++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
index 634f357..99383d5 100644
--- a/arch/arm/include/asm/smp_twd.h
+++ b/arch/arm/include/asm/smp_twd.h
@@ -25,5 +25,6 @@ extern void __iomem *twd_base;
 void twd_timer_stop(void);
 int twd_timer_ack(void);
 void twd_timer_setup(struct clock_event_device *);
+void twd_timer_init(void __iomem *base);
 
 #endif
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 35882fb..be0983c 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -8,6 +8,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#include <linux/clk.h>
+#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -151,6 +153,15 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
 	clockevents_register_device(clk);
 }
 
+void __init twd_timer_init(void __iomem *base)
+{
+	struct clk *clk = clk_get_sys("smp_twd", NULL);
+	if (!IS_ERR(clk))
+		twd_timer_rate = clk_get_rate(clk);
+
+	twd_base = base;
+}
+
 #ifdef CONFIG_HOTPLUG_CPU
 /*
  * take a local timer down
-- 
1.7.0.4

  parent reply	other threads:[~2010-10-02 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02 14:34 [PATCH v2 0/3] ARM: add clock api to sp804 and smp_twd timers Rob Herring
2010-10-02 14:34 ` [PATCH v2 1/3] ARM: move timer-sp.c from versatile to common Rob Herring
2010-10-02 14:34 ` [PATCH v2 2/3] ARM: timer-sp: support timer clock freq other than 1MHz Rob Herring
2010-12-21 13:44   ` Russell King - ARM Linux
2010-12-21 14:14     ` Rob Herring
2010-10-02 14:34 ` Rob Herring [this message]
2010-12-21 13:45   ` [PATCH v2 3/3] ARM: twd_smp: add clock api support Russell King - ARM Linux
2011-01-12 21:28     ` Rob Herring

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=1286030086-25556-4-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.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 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.