PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/arm/mach-footbridge/isa-timer.c

https://github.com/AICP/kernel_google_msm
C | 44 lines | 31 code | 7 blank | 6 comment | 0 complexity | 91faaa687efcbab4d401abd22329de45 MD5 | raw file
 1/*
 2 *  linux/arch/arm/mach-footbridge/isa-timer.c
 3 *
 4 *  Copyright (C) 1998 Russell King.
 5 *  Copyright (C) 1998 Phil Blundell
 6 */
 7#include <linux/clockchips.h>
 8#include <linux/i8253.h>
 9#include <linux/init.h>
10#include <linux/interrupt.h>
11#include <linux/irq.h>
12#include <linux/spinlock.h>
13#include <linux/timex.h>
14
15#include <asm/irq.h>
16#include <asm/mach/time.h>
17
18#include "common.h"
19
20static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
21{
22	struct clock_event_device *ce = dev_id;
23	ce->event_handler(ce);
24	return IRQ_HANDLED;
25}
26
27static struct irqaction pit_timer_irq = {
28	.name		= "pit",
29	.handler	= pit_timer_interrupt,
30	.flags		= IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
31	.dev_id		= &i8253_clockevent,
32};
33
34static void __init isa_timer_init(void)
35{
36	clocksource_i8253_init();
37
38	setup_irq(i8253_clockevent.irq, &pit_timer_irq);
39	clockevent_i8253_init(false);
40}
41
42struct sys_timer isa_timer = {
43	.init		= isa_timer_init,
44};