Commit 04aafd71 authored by Shawn Guo's avatar Shawn Guo

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: default avatarShawn Guo <shawn.guo@linaro.org>
parent 2a3267a4
...@@ -39,11 +39,10 @@ static void __init imx6q_map_io(void) ...@@ -39,11 +39,10 @@ static void __init imx6q_map_io(void)
static int __init imx6q_gpio_add_irq_domain(struct device_node *np, static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent) struct device_node *interrupt_parent)
{ {
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
32 * 7; /* imx6q gets 7 gpio ports */
gpio_irq_base -= 32;
irq_domain_add_simple(np, gpio_irq_base); irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;
return 0; return 0;
} }
......
...@@ -54,11 +54,10 @@ static int __init imx51_tzic_add_irq_domain(struct device_node *np, ...@@ -54,11 +54,10 @@ static int __init imx51_tzic_add_irq_domain(struct device_node *np,
static int __init imx51_gpio_add_irq_domain(struct device_node *np, static int __init imx51_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent) struct device_node *interrupt_parent)
{ {
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
32 * 4; /* imx51 gets 4 gpio ports */
gpio_irq_base -= 32;
irq_domain_add_simple(np, gpio_irq_base); irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;
return 0; return 0;
} }
......
...@@ -58,11 +58,10 @@ static int __init imx53_tzic_add_irq_domain(struct device_node *np, ...@@ -58,11 +58,10 @@ static int __init imx53_tzic_add_irq_domain(struct device_node *np,
static int __init imx53_gpio_add_irq_domain(struct device_node *np, static int __init imx53_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent) struct device_node *interrupt_parent)
{ {
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS - static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
32 * 7; /* imx53 gets 7 gpio ports */
gpio_irq_base -= 32;
irq_domain_add_simple(np, gpio_irq_base); irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment