aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc/irq.c')
-rw-r--r--arch/arm/plat-mxc/irq.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
index 6e7578a3514..0fb68a531f5 100644
--- a/arch/arm/plat-mxc/irq.c
+++ b/arch/arm/plat-mxc/irq.c
@@ -50,23 +50,27 @@
50#define IIM_PROD_REV_SH 3 50#define IIM_PROD_REV_SH 3
51#define IIM_PROD_REV_LEN 5 51#define IIM_PROD_REV_LEN 5
52 52
53#ifdef CONFIG_MXC_IRQ_PRIOR 53int imx_irq_set_priority(unsigned char irq, unsigned char prio)
54void imx_irq_set_priority(unsigned char irq, unsigned char prio)
55{ 54{
55#ifdef CONFIG_MXC_IRQ_PRIOR
56 unsigned int temp; 56 unsigned int temp;
57 unsigned int mask = 0x0F << irq % 8 * 4; 57 unsigned int mask = 0x0F << irq % 8 * 4;
58 58
59 if (irq > 63) 59 if (irq >= MXC_INTERNAL_IRQS)
60 return; 60 return -EINVAL;;
61 61
62 temp = __raw_readl(AVIC_NIPRIORITY(irq / 8)); 62 temp = __raw_readl(AVIC_NIPRIORITY(irq / 8));
63 temp &= ~mask; 63 temp &= ~mask;
64 temp |= prio & mask; 64 temp |= prio & mask;
65 65
66 __raw_writel(temp, AVIC_NIPRIORITY(irq / 8)); 66 __raw_writel(temp, AVIC_NIPRIORITY(irq / 8));
67
68 return 0;
69#else
70 return -ENOSYS;
71#endif
67} 72}
68EXPORT_SYMBOL(imx_irq_set_priority); 73EXPORT_SYMBOL(imx_irq_set_priority);
69#endif
70 74
71#ifdef CONFIG_FIQ 75#ifdef CONFIG_FIQ
72int mxc_set_irq_fiq(unsigned int irq, unsigned int type) 76int mxc_set_irq_fiq(unsigned int irq, unsigned int type)