diff options
author | Greg Ungerer <gerg@snapgear.com> | 2007-10-23 14:37:54 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 08:32:35 -0700 |
commit | 2f2c2679893c963bd90c5e1c0669b97fd87d1c4a (patch) | |
tree | e999c52741b86aef2ad5bcb4ef4e1aeb44613f1d /arch/m68knommu/platform/5307/pit.c | |
parent | 49aa49bfd40d718095669c1c70c9d167b814e29b (diff) |
m68knommu: cleanup m68knommu timer code
Reduce the function pointer mess of the m68knommu timer code by calling
directly to the local hardware's timer setup, and expose the local
common timer interrupt handler to the lower level hardware timer.
Ultimately this will save definitions of all these functions across all
the platform code to setup the function pointers (which for any given
m68knommu CPU family member can be only one set of hardware timer
functions).
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu/platform/5307/pit.c')
-rw-r--r-- | arch/m68knommu/platform/5307/pit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/m68knommu/platform/5307/pit.c b/arch/m68knommu/platform/5307/pit.c index f18352fa35a..173b754d1cd 100644 --- a/arch/m68knommu/platform/5307/pit.c +++ b/arch/m68knommu/platform/5307/pit.c @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <asm/machdep.h> #include <asm/io.h> #include <asm/coldfire.h> #include <asm/mcfpit.h> @@ -31,28 +32,30 @@ /***************************************************************************/ -void coldfire_pit_tick(void) +static irqreturn_t hw_tick(int irq, void *dummy) { unsigned short pcsr; /* Reset the ColdFire timer */ pcsr = __raw_readw(TA(MCFPIT_PCSR)); __raw_writew(pcsr | MCFPIT_PCSR_PIF, TA(MCFPIT_PCSR)); + + return arch_timer_interrupt(irq, dummy); } /***************************************************************************/ static struct irqaction coldfire_pit_irq = { - .name = "timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .name = "timer", + .flags = IRQF_DISABLED | IRQF_TIMER, + .handler = hw_tick, }; -void coldfire_pit_init(irq_handler_t handler) +void hw_timer_init(void) { volatile unsigned char *icrp; volatile unsigned long *imrp; - coldfire_pit_irq.handler = handler; setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &coldfire_pit_irq); icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + @@ -71,7 +74,7 @@ void coldfire_pit_init(irq_handler_t handler) /***************************************************************************/ -unsigned long coldfire_pit_offset(void) +unsigned long hw_timer_offset(void) { volatile unsigned long *ipr; unsigned long pmr, pcntr, offset; |