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