Commit c602520f authored by Stephen Boyd's avatar Stephen Boyd Committed by David Brown

ARM: msm: Migrate msm_timer to CLOCKSOURCE_OF_DECLARE

This allows us to remove the init_time callback in the DT machine
descriptors, shrinking the code.
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarDavid Brown <davidb@codeaurora.org>
parent 34606f38
...@@ -630,6 +630,7 @@ config ARCH_MSM ...@@ -630,6 +630,7 @@ config ARCH_MSM
bool "Qualcomm MSM" bool "Qualcomm MSM"
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select CLKDEV_LOOKUP select CLKDEV_LOOKUP
select CLKSRC_OF if OF
select COMMON_CLK select COMMON_CLK
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
help help
......
...@@ -45,6 +45,5 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") ...@@ -45,6 +45,5 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
.smp = smp_ops(msm_smp_ops), .smp = smp_ops(msm_smp_ops),
.init_machine = msm8x60_dt_init, .init_machine = msm8x60_dt_init,
.init_late = msm8x60_init_late, .init_late = msm8x60_init_late,
.init_time = msm_dt_timer_init,
.dt_compat = msm8x60_fluid_match, .dt_compat = msm8x60_fluid_match,
MACHINE_END MACHINE_END
...@@ -30,7 +30,6 @@ static const char * const msm8960_dt_match[] __initconst = { ...@@ -30,7 +30,6 @@ static const char * const msm8960_dt_match[] __initconst = {
DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)") DT_MACHINE_START(MSM8960_DT, "Qualcomm MSM (Flattened Device Tree)")
.smp = smp_ops(msm_smp_ops), .smp = smp_ops(msm_smp_ops),
.init_time = msm_dt_timer_init,
.init_machine = msm_dt_init, .init_machine = msm_dt_init,
.dt_compat = msm8960_dt_match, .dt_compat = msm8960_dt_match,
MACHINE_END MACHINE_END
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
extern void msm7x01_timer_init(void); extern void msm7x01_timer_init(void);
extern void msm7x30_timer_init(void); extern void msm7x30_timer_init(void);
extern void msm_dt_timer_init(void);
extern void qsd8x50_timer_init(void); extern void qsd8x50_timer_init(void);
extern void msm_map_common_io(void); extern void msm_map_common_io(void);
......
...@@ -219,15 +219,8 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq, ...@@ -219,15 +219,8 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id msm_timer_match[] __initconst = { static void __init msm_dt_timer_init(struct device_node *np)
{ .compatible = "qcom,kpss-timer" },
{ .compatible = "qcom,scss-timer" },
{ },
};
void __init msm_dt_timer_init(void)
{ {
struct device_node *np;
u32 freq; u32 freq;
int irq; int irq;
struct resource res; struct resource res;
...@@ -235,12 +228,6 @@ void __init msm_dt_timer_init(void) ...@@ -235,12 +228,6 @@ void __init msm_dt_timer_init(void)
void __iomem *base; void __iomem *base;
void __iomem *cpu0_base; void __iomem *cpu0_base;
np = of_find_matching_node(NULL, msm_timer_match);
if (!np) {
pr_err("Can't find msm timer DT node\n");
return;
}
base = of_iomap(np, 0); base = of_iomap(np, 0);
if (!base) { if (!base) {
pr_err("Failed to map event base\n"); pr_err("Failed to map event base\n");
...@@ -283,6 +270,8 @@ void __init msm_dt_timer_init(void) ...@@ -283,6 +270,8 @@ void __init msm_dt_timer_init(void)
msm_timer_init(freq, 32, irq, !!percpu_offset); msm_timer_init(freq, 32, irq, !!percpu_offset);
} }
CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
#endif #endif
static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source, static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
......
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