Lines Matching refs:timer
52 struct sun5i_timer timer; member
60 struct sun5i_timer timer; member
75 u32 old = readl(ce->timer.base + TIMER_CNTVAL_LO_REG(1)); in sun5i_clkevt_sync()
77 while ((old - readl(ce->timer.base + TIMER_CNTVAL_LO_REG(1))) < TIMER_SYNC_TICKS) in sun5i_clkevt_sync()
81 static void sun5i_clkevt_time_stop(struct sun5i_timer_clkevt *ce, u8 timer) in sun5i_clkevt_time_stop() argument
83 u32 val = readl(ce->timer.base + TIMER_CTL_REG(timer)); in sun5i_clkevt_time_stop()
84 writel(val & ~TIMER_CTL_ENABLE, ce->timer.base + TIMER_CTL_REG(timer)); in sun5i_clkevt_time_stop()
89 static void sun5i_clkevt_time_setup(struct sun5i_timer_clkevt *ce, u8 timer, u32 delay) in sun5i_clkevt_time_setup() argument
91 writel(delay, ce->timer.base + TIMER_INTVAL_LO_REG(timer)); in sun5i_clkevt_time_setup()
94 static void sun5i_clkevt_time_start(struct sun5i_timer_clkevt *ce, u8 timer, bool periodic) in sun5i_clkevt_time_start() argument
96 u32 val = readl(ce->timer.base + TIMER_CTL_REG(timer)); in sun5i_clkevt_time_start()
104 ce->timer.base + TIMER_CTL_REG(timer)); in sun5i_clkevt_time_start()
129 sun5i_clkevt_time_setup(ce, 0, ce->timer.ticks_per_jiffy); in sun5i_clkevt_set_periodic()
150 writel(0x1, ce->timer.base + TIMER_IRQ_ST_REG); in sun5i_timer_interrupt()
160 return ~readl(cs->timer.base + TIMER_CNTVAL_LO_REG(1)); in sun5i_clksrc_read()
167 struct sun5i_timer *timer = to_sun5i_timer(nb); in sun5i_rate_cb_clksrc() local
168 struct sun5i_timer_clksrc *cs = container_of(timer, struct sun5i_timer_clksrc, timer); in sun5i_rate_cb_clksrc()
211 cs->timer.base = base; in sun5i_setup_clocksource()
212 cs->timer.clk = clk; in sun5i_setup_clocksource()
213 cs->timer.clk_rate_cb.notifier_call = sun5i_rate_cb_clksrc; in sun5i_setup_clocksource()
214 cs->timer.clk_rate_cb.next = NULL; in sun5i_setup_clocksource()
216 ret = clk_notifier_register(clk, &cs->timer.clk_rate_cb); in sun5i_setup_clocksource()
241 clk_notifier_unregister(clk, &cs->timer.clk_rate_cb); in sun5i_setup_clocksource()
253 struct sun5i_timer *timer = to_sun5i_timer(nb); in sun5i_rate_cb_clkevt() local
254 struct sun5i_timer_clkevt *ce = container_of(timer, struct sun5i_timer_clkevt, timer); in sun5i_rate_cb_clkevt()
258 ce->timer.ticks_per_jiffy = DIV_ROUND_UP(ndata->new_rate, HZ); in sun5i_rate_cb_clkevt()
289 ce->timer.base = base; in sun5i_setup_clockevent()
290 ce->timer.ticks_per_jiffy = DIV_ROUND_UP(rate, HZ); in sun5i_setup_clockevent()
291 ce->timer.clk = clk; in sun5i_setup_clockevent()
292 ce->timer.clk_rate_cb.notifier_call = sun5i_rate_cb_clkevt; in sun5i_setup_clockevent()
293 ce->timer.clk_rate_cb.next = NULL; in sun5i_setup_clockevent()
295 ret = clk_notifier_register(clk, &ce->timer.clk_rate_cb); in sun5i_setup_clockevent()
329 clk_notifier_unregister(clk, &ce->timer.clk_rate_cb); in sun5i_setup_clockevent()