diff options
author | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2008-09-09 10:19:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-09-09 12:13:55 +0200 |
commit | b72f92ff551d9151c146c8d0f1c5c743611df982 (patch) | |
tree | 26182bb9f13e2d621690a5d22d0300896faed613 /arch/arm/mach-imx/irq.c | |
parent | 8b69ac577e644e5084a9d7a93e4ccd5184c77626 (diff) | |
download | kernel_samsung_tuna-b72f92ff551d9151c146c8d0f1c5c743611df982.zip kernel_samsung_tuna-b72f92ff551d9151c146c8d0f1c5c743611df982.tar.gz kernel_samsung_tuna-b72f92ff551d9151c146c8d0f1c5c743611df982.tar.bz2 |
i.MX: Add FIQ support
Drivers which are going to use it will have to select it and use
imx_set_irq_fiq() to set FIQ mode for this interrupt.
Changes since V1:
- removed '#ifdef CONFIG_FIQ' from irqs.h
- renamed imx_set_irq_type() to imx_set_irq_fiq()
- made irqt unsigned
- fixed irq number check
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/irq.c')
-rw-r--r-- | arch/arm/mach-imx/irq.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c index 798f221..2bb829e 100644 --- a/arch/arm/mach-imx/irq.c +++ b/arch/arm/mach-imx/irq.c @@ -36,10 +36,7 @@ /* * * We simply use the ENABLE DISABLE registers inside of the IMX - * to turn on/off specific interrupts. FIXME- We should - * also add support for the accelerated interrupt controller - * by putting offets to irq jump code in the appropriate - * places. + * to turn on/off specific interrupts. * */ @@ -102,6 +99,28 @@ imx_unmask_irq(unsigned int irq) __raw_writel(irq, IMX_AITC_INTENNUM); } +#ifdef CONFIG_FIQ +int imx_set_irq_fiq(unsigned int irq, unsigned int type) +{ + unsigned int irqt; + + if (irq >= IMX_IRQS) + return -EINVAL; + + if (irq < IMX_IRQS / 2) { + irqt = __raw_readl(IMX_AITC_INTTYPEL) & ~(1 << irq); + __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEL); + } else { + irq -= IMX_IRQS / 2; + irqt = __raw_readl(IMX_AITC_INTTYPEH) & ~(1 << irq); + __raw_writel(irqt | (!!type << irq), IMX_AITC_INTTYPEH); + } + + return 0; +} +EXPORT_SYMBOL(imx_set_irq_fiq); +#endif /* CONFIG_FIQ */ + static int imx_gpio_irq_type(unsigned int _irq, unsigned int type) { @@ -286,4 +305,9 @@ imx_init_irq(void) /* Release masking of interrupts according to priority */ __raw_writel(-1, IMX_AITC_NIMASK); + +#ifdef CONFIG_FIQ + /* Initialize FIQ */ + init_FIQ(); +#endif } |