isa-timer.c 886 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * linux/arch/arm/mach-footbridge/isa-timer.c
  4. *
  5. * Copyright (C) 1998 Russell King.
  6. * Copyright (C) 1998 Phil Blundell
  7. */
  8. #include <linux/clockchips.h>
  9. #include <linux/i8253.h>
  10. #include <linux/init.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/irq.h>
  13. #include <linux/spinlock.h>
  14. #include <linux/timex.h>
  15. #include <asm/irq.h>
  16. #include <asm/mach/time.h>
  17. #include "common.h"
  18. static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
  19. {
  20. struct clock_event_device *ce = dev_id;
  21. ce->event_handler(ce);
  22. return IRQ_HANDLED;
  23. }
  24. static struct irqaction pit_timer_irq = {
  25. .name = "pit",
  26. .handler = pit_timer_interrupt,
  27. .flags = IRQF_TIMER | IRQF_IRQPOLL,
  28. .dev_id = &i8253_clockevent,
  29. };
  30. void __init isa_timer_init(void)
  31. {
  32. clocksource_i8253_init();
  33. setup_irq(i8253_clockevent.irq, &pit_timer_irq);
  34. clockevent_i8253_init(false);
  35. }