Commit a7da5277 authored by David Lechner's avatar David Lechner Committed by Sekhar Nori

ARM: davinci: pass clock as parameter to davinci_timer_init()

This changes davinci_timer_init() so that we pass the clock as a
parameter instead of using clk_get(). This is done in preparation
for converting to the common clock framework.

It removes the requirement that we have to have a clock with con_id
of "timer0", which will be good for DT bindings since clock-names =
"timer0" doesn't really make sense.

Also, drop use of extern in header file since we are touching the
definition.
Reviewed-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent ce397d21
...@@ -1224,5 +1224,5 @@ void __init da830_init(void) ...@@ -1224,5 +1224,5 @@ void __init da830_init(void)
void __init da830_init_time(void) void __init da830_init_time(void)
{ {
davinci_clk_init(da830_clks); davinci_clk_init(da830_clks);
davinci_timer_init(); davinci_timer_init(&timerp64_0_clk);
} }
...@@ -1396,5 +1396,5 @@ void __init da850_init(void) ...@@ -1396,5 +1396,5 @@ void __init da850_init(void)
void __init da850_init_time(void) void __init da850_init_time(void)
{ {
davinci_clk_init(da850_clks); davinci_clk_init(da850_clks);
davinci_timer_init(); davinci_timer_init(&timerp64_0_clk);
} }
...@@ -1047,7 +1047,7 @@ void __init dm355_init(void) ...@@ -1047,7 +1047,7 @@ void __init dm355_init(void)
void __init dm355_init_time(void) void __init dm355_init_time(void)
{ {
davinci_clk_init(dm355_clks); davinci_clk_init(dm355_clks);
davinci_timer_init(); davinci_timer_init(&timer0_clk);
} }
int __init dm355_init_video(struct vpfe_config *vpfe_cfg, int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
......
...@@ -1172,7 +1172,7 @@ void __init dm365_init(void) ...@@ -1172,7 +1172,7 @@ void __init dm365_init(void)
void __init dm365_init_time(void) void __init dm365_init_time(void)
{ {
davinci_clk_init(dm365_clks); davinci_clk_init(dm365_clks);
davinci_timer_init(); davinci_timer_init(&timer0_clk);
} }
static struct resource dm365_vpss_resources[] = { static struct resource dm365_vpss_resources[] = {
......
...@@ -935,7 +935,7 @@ void __init dm644x_init(void) ...@@ -935,7 +935,7 @@ void __init dm644x_init(void)
void __init dm644x_init_time(void) void __init dm644x_init_time(void)
{ {
davinci_clk_init(dm644x_clks); davinci_clk_init(dm644x_clks);
davinci_timer_init(); davinci_timer_init(&timer0_clk);
} }
int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
......
...@@ -957,7 +957,7 @@ void __init dm646x_init_time(unsigned long ref_clk_rate, ...@@ -957,7 +957,7 @@ void __init dm646x_init_time(unsigned long ref_clk_rate,
ref_clk.rate = ref_clk_rate; ref_clk.rate = ref_clk_rate;
aux_clkin.rate = aux_clkin_rate; aux_clkin.rate = aux_clkin_rate;
davinci_clk_init(dm646x_clks); davinci_clk_init(dm646x_clks);
davinci_timer_init(); davinci_timer_init(&timer0_clk);
} }
static int __init dm646x_init_devices(void) static int __init dm646x_init_devices(void)
......
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
#ifndef __ARCH_ARM_MACH_DAVINCI_COMMON_H #ifndef __ARCH_ARM_MACH_DAVINCI_COMMON_H
#define __ARCH_ARM_MACH_DAVINCI_COMMON_H #define __ARCH_ARM_MACH_DAVINCI_COMMON_H
#include <linux/clk.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/reboot.h> #include <linux/reboot.h>
extern void davinci_timer_init(void); void davinci_timer_init(struct clk *clk);
extern void davinci_irq_init(void); extern void davinci_irq_init(void);
extern void __iomem *davinci_intc_base; extern void __iomem *davinci_intc_base;
......
...@@ -334,10 +334,8 @@ static struct clock_event_device clockevent_davinci = { ...@@ -334,10 +334,8 @@ static struct clock_event_device clockevent_davinci = {
.set_state_oneshot = davinci_set_oneshot, .set_state_oneshot = davinci_set_oneshot,
}; };
void __init davinci_timer_init(struct clk *timer_clk)
void __init davinci_timer_init(void)
{ {
struct clk *timer_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
unsigned int clockevent_id; unsigned int clockevent_id;
unsigned int clocksource_id; unsigned int clocksource_id;
...@@ -373,7 +371,6 @@ void __init davinci_timer_init(void) ...@@ -373,7 +371,6 @@ void __init davinci_timer_init(void)
} }
} }
timer_clk = clk_get(NULL, "timer0");
BUG_ON(IS_ERR(timer_clk)); BUG_ON(IS_ERR(timer_clk));
clk_prepare_enable(timer_clk); clk_prepare_enable(timer_clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment