1 /* arch/arm/mach-lh7a40x/irq-lh7a400.c
3 * Copyright (C) 2004 Coastal Environmental Systems
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
11 #include <linux/init.h>
12 #include <linux/module.h>
13 #include <linux/interrupt.h>
15 #include <mach/hardware.h>
17 #include <asm/mach/irq.h>
18 #include <mach/irqs.h>
22 /* CPU IRQ handling */
24 static void lh7a400_mask_irq(struct irq_data
*d
)
26 INTC_INTENC
= (1 << d
->irq
);
29 static void lh7a400_unmask_irq(struct irq_data
*d
)
31 INTC_INTENS
= (1 << d
->irq
);
34 static void lh7a400_ack_gpio_irq(struct irq_data
*d
)
36 GPIO_GPIOFEOI
= (1 << IRQ_TO_GPIO (d
->irq
));
37 INTC_INTENC
= (1 << d
->irq
);
40 static struct irq_chip lh7a400_internal_chip
= {
42 .irq_ack
= lh7a400_mask_irq
, /* Level triggering -> mask is ack */
43 .irq_mask
= lh7a400_mask_irq
,
44 .irq_unmask
= lh7a400_unmask_irq
,
47 static struct irq_chip lh7a400_gpio_chip
= {
49 .irq_ack
= lh7a400_ack_gpio_irq
,
50 .irq_mask
= lh7a400_mask_irq
,
51 .irq_unmask
= lh7a400_unmask_irq
,
55 /* IRQ initialization */
57 void __init
lh7a400_init_irq (void)
61 INTC_INTENC
= 0xffffffff; /* Disable all interrupts */
62 GPIO_GPIOFINTEN
= 0x00; /* Disable all GPIOF interrupts */
65 for (irq
= 0; irq
< NR_IRQS
; ++irq
) {
75 set_irq_chip (irq
, &lh7a400_gpio_chip
);
76 set_irq_handler (irq
, handle_level_irq
); /* OK default */
79 set_irq_chip (irq
, &lh7a400_internal_chip
);
80 set_irq_handler (irq
, handle_level_irq
);
82 set_irq_flags (irq
, IRQF_VALID
);
85 lh7a40x_init_board_irq ();
87 /* *** FIXME: the LH7a400 does use FIQ interrupts in some cases. For
88 the time being, these are not initialized. */