diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2014-01-10 15:54:34 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-02-13 11:20:36 +0100 |
commit | 9cf31380598466a6ce1d95e68a3f89582eaddc13 (patch) | |
tree | 057e434f054166713715222dd7664b2ff90df48a /arch/arm/common | |
parent | b792985226cc581ea6eb2e3d997f543d703c90c9 (diff) | |
download | linux-9cf31380598466a6ce1d95e68a3f89582eaddc13.tar.bz2 |
ARM: SP804: make Integrator/CP timer pick clock from DT
This modifies the SP804 driver so that the clock will be taken
from the device tree node for the timer.
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/timer-sp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index 53c6a26b633d..fd6bff0c5b96 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -271,10 +271,14 @@ static void __init integrator_cp_of_init(struct device_node *np) void __iomem *base; int irq; const char *name = of_get_property(np, "compatible", NULL); + struct clk *clk; base = of_iomap(np, 0); if (WARN_ON(!base)) return; + clk = of_clk_get(np, 0); + if (WARN_ON(IS_ERR(clk))) + return; /* Ensure timer is disabled */ writel(0, base + TIMER_CTRL); @@ -283,13 +287,13 @@ static void __init integrator_cp_of_init(struct device_node *np) goto err; if (!init_count) - sp804_clocksource_init(base, name); + __sp804_clocksource_and_sched_clock_init(base, name, clk, 0); else { irq = irq_of_parse_and_map(np, 0); if (irq <= 0) goto err; - sp804_clockevents_init(base, irq, name); + __sp804_clockevents_init(base, irq, clk, name); } init_count++; |