Skip to content

Commit 7d6d45f

Browse files
author
Kumar Gala
committed
clocksource: qcom: split building of legacy vs multiplatform support
The majority of the clocksource code for the Qualcomm platform is shared between newer (multiplatform) and older platforms. However there is a bit of code that isn't, so only build it for the appropriate config. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Kumar Gala <galak@codeaurora.org>
1 parent 8fc1b0f commit 7d6d45f

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

‎drivers/clocksource/qcom-timer.c‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ static notrace cycle_t msm_read_timer_count(struct clocksource *cs)
106106
return readl_relaxed(source_base + TIMER_COUNT_VAL);
107107
}
108108

109-
static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs)
110-
{
111-
/*
112-
* Shift timer count down by a constant due to unreliable lower bits
113-
* on some targets.
114-
*/
115-
return msm_read_timer_count(cs) >> MSM_DGT_SHIFT;
116-
}
117-
118109
static struct clocksource msm_clocksource = {
119110
.name = "dg_timer",
120111
.rating = 300,
@@ -228,7 +219,7 @@ static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
228219
sched_clock_register(msm_sched_clock_read, sched_bits, dgt_hz);
229220
}
230221

231-
#ifdef CONFIG_OF
222+
#ifdef CONFIG_ARCH_QCOM
232223
static void __init msm_dt_timer_init(struct device_node *np)
233224
{
234225
u32 freq;
@@ -281,7 +272,7 @@ static void __init msm_dt_timer_init(struct device_node *np)
281272
}
282273
CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
283274
CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
284-
#endif
275+
#else
285276

286277
static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
287278
u32 sts)
@@ -301,6 +292,15 @@ static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
301292
return 0;
302293
}
303294

295+
static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs)
296+
{
297+
/*
298+
* Shift timer count down by a constant due to unreliable lower bits
299+
* on some targets.
300+
*/
301+
return msm_read_timer_count(cs) >> MSM_DGT_SHIFT;
302+
}
303+
304304
void __init msm7x01_timer_init(void)
305305
{
306306
struct clocksource *cs = &msm_clocksource;
@@ -327,3 +327,4 @@ void __init qsd8x50_timer_init(void)
327327
return;
328328
msm_timer_init(19200000 / 4, 32, 7, false);
329329
}
330+
#endif

0 commit comments

Comments
 (0)