Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+6 -2
+6 -2
arch/arm/common/timer-sp.c
··· 271 271 void __iomem *base; 272 272 int irq; 273 273 const char *name = of_get_property(np, "compatible", NULL); 274 + struct clk *clk; 274 275 275 276 base = of_iomap(np, 0); 276 277 if (WARN_ON(!base)) 278 + return; 279 + clk = of_clk_get(np, 0); 280 + if (WARN_ON(IS_ERR(clk))) 277 281 return; 278 282 279 283 /* Ensure timer is disabled */ ··· 287 283 goto err; 288 284 289 285 if (!init_count) 290 - sp804_clocksource_init(base, name); 286 + __sp804_clocksource_and_sched_clock_init(base, name, clk, 0); 291 287 else { 292 288 irq = irq_of_parse_and_map(np, 0); 293 289 if (irq <= 0) 294 290 goto err; 295 291 296 - sp804_clockevents_init(base, irq, name); 292 + __sp804_clockevents_init(base, irq, clk, name); 297 293 } 298 294 299 295 init_count++;