コード例 #1
0
ファイル: hr-time-rtc.c プロジェクト: AustinBleax/Bali_SK4G
static void s5p_tick_set_mode(enum clock_event_mode mode,
			      struct clock_event_device *evt)
{
	switch (mode) {
	case CLOCK_EVT_MODE_PERIODIC:
		tick_timer_mode = 1;
		break;
	case CLOCK_EVT_MODE_ONESHOT:
		s5p_tick_timer_stop();
		tick_timer_mode = 0;
		break;
	case CLOCK_EVT_MODE_UNUSED:
	case CLOCK_EVT_MODE_SHUTDOWN:
		/* Sched timer stopped */
		sched_timer_running = 0;

		/* Reset sched_clock variables after sleep/wakeup */
		last_ticks = 0;
		s5p_sched_timer_overflows = 0;
		old_overflows = 0;
		pending_irq = 0;
		break;
	case CLOCK_EVT_MODE_RESUME:
		s5p_tick_timer_setup();
		s5p_sched_timer_start(~0, 1);
		break;
	}
}
コード例 #2
0
static void s5p_init_clocksource(unsigned long rate)
{
	static char err[] __initdata = KERN_ERR
			"%s: can't register clocksource!\n";

	clocksource_s5p.mult
		= clocksource_khz2mult(rate/1000, clocksource_s5p.shift);

	s5p_sched_timer_start(~0, 1);

	if (clocksource_register(&clocksource_s5p))
		printk(err, clocksource_s5p.name);
}