1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 21da177e4SLinus Torvalds /* 31da177e4SLinus Torvalds * linux/arch/arm/mach-footbridge/isa-timer.c 41da177e4SLinus Torvalds * 51da177e4SLinus Torvalds * Copyright (C) 1998 Russell King. 61da177e4SLinus Torvalds * Copyright (C) 1998 Phil Blundell 71da177e4SLinus Torvalds */ 84e8d7637SRussell King #include <linux/clockchips.h> 9334955efSRalf Baechle #include <linux/i8253.h> 101da177e4SLinus Torvalds #include <linux/init.h> 111da177e4SLinus Torvalds #include <linux/interrupt.h> 1255e86989SThomas Gleixner #include <linux/irq.h> 138c414ff3SRussell King #include <linux/spinlock.h> 144e8d7637SRussell King #include <linux/timex.h> 151da177e4SLinus Torvalds 161da177e4SLinus Torvalds #include <asm/irq.h> 171da177e4SLinus Torvalds #include <asm/mach/time.h> 181da177e4SLinus Torvalds 191da177e4SLinus Torvalds #include "common.h" 201da177e4SLinus Torvalds pit_timer_interrupt(int irq,void * dev_id)214e8d7637SRussell Kingstatic irqreturn_t pit_timer_interrupt(int irq, void *dev_id) 224e8d7637SRussell King { 234e8d7637SRussell King struct clock_event_device *ce = dev_id; 244e8d7637SRussell King ce->event_handler(ce); 251da177e4SLinus Torvalds return IRQ_HANDLED; 261da177e4SLinus Torvalds } 271da177e4SLinus Torvalds isa_timer_init(void)286bb27d73SStephen Warrenvoid __init isa_timer_init(void) 291da177e4SLinus Torvalds { 308c414ff3SRussell King clocksource_i8253_init(); 314e8d7637SRussell King 32*5926e7e1Safzal mohammed if (request_irq(i8253_clockevent.irq, pit_timer_interrupt, 33*5926e7e1Safzal mohammed IRQF_TIMER | IRQF_IRQPOLL, "pit", &i8253_clockevent)) 34*5926e7e1Safzal mohammed pr_err("Failed to request irq %d(pit)\n", i8253_clockevent.irq); 358560a6cfSThomas Gleixner clockevent_i8253_init(false); 361da177e4SLinus Torvalds } 37