Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
static bool_t s5p4418_ce_init(struct clockevent_t * ce)
{
	u64_t rate;

	s5p4418_timer_reset();

	if(!request_irq("TIMER0", s5p4418_ce_interrupt, IRQ_TYPE_NONE, ce))
	{
		LOG("can't request irq 'TIMER0'");
		return FALSE;
	}

	/* 9.375MHZ - 107ns */
	s5p4418_timer_enable(CE_TIMER_CHANNEL, 1);
	rate = s5p4418_timer_calc_tin(CE_TIMER_CHANNEL, 107);
	clockevent_calc_mult_shift(ce, rate, 10);
	ce->min_delta_ns = clockevent_delta2ns(ce, 0x1);
	ce->max_delta_ns = clockevent_delta2ns(ce, 0xffffffff);
	s5p4418_timer_count(CE_TIMER_CHANNEL, 0);
	s5p4418_timer_stop(CE_TIMER_CHANNEL);

	return TRUE;
}