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