aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mach-imx6q.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-12-01 01:49:29 -0500
committerShawn Guo <shawn.guo@linaro.org>2011-12-01 03:15:15 -0500
commit04aafd713bae8a75933c7821dc012b0ec9046bca (patch)
tree5d0a8b41980b7e229e12510c9d24e27573cf6a8a /arch/arm/mach-imx/mach-imx6q.c
parent2a3267a489f1dc4284b64a4b88c62011946dc7ff (diff)
arm/imx: fix irq_base for gpio
When gpio core dynamically allocate gpio number for a port, it starts from the end of the total range, 0 ~ ARCH_NR_GPIOS. That said, the earlier a port gets probed, the bigger gpio number it gets assigned. To match this, the irq_base for gpio should be assigned from 'MXC_GPIO_IRQ_START + ARCH_NR_GPIOS' decreasingly. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index eb7531bdfed7..22aa54aa9b2a 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -39,11 +39,10 @@ static void __init imx6q_map_io(void)
39static int __init imx6q_gpio_add_irq_domain(struct device_node *np, 39static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
40 struct device_node *interrupt_parent) 40 struct device_node *interrupt_parent)
41{ 41{
42 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - 42 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
43 32 * 7; /* imx6q gets 7 gpio ports */
44 43
44 gpio_irq_base -= 32;
45 irq_domain_add_simple(np, gpio_irq_base); 45 irq_domain_add_simple(np, gpio_irq_base);
46 gpio_irq_base += 32;
47 46
48 return 0; 47 return 0;
49} 48}