2005-04-16 16:20:36 -06:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-footbridge/isa-timer.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 1998 Russell King.
|
|
|
|
* Copyright (C) 1998 Phil Blundell
|
|
|
|
*/
|
2011-01-28 14:00:39 -07:00
|
|
|
#include <linux/clockchips.h>
|
2011-06-01 12:04:57 -06:00
|
|
|
#include <linux/i8253.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
2006-07-01 15:32:17 -06:00
|
|
|
#include <linux/irq.h>
|
2011-05-08 11:50:20 -06:00
|
|
|
#include <linux/spinlock.h>
|
2011-01-28 14:00:39 -07:00
|
|
|
#include <linux/timex.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/mach/time.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2011-01-28 14:00:39 -07:00
|
|
|
static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
2011-01-28 14:00:39 -07:00
|
|
|
struct clock_event_device *ce = dev_id;
|
|
|
|
ce->event_handler(ce);
|
2005-04-16 16:20:36 -06:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
2011-01-28 14:00:39 -07:00
|
|
|
static struct irqaction pit_timer_irq = {
|
|
|
|
.name = "pit",
|
|
|
|
.handler = pit_timer_interrupt,
|
2007-05-08 01:35:39 -06:00
|
|
|
.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
|
2011-06-09 07:08:28 -06:00
|
|
|
.dev_id = &i8253_clockevent,
|
2005-04-16 16:20:36 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static void __init isa_timer_init(void)
|
|
|
|
{
|
2011-05-08 11:50:20 -06:00
|
|
|
clocksource_i8253_init();
|
2005-04-16 16:20:36 -06:00
|
|
|
|
2011-06-09 07:08:28 -06:00
|
|
|
setup_irq(i8253_clockevent.irq, &pit_timer_irq);
|
|
|
|
clockevent_i8253_init(false);
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
struct sys_timer isa_timer = {
|
|
|
|
.init = isa_timer_init,
|
|
|
|
};
|