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