isa-timer.c 850 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include <asm/irq.h>
  15. #include <asm/mach/time.h>
  16. #include "common.h"
  17. static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
  18. {
  19. struct clock_event_device *ce = dev_id;
  20. ce->event_handler(ce);
  21. return IRQ_HANDLED;
  22. }
  23. static struct irqaction pit_timer_irq = {
  24. .name = "pit",
  25. .handler = pit_timer_interrupt,
  26. .flags = IRQF_TIMER | IRQF_IRQPOLL,
  27. .dev_id = &i8253_clockevent,
  28. };
  29. void __init isa_timer_init(void)
  30. {
  31. clocksource_i8253_init();
  32. setup_irq(i8253_clockevent.irq, &pit_timer_irq);
  33. clockevent_i8253_init(false);
  34. }