Discussion:
[uClinux-dev] [PATCH] m68knommu: enable clock when using PIT hardware module
gerg
2014-05-29 00:58:25 UTC
Permalink
From: Greg Ungerer <gerg at uclinux.org>

Acquire the SoC clock when using the PIT timer hardware module. It seems
to be powered up and enabled by default on most ColdFire SoC, but this
just makes sure that is true.

Signed-off-by: Greg Ungerer <gerg at uclinux.org>
---
arch/m68k/platform/coldfire/pit.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/m68k/platform/coldfire/pit.c b/arch/m68k/platform/coldfire/pit.c
index 493b311..4b122e3 100644
--- a/arch/m68k/platform/coldfire/pit.c
+++ b/arch/m68k/platform/coldfire/pit.c
@@ -17,6 +17,7 @@
#include <linux/param.h>
#include <linux/init.h>
#include <linux/interrupt.h>
+#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/clockchips.h>
#include <asm/machdep.h>
@@ -151,6 +152,12 @@ static struct clocksource pit_clk = {

void hw_timer_init(irq_handler_t handler)
{
+ struct clk *clk;
+
+ clk = clk_get(NULL, "mcfpit.0");
+ if (clk)
+ clk_enable(clk);
+
cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id());
cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
cf_pit_clockevent.max_delta_ns =
--
1.8.1.4
Loading...