Skip to content

Commit 9d2aa8c

Browse files
linuswarndb
authored andcommitted
ARM/clocksource: use automatic DT probing for ux500 PRCMU
The ARM core kernel already calls clocksource_of_init() so why go to all the trouble of locating and probing this node in the machine. CLOCKSOURCE_OF_DECLARE() will take care of it in the clocksource driver, and thus we can also get rid of the dangling header file <linux/clksrc-dbx500-prcmu.h> Suggested-by: Arnd Bergmann <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 7530527 commit 9d2aa8c

File tree

7 files changed

+7
-78
lines changed

7 files changed

+7
-78
lines changed

arch/arm/mach-ux500/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Makefile for the linux kernel, U8500 machine.
33
#
44

5-
obj-y := cpu.o id.o timer.o pm.o
5+
obj-y := cpu.o id.o pm.o
66
obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
77
obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o
88
obj-$(CONFIG_MACH_MOP500) += board-mop500-regulators.o \

arch/arm/mach-ux500/cpu-db8500.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ static const char * stericsson_dt_platform_compat[] = {
156156
DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
157157
.map_io = u8500_map_io,
158158
.init_irq = ux500_init_irq,
159-
/* we re-use nomadik timer here */
160-
.init_time = ux500_timer_init,
161159
.init_machine = u8500_init_machine,
162160
.init_late = NULL,
163161
.dt_compat = stericsson_dt_platform_compat,

arch/arm/mach-ux500/cpu.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/platform_device.h>
1010
#include <linux/io.h>
1111
#include <linux/mfd/dbx500-prcmu.h>
12-
#include <linux/clksrc-dbx500-prcmu.h>
1312
#include <linux/sys_soc.h>
1413
#include <linux/err.h>
1514
#include <linux/slab.h>

arch/arm/mach-ux500/setup.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#define __ASM_ARCH_SETUP_H
1313

1414
#include <asm/mach/arch.h>
15-
#include <asm/mach/time.h>
1615
#include <linux/init.h>
1716
#include <linux/mfd/abx500/ab8500.h>
1817

@@ -24,8 +23,6 @@ extern void __init ux500_init_irq(void);
2423

2524
extern struct device *ux500_soc_device_init(const char *soc_id);
2625

27-
extern void ux500_timer_init(void);
28-
2926
extern void ux500_cpu_die(unsigned int cpu);
3027

3128
#endif /* __ASM_ARCH_SETUP_H */

arch/arm/mach-ux500/timer.c

Lines changed: 0 additions & 48 deletions
This file was deleted.

drivers/clocksource/clksrc-dbx500-prcmu.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* power domain. We use the Timer 4 for our always-on clock
1313
* source on DB8500.
1414
*/
15+
#include <linux/of.h>
16+
#include <linux/of_address.h>
1517
#include <linux/clockchips.h>
16-
#include <linux/clksrc-dbx500-prcmu.h>
1718
#include <linux/sched_clock.h>
1819

1920
#define RATE_32K 32768
@@ -63,9 +64,9 @@ static u64 notrace dbx500_prcmu_sched_clock_read(void)
6364

6465
#endif
6566

66-
void __init clksrc_dbx500_prcmu_init(void __iomem *base)
67+
static void __init clksrc_dbx500_prcmu_init(struct device_node *node)
6768
{
68-
clksrc_dbx500_timer_base = base;
69+
clksrc_dbx500_timer_base = of_iomap(node, 0);
6970

7071
/*
7172
* The A9 sub system expects the timer to be configured as
@@ -85,3 +86,5 @@ void __init clksrc_dbx500_prcmu_init(void __iomem *base)
8586
#endif
8687
clocksource_register_hz(&clocksource_dbx500_prcmu, RATE_32K);
8788
}
89+
CLOCKSOURCE_OF_DECLARE(dbx500_prcmu, "stericsson,db8500-prcmu-timer-4",
90+
clksrc_dbx500_prcmu_init);

include/linux/clksrc-dbx500-prcmu.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)