Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-footbridge/isa-timer.c |
| 4 | * |
| 5 | * Copyright (C) 1998 Russell King. |
| 6 | * Copyright (C) 1998 Phil Blundell |
| 7 | */ |
Russell King | 4e8d763 | 2011-01-28 21:00:39 +0000 | [diff] [blame] | 8 | #include <linux/clockchips.h> |
Ralf Baechle | 334955e | 2011-06-01 19:04:57 +0100 | [diff] [blame] | 9 | #include <linux/i8253.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/init.h> |
| 11 | #include <linux/interrupt.h> |
Thomas Gleixner | 55e8698 | 2006-07-01 22:32:17 +0100 | [diff] [blame] | 12 | #include <linux/irq.h> |
Russell King | 8c414ff | 2011-05-08 18:50:20 +0100 | [diff] [blame] | 13 | #include <linux/spinlock.h> |
Russell King | 4e8d763 | 2011-01-28 21:00:39 +0000 | [diff] [blame] | 14 | #include <linux/timex.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <asm/irq.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <asm/mach/time.h> |
| 18 | |
| 19 | #include "common.h" |
| 20 | |
Russell King | 4e8d763 | 2011-01-28 21:00:39 +0000 | [diff] [blame] | 21 | static irqreturn_t pit_timer_interrupt(int irq, void *dev_id) |
| 22 | { |
| 23 | struct clock_event_device *ce = dev_id; |
| 24 | ce->event_handler(ce); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | return IRQ_HANDLED; |
| 26 | } |
| 27 | |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 28 | void __init isa_timer_init(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | { |
Russell King | 8c414ff | 2011-05-08 18:50:20 +0100 | [diff] [blame] | 30 | clocksource_i8253_init(); |
Russell King | 4e8d763 | 2011-01-28 21:00:39 +0000 | [diff] [blame] | 31 | |
afzal mohammed | 5926e7e | 2020-03-12 14:51:23 +0100 | [diff] [blame] | 32 | if (request_irq(i8253_clockevent.irq, pit_timer_interrupt, |
| 33 | IRQF_TIMER | IRQF_IRQPOLL, "pit", &i8253_clockevent)) |
| 34 | pr_err("Failed to request irq %d(pit)\n", i8253_clockevent.irq); |
Thomas Gleixner | 8560a6c | 2011-06-09 13:08:28 +0000 | [diff] [blame] | 35 | clockevent_i8253_init(false); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | } |