ARM: set arch_gettimeoffset directly
remove ARM's struct sys_timer .offset function pointer, and instead directly set the arch_gettimeoffset function pointer when the timer driver is initialized. This requires multiplying all function results by 1000, since the removed arm_gettimeoffset() did this. Also, s/unsigned long/u32/ just to make the function prototypes exactly match that of arch_gettimeoffset. Cc: Russell King <linux@arm.linux.org.uk> Cc: Andrew Victor <linux@maxim.org.za> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ryan Mallon <rmallon@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
@@ -42,9 +42,10 @@
|
||||
#define AT91_TC_CLK1BASE 0x40
|
||||
#define AT91_TC_CLK2BASE 0x80
|
||||
|
||||
static unsigned long at91x40_gettimeoffset(void)
|
||||
static u32 at91x40_gettimeoffset(void)
|
||||
{
|
||||
return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128));
|
||||
return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 /
|
||||
(AT91X40_MASTER_CLOCK / 128)) * 1000;
|
||||
}
|
||||
|
||||
static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
|
||||
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void)
|
||||
{
|
||||
unsigned int v;
|
||||
|
||||
arch_gettimeoffset = at91x40_gettimeoffset;
|
||||
|
||||
at91_tc_write(AT91_TC_BCR, 0);
|
||||
v = at91_tc_read(AT91_TC_BMR);
|
||||
v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE;
|
||||
@@ -82,6 +85,5 @@ void __init at91x40_timer_init(void)
|
||||
|
||||
struct sys_timer at91x40_timer = {
|
||||
.init = at91x40_timer_init,
|
||||
.offset = at91x40_gettimeoffset,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user