@@ -150,6 +150,17 @@ int of_gpio_simple_xlate(struct of_gpio_chip
*of_gc, struct device_node *np,
}
EXPORT_SYMBOL(of_gpio_simple_xlate);
+static int of_mm_gpio_to_irq(struct gpio_chip *gc, unsigned int gpio)
+{
+ struct of_mm_gpio_chip *mm_gc;
+ struct of_gpio_chip *of_gc;
+
+ of_gc = container_of(gc, struct of_gpio_chip, gc);
+ mm_gc = container_of(of_gc, struct of_mm_gpio_chip, of_gc);
+ return mm_gc->irq;
+
+}
+
/**
* of_mm_gpiochip_add - Add memory mapped GPIO chip (bank)
* @np: device node of the GPIO chip
@@ -188,6 +199,9 @@ int of_mm_gpiochip_add(struct device_node *np,
gc->base = -1;
+ mm_gc->irq = irq_of_parse_and_map(np, 0);
+ gc->to_irq = of_mm_gpio_to_irq;
+
if (!of_gc->xlate)
of_gc->xlate = of_gpio_simple_xlate;
@@ -54,6 +54,7 @@ struct of_mm_gpio_chip {
struct of_gpio_chip of_gc;
void (*save_regs)(struct of_mm_gpio_chip *mm_gc);
void __iomem *regs;
+ int irq;
};
static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)