diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-08 09:09:47 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-23 13:04:51 -0400 |
commit | 234b6ceddb4fc2a4bc5b9a7670f070f6e69e0868 (patch) | |
tree | 891f57ca663b5ec0bb61bb3e38c5306e0d13d2bd /arch/arm/mach-tegra | |
parent | 442c8176d2efa468577738e3a99a6e051f6e8e55 (diff) |
clocksource: convert ARM 32-bit up counting clocksources
Convert ixp4xx, lpc32xx, mxc, netx, pxa, sa1100, tcc8k, tegra and u300
to use the generic mmio clocksource recently introduced.
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Acked-by: "Hans J. Koch" <hjk@hansjkoch.de>
Acked-by: Colin Cross <ccross@android.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Olof Johansson <olof@lixom.net>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/timer.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c index 0fcb1eb4214d..90350420c4e9 100644 --- a/arch/arm/mach-tegra/timer.c +++ b/arch/arm/mach-tegra/timer.c | |||
@@ -98,11 +98,6 @@ static void tegra_timer_set_mode(enum clock_event_mode mode, | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static cycle_t tegra_clocksource_read(struct clocksource *cs) | ||
102 | { | ||
103 | return timer_readl(TIMERUS_CNTR_1US); | ||
104 | } | ||
105 | |||
106 | static struct clock_event_device tegra_clockevent = { | 101 | static struct clock_event_device tegra_clockevent = { |
107 | .name = "timer0", | 102 | .name = "timer0", |
108 | .rating = 300, | 103 | .rating = 300, |
@@ -111,14 +106,6 @@ static struct clock_event_device tegra_clockevent = { | |||
111 | .set_mode = tegra_timer_set_mode, | 106 | .set_mode = tegra_timer_set_mode, |
112 | }; | 107 | }; |
113 | 108 | ||
114 | static struct clocksource tegra_clocksource = { | ||
115 | .name = "timer_us", | ||
116 | .rating = 300, | ||
117 | .read = tegra_clocksource_read, | ||
118 | .mask = CLOCKSOURCE_MASK(32), | ||
119 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
120 | }; | ||
121 | |||
122 | static DEFINE_CLOCK_DATA(cd); | 109 | static DEFINE_CLOCK_DATA(cd); |
123 | 110 | ||
124 | /* | 111 | /* |
@@ -234,7 +221,8 @@ static void __init tegra_init_timer(void) | |||
234 | init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32, | 221 | init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32, |
235 | 1000000, SC_MULT, SC_SHIFT); | 222 | 1000000, SC_MULT, SC_SHIFT); |
236 | 223 | ||
237 | if (clocksource_register_hz(&tegra_clocksource, 1000000)) { | 224 | if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US, |
225 | "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) { | ||
238 | printk(KERN_ERR "Failed to register clocksource\n"); | 226 | printk(KERN_ERR "Failed to register clocksource\n"); |
239 | BUG(); | 227 | BUG(); |
240 | } | 228 | } |