Lines Matching refs:ce

54 static int mps2_timer_shutdown(struct clock_event_device *ce)  in mps2_timer_shutdown()  argument
56 clockevent_mps2_writel(0, ce, TIMER_RELOAD); in mps2_timer_shutdown()
57 clockevent_mps2_writel(0, ce, TIMER_CTRL); in mps2_timer_shutdown()
62 static int mps2_timer_set_next_event(unsigned long next, struct clock_event_device *ce) in mps2_timer_set_next_event() argument
64 clockevent_mps2_writel(next, ce, TIMER_VALUE); in mps2_timer_set_next_event()
65 clockevent_mps2_writel(TIMER_CTRL_IE | TIMER_CTRL_ENABLE, ce, TIMER_CTRL); in mps2_timer_set_next_event()
70 static int mps2_timer_set_periodic(struct clock_event_device *ce) in mps2_timer_set_periodic() argument
72 u32 clock_count_per_tick = to_mps2_clkevt(ce)->clock_count_per_tick; in mps2_timer_set_periodic()
74 clockevent_mps2_writel(clock_count_per_tick, ce, TIMER_RELOAD); in mps2_timer_set_periodic()
75 clockevent_mps2_writel(clock_count_per_tick, ce, TIMER_VALUE); in mps2_timer_set_periodic()
76 clockevent_mps2_writel(TIMER_CTRL_IE | TIMER_CTRL_ENABLE, ce, TIMER_CTRL); in mps2_timer_set_periodic()
83 struct clockevent_mps2 *ce = dev_id; in mps2_timer_interrupt() local
84 u32 status = readl_relaxed(ce->reg + TIMER_INT); in mps2_timer_interrupt()
91 writel_relaxed(1, ce->reg + TIMER_INT); in mps2_timer_interrupt()
93 ce->clkevt.event_handler(&ce->clkevt); in mps2_timer_interrupt()
102 struct clockevent_mps2 *ce; in mps2_clockevent_init() local
139 ce = kzalloc(sizeof(*ce), GFP_KERNEL); in mps2_clockevent_init()
140 if (!ce) { in mps2_clockevent_init()
145 ce->reg = base; in mps2_clockevent_init()
146 ce->clock_count_per_tick = DIV_ROUND_CLOSEST(rate, HZ); in mps2_clockevent_init()
147 ce->clkevt.irq = irq; in mps2_clockevent_init()
148 ce->clkevt.name = name; in mps2_clockevent_init()
149 ce->clkevt.rating = 200; in mps2_clockevent_init()
150 ce->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT; in mps2_clockevent_init()
151 ce->clkevt.cpumask = cpu_possible_mask; in mps2_clockevent_init()
152 ce->clkevt.set_state_shutdown = mps2_timer_shutdown; in mps2_clockevent_init()
153 ce->clkevt.set_state_periodic = mps2_timer_set_periodic; in mps2_clockevent_init()
154 ce->clkevt.set_state_oneshot = mps2_timer_shutdown; in mps2_clockevent_init()
155 ce->clkevt.set_next_event = mps2_timer_set_next_event; in mps2_clockevent_init()
160 ret = request_irq(irq, mps2_timer_interrupt, IRQF_TIMER, name, ce); in mps2_clockevent_init()
166 clockevents_config_and_register(&ce->clkevt, rate, 0xf, 0xffffffff); in mps2_clockevent_init()
171 kfree(ce); in mps2_clockevent_init()