aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/m68k/coldfire/pit.c66
1 files changed, 30 insertions, 36 deletions
diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c
index 493b3111d4c1..d86a9ffb3f13 100644
--- a/arch/m68k/coldfire/pit.c
+++ b/arch/m68k/coldfire/pit.c
@@ -42,37 +42,28 @@ static u32 pit_cnt;
42 * This is also called after resume to bring the PIT into operation again. 42 * This is also called after resume to bring the PIT into operation again.
43 */ 43 */
44 44
45static void init_cf_pit_timer(enum clock_event_mode mode, 45static int cf_pit_set_periodic(struct clock_event_device *evt)
46 struct clock_event_device *evt)
47{ 46{
48 switch (mode) { 47 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
49 case CLOCK_EVT_MODE_PERIODIC: 48 __raw_writew(PIT_CYCLES_PER_JIFFY, TA(MCFPIT_PMR));
50 49 __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE |
51 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR)); 50 MCFPIT_PCSR_OVW | MCFPIT_PCSR_RLD |
52 __raw_writew(PIT_CYCLES_PER_JIFFY, TA(MCFPIT_PMR)); 51 MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR));
53 __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE | \ 52 return 0;
54 MCFPIT_PCSR_OVW | MCFPIT_PCSR_RLD | \ 53}
55 MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR)); 54
56 break; 55static int cf_pit_set_oneshot(struct clock_event_device *evt)
57 56{
58 case CLOCK_EVT_MODE_SHUTDOWN: 57 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
59 case CLOCK_EVT_MODE_UNUSED: 58 __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE |
60 59 MCFPIT_PCSR_OVW | MCFPIT_PCSR_CLK64, TA(MCFPIT_PCSR));
61 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR)); 60 return 0;
62 break; 61}
63 62
64 case CLOCK_EVT_MODE_ONESHOT: 63static int cf_pit_shutdown(struct clock_event_device *evt)
65 64{
66 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR)); 65 __raw_writew(MCFPIT_PCSR_DISABLE, TA(MCFPIT_PCSR));
67 __raw_writew(MCFPIT_PCSR_EN | MCFPIT_PCSR_PIE | \ 66 return 0;
68 MCFPIT_PCSR_OVW | MCFPIT_PCSR_CLK64, \
69 TA(MCFPIT_PCSR));
70 break;
71
72 case CLOCK_EVT_MODE_RESUME:
73 /* Nothing to do here */
74 break;
75 }
76} 67}
77 68
78/* 69/*
@@ -88,12 +79,15 @@ static int cf_pit_next_event(unsigned long delta,
88} 79}
89 80
90struct clock_event_device cf_pit_clockevent = { 81struct clock_event_device cf_pit_clockevent = {
91 .name = "pit", 82 .name = "pit",
92 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 83 .features = CLOCK_EVT_FEAT_PERIODIC |
93 .set_mode = init_cf_pit_timer, 84 CLOCK_EVT_FEAT_ONESHOT,
94 .set_next_event = cf_pit_next_event, 85 .set_state_shutdown = cf_pit_shutdown,
95 .shift = 32, 86 .set_state_periodic = cf_pit_set_periodic,
96 .irq = MCF_IRQ_PIT1, 87 .set_state_oneshot = cf_pit_set_oneshot,
88 .set_next_event = cf_pit_next_event,
89 .shift = 32,
90 .irq = MCF_IRQ_PIT1,
97}; 91};
98 92
99 93