static void s5p4418_cs_init(struct clocksource_t * cs) { u64_t rate; s5p4418_timer_reset(); /* 75MHZ - 13.333...ns */ rate = s5p4418_timer_calc_tin(CS_TIMER_CHANNEL, 13); s5p4418_timer_stop(CS_TIMER_CHANNEL, 0); s5p4418_timer_count(CS_TIMER_CHANNEL, 0xffffffff); s5p4418_timer_start(CS_TIMER_CHANNEL, 0); cs->mult = clocksource_hz2mult(rate, cs->shift); }
static bool_t cs_init(struct clocksource_t * cs) { struct clocksource_pdata_t * pdat = (struct clocksource_pdata_t *)cs->priv; u64_t rate; s5p4418_timer_reset(); /* 75MHZ - 13.333...ns */ s5p4418_timer_enable(pdat->virt, CS_TIMER_CHANNEL, 0); rate = s5p4418_timer_calc_tin(pdat->virt, CS_TIMER_CHANNEL, 13); clocksource_calc_mult_shift(&cs->mult, &cs->shift, rate, 1000000000ULL, 10); s5p4418_timer_count(pdat->virt, CS_TIMER_CHANNEL, 0xffffffff); s5p4418_timer_start(pdat->virt, CS_TIMER_CHANNEL, 0); return TRUE; }
static bool_t s5p4418_ce_next(struct clockevent_t * ce, u64_t evt) { s5p4418_timer_count(CE_TIMER_CHANNEL, (evt & 0xffffffff)); s5p4418_timer_start(CE_TIMER_CHANNEL, 1); return TRUE; }