Skip to content

Commit 20eb435

Browse files
brglnsekhar
authored andcommitted
ARM: davinci: dm365: switch to using the clocksource driver
We now have a proper clocksource driver for davinci. Switch the dm365 platform to using it. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: David Lechner <[email protected]> Signed-off-by: Sekhar Nori <[email protected]>
1 parent cea931c commit 20eb435

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

arch/arm/mach-davinci/dm365.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
#include <mach/cputype.h>
3636
#include <mach/mux.h>
3737
#include <mach/serial.h>
38-
#include <mach/time.h>
38+
39+
#include <clocksource/timer-davinci.h>
3940

4041
#include "asp.h"
4142
#include "davinci.h"
@@ -660,10 +661,16 @@ static struct davinci_id dm365_ids[] = {
660661
},
661662
};
662663

663-
static struct davinci_timer_info dm365_timer_info = {
664-
.timers = davinci_timer_instance,
665-
.clockevent_id = T0_BOT,
666-
.clocksource_id = T0_TOP,
664+
/*
665+
* Bottom half of timer0 is used for clockevent, top half is used for
666+
* clocksource.
667+
*/
668+
static const struct davinci_timer_cfg dm365_timer_cfg = {
669+
.reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_128),
670+
.irq = {
671+
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
672+
DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
673+
},
667674
};
668675

669676
#define DM365_UART1_BASE (IO_PHYS + 0x106000)
@@ -723,7 +730,6 @@ static const struct davinci_soc_info davinci_soc_info_dm365 = {
723730
.pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
724731
.pinmux_pins = dm365_pins,
725732
.pinmux_pins_num = ARRAY_SIZE(dm365_pins),
726-
.timer_info = &dm365_timer_info,
727733
.emac_pdata = &dm365_emac_pdata,
728734
.sram_dma = 0x00010000,
729735
.sram_len = SZ_32K,
@@ -771,6 +777,7 @@ void __init dm365_init_time(void)
771777
{
772778
void __iomem *pll1, *pll2, *psc;
773779
struct clk *clk;
780+
int rv;
774781

775782
clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM365_REF_FREQ);
776783

@@ -789,7 +796,8 @@ void __init dm365_init_time(void)
789796
return;
790797
}
791798

792-
davinci_timer_init(clk);
799+
rv = davinci_timer_register(clk, &dm365_timer_cfg);
800+
WARN(rv, "Unable to register the timer: %d\n", rv);
793801
}
794802

795803
void __init dm365_register_clocks(void)

0 commit comments

Comments
 (0)