diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-13 08:14:55 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-19 10:44:53 -0500 |
commit | 132b16325fae0742a02075894af16197e83febe8 (patch) | |
tree | a7e8d434e669c3da8e1380b63832eb36e4492c08 /arch/arm/mach-at91 | |
parent | 40cc52440073903f3b7477a3391c4ca0761445d0 (diff) |
ARM: AT91: update clock source registration
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants. Switch over to using this new interface.
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_time.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam926x_time.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 2500f41d8d2d..1dd69c85dfec 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -101,7 +101,6 @@ static struct clocksource clk32k = { | |||
101 | .rating = 150, | 101 | .rating = 150, |
102 | .read = read_clk32k, | 102 | .read = read_clk32k, |
103 | .mask = CLOCKSOURCE_MASK(20), | 103 | .mask = CLOCKSOURCE_MASK(20), |
104 | .shift = 10, | ||
105 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 104 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
106 | }; | 105 | }; |
107 | 106 | ||
@@ -201,8 +200,7 @@ void __init at91rm9200_timer_init(void) | |||
201 | clockevents_register_device(&clkevt); | 200 | clockevents_register_device(&clkevt); |
202 | 201 | ||
203 | /* register clocksource */ | 202 | /* register clocksource */ |
204 | clk32k.mult = clocksource_hz2mult(AT91_SLOW_CLOCK, clk32k.shift); | 203 | clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK); |
205 | clocksource_register(&clk32k); | ||
206 | } | 204 | } |
207 | 205 | ||
208 | struct sys_timer at91rm9200_timer = { | 206 | struct sys_timer at91rm9200_timer = { |
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 608a63240b64..4ba85499fa97 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c | |||
@@ -51,7 +51,6 @@ static struct clocksource pit_clk = { | |||
51 | .name = "pit", | 51 | .name = "pit", |
52 | .rating = 175, | 52 | .rating = 175, |
53 | .read = read_pit_clk, | 53 | .read = read_pit_clk, |
54 | .shift = 20, | ||
55 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 54 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
56 | }; | 55 | }; |
57 | 56 | ||
@@ -163,10 +162,9 @@ static void __init at91sam926x_pit_init(void) | |||
163 | * Register clocksource. The high order bits of PIV are unused, | 162 | * Register clocksource. The high order bits of PIV are unused, |
164 | * so this isn't a 32-bit counter unless we get clockevent irqs. | 163 | * so this isn't a 32-bit counter unless we get clockevent irqs. |
165 | */ | 164 | */ |
166 | pit_clk.mult = clocksource_hz2mult(pit_rate, pit_clk.shift); | ||
167 | bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */; | 165 | bits = 12 /* PICNT */ + ilog2(pit_cycle) /* PIV */; |
168 | pit_clk.mask = CLOCKSOURCE_MASK(bits); | 166 | pit_clk.mask = CLOCKSOURCE_MASK(bits); |
169 | clocksource_register(&pit_clk); | 167 | clocksource_register_hz(&pit_clk, pit_rate); |
170 | 168 | ||
171 | /* Set up irq handler */ | 169 | /* Set up irq handler */ |
172 | setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); | 170 | setup_irq(AT91_ID_SYS, &at91sam926x_pit_irq); |