diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2016-06-19 08:55:53 +0200 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-06-21 09:57:05 +0200 |
commit | d1e1c31ccd5a807a707c94386d5fa36d18600892 (patch) | |
tree | a60a9b3188157d495b235df3e356b52625c9b33f /arch/arm/mach-imx/avic.c | |
parent | ARM: imx6: fix static declaration in include/soc/imx/cpuidle.h (diff) | |
download | linux-d1e1c31ccd5a807a707c94386d5fa36d18600892.tar.xz linux-d1e1c31ccd5a807a707c94386d5fa36d18600892.zip |
ARM: i.MX: Fix FIQ interrupt handling for TZIC
IRQ number should be translated from VIRQ to HWIRQ for TZIC.
As a solution for this issue, move existing translation code
from AVIC to common place.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'arch/arm/mach-imx/avic.c')
-rw-r--r-- | arch/arm/mach-imx/avic.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/arm/mach-imx/avic.c b/arch/arm/mach-imx/avic.c index 7fa176e792bd..1afccae0420c 100644 --- a/arch/arm/mach-imx/avic.c +++ b/arch/arm/mach-imx/avic.c @@ -55,23 +55,20 @@ static void __iomem *avic_base; static struct irq_domain *domain; #ifdef CONFIG_FIQ -static int avic_set_irq_fiq(unsigned int irq, unsigned int type) +static int avic_set_irq_fiq(unsigned int hwirq, unsigned int type) { - struct irq_data *d = irq_get_irq_data(irq); unsigned int irqt; - irq = d->hwirq; - - if (irq >= AVIC_NUM_IRQS) + if (hwirq >= AVIC_NUM_IRQS) return -EINVAL; - if (irq < AVIC_NUM_IRQS / 2) { - irqt = imx_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq); - imx_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL); + if (hwirq < AVIC_NUM_IRQS / 2) { + irqt = imx_readl(avic_base + AVIC_INTTYPEL) & ~(1 << hwirq); + imx_writel(irqt | (!!type << hwirq), avic_base + AVIC_INTTYPEL); } else { - irq -= AVIC_NUM_IRQS / 2; - irqt = imx_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq); - imx_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH); + hwirq -= AVIC_NUM_IRQS / 2; + irqt = imx_readl(avic_base + AVIC_INTTYPEH) & ~(1 << hwirq); + imx_writel(irqt | (!!type << hwirq), avic_base + AVIC_INTTYPEH); } return 0; |