Lines Matching refs:dw_cs
300 void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs) in dw_apb_clocksource_start() argument
306 unsigned long ctrl = apbt_readl(&dw_cs->timer, APBTMR_N_CONTROL); in dw_apb_clocksource_start()
309 apbt_writel(&dw_cs->timer, ctrl, APBTMR_N_CONTROL); in dw_apb_clocksource_start()
310 apbt_writel(&dw_cs->timer, ~0, APBTMR_N_LOAD_COUNT); in dw_apb_clocksource_start()
314 apbt_writel(&dw_cs->timer, ctrl, APBTMR_N_CONTROL); in dw_apb_clocksource_start()
316 dw_apb_clocksource_read(dw_cs); in dw_apb_clocksource_start()
322 struct dw_apb_clocksource *dw_cs = in __apbt_read_clocksource() local
325 current_count = apbt_readl(&dw_cs->timer, APBTMR_N_CURRENT_VALUE); in __apbt_read_clocksource()
332 struct dw_apb_clocksource *dw_cs = in apbt_restart_clocksource() local
335 dw_apb_clocksource_start(dw_cs); in apbt_restart_clocksource()
354 struct dw_apb_clocksource *dw_cs = kzalloc(sizeof(*dw_cs), GFP_KERNEL); in dw_apb_clocksource_init() local
356 if (!dw_cs) in dw_apb_clocksource_init()
359 dw_cs->timer.base = base; in dw_apb_clocksource_init()
360 dw_cs->timer.freq = freq; in dw_apb_clocksource_init()
361 dw_cs->cs.name = name; in dw_apb_clocksource_init()
362 dw_cs->cs.rating = rating; in dw_apb_clocksource_init()
363 dw_cs->cs.read = __apbt_read_clocksource; in dw_apb_clocksource_init()
364 dw_cs->cs.mask = CLOCKSOURCE_MASK(32); in dw_apb_clocksource_init()
365 dw_cs->cs.flags = CLOCK_SOURCE_IS_CONTINUOUS; in dw_apb_clocksource_init()
366 dw_cs->cs.resume = apbt_restart_clocksource; in dw_apb_clocksource_init()
368 return dw_cs; in dw_apb_clocksource_init()
376 void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs) in dw_apb_clocksource_register() argument
378 clocksource_register_hz(&dw_cs->cs, dw_cs->timer.freq); in dw_apb_clocksource_register()
386 cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs) in dw_apb_clocksource_read() argument
388 return (cycle_t)~apbt_readl(&dw_cs->timer, APBTMR_N_CURRENT_VALUE); in dw_apb_clocksource_read()
396 void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs) in dw_apb_clocksource_unregister() argument
398 clocksource_unregister(&dw_cs->cs); in dw_apb_clocksource_unregister()
400 kfree(dw_cs); in dw_apb_clocksource_unregister()