1 From b27b8f1bd7d46f1affc9a2bc4142e248411c1afa Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 22 Oct 2012 17:42:48 +0200
4 Subject: [PATCH 100/113] MIPS: lantiq: external interrupt units not loaded
7 The code references the wrong device node causing the number of EIU pins to
10 Signed-off-by: John Crispin <blogic@openwrt.org>
12 arch/mips/lantiq/irq.c | 2 +-
13 drivers/pinctrl/pinctrl-xway.c | 15 +++++++++++++++
14 2 files changed, 16 insertions(+), 1 deletion(-)
16 diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
17 index f36acd1..8e55622 100644
18 --- a/arch/mips/lantiq/irq.c
19 +++ b/arch/mips/lantiq/irq.c
20 @@ -343,7 +343,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
21 eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu");
22 if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
23 /* find out how many external irq sources we have */
24 - const __be32 *count = of_get_property(node,
25 + const __be32 *count = of_get_property(eiu_node,
26 "lantiq,count", NULL);
29 diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
30 index b9bcaec..ea5e017 100644
31 --- a/drivers/pinctrl/pinctrl-xway.c
32 +++ b/drivers/pinctrl/pinctrl-xway.c
34 #include <linux/of_platform.h>
35 #include <linux/of_address.h>
36 #include <linux/of_gpio.h>
37 +#include <linux/of_irq.h>
38 #include <linux/ioport.h>
40 #include <linux/device.h>
41 @@ -618,6 +619,19 @@ static void xway_gpio_free(struct gpio_chip *chip, unsigned offset)
42 pinctrl_free_gpio(gpio);
45 +static int xway_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
47 + struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
48 + struct resource res;
51 + for (i = 0; i < info->num_exin; i++)
52 + if (offset == info->exin[i])
53 + if (of_irq_to_resource(chip->dev->of_node, i, &res))
58 static struct gpio_chip xway_chip = {
60 .direction_input = xway_gpio_dir_in,
61 @@ -626,6 +640,7 @@ static struct gpio_chip xway_chip = {
63 .request = xway_gpio_req,
64 .free = xway_gpio_free,
65 + .to_irq = xway_gpio_to_irq,