aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-08-26 13:08:58 -0400
committerMike Turquette <mturquette@linaro.org>2013-09-06 16:33:05 -0400
commita1fa6f503aad8da91c4cc8dd0e71d2789d78d3f6 (patch)
treed9d875b4a06a6ddfe5ed1abf6aedf7ab31c8aa98 /drivers/clocksource
parentec06dbe773084f9dfadd38d46d7b783d575c2306 (diff)
clocksource: samsung_pwm_timer: Get clock from device tree
When booting with device tree static clkdev aliases should not be used. This patch modifies the samsung_pwm_timer driver to use DT-based clock lookup when booting with device tree. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/samsung_pwm_timer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 584b5472eea3..32950c3ed374 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -349,10 +349,6 @@ static void __init samsung_clocksource_init(void)
349 349
350static void __init samsung_timer_resources(void) 350static void __init samsung_timer_resources(void)
351{ 351{
352 pwm.timerclk = clk_get(NULL, "timers");
353 if (IS_ERR(pwm.timerclk))
354 panic("failed to get timers clock for timer");
355
356 clk_prepare_enable(pwm.timerclk); 352 clk_prepare_enable(pwm.timerclk);
357 353
358 pwm.tcnt_max = (1UL << pwm.variant.bits) - 1; 354 pwm.tcnt_max = (1UL << pwm.variant.bits) - 1;
@@ -397,6 +393,10 @@ void __init samsung_pwm_clocksource_init(void __iomem *base,
397 memcpy(&pwm.variant, variant, sizeof(pwm.variant)); 393 memcpy(&pwm.variant, variant, sizeof(pwm.variant));
398 memcpy(pwm.irq, irqs, SAMSUNG_PWM_NUM * sizeof(*irqs)); 394 memcpy(pwm.irq, irqs, SAMSUNG_PWM_NUM * sizeof(*irqs));
399 395
396 pwm.timerclk = clk_get(NULL, "timers");
397 if (IS_ERR(pwm.timerclk))
398 panic("failed to get timers clock for timer");
399
400 _samsung_pwm_clocksource_init(); 400 _samsung_pwm_clocksource_init();
401} 401}
402 402
@@ -437,6 +437,10 @@ static void __init samsung_pwm_alloc(struct device_node *np,
437 return; 437 return;
438 } 438 }
439 439
440 pwm.timerclk = of_clk_get_by_name(np, "timers");
441 if (IS_ERR(pwm.timerclk))
442 panic("failed to get timers clock for timer");
443
440 _samsung_pwm_clocksource_init(); 444 _samsung_pwm_clocksource_init();
441} 445}
442 446