aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl6040-irq.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-05-16 07:11:58 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-05-20 11:27:12 -0400
commit37e13cecaa141eccce705843f5d2f7509e29bd3a (patch)
tree6f0b138f14c86ac5851b97fc3acd59c7a736ca5e /drivers/mfd/twl6040-irq.c
parent1f01d60e4c0cae3416071680635f227df0020dd8 (diff)
mfd: Add support for Device Tree to twl6040
Device tree based probing support for the core twl6040 driver. Child devices will be created as MFD devices: - ASoC codec is always created - Vibra child is only created if the vibra section present in the DT blob. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl6040-irq.c')
-rw-r--r--drivers/mfd/twl6040-irq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040-irq.c b/drivers/mfd/twl6040-irq.c
index 914978e1b62e..4b42543da228 100644
--- a/drivers/mfd/twl6040-irq.c
+++ b/drivers/mfd/twl6040-irq.c
@@ -25,6 +25,8 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/of.h>
29#include <linux/irqdomain.h>
28#include <linux/interrupt.h> 30#include <linux/interrupt.h>
29#include <linux/mfd/core.h> 31#include <linux/mfd/core.h>
30#include <linux/mfd/twl6040.h> 32#include <linux/mfd/twl6040.h>
@@ -139,6 +141,7 @@ static irqreturn_t twl6040_irq_thread(int irq, void *data)
139 141
140int twl6040_irq_init(struct twl6040 *twl6040) 142int twl6040_irq_init(struct twl6040 *twl6040)
141{ 143{
144 struct device_node *node = twl6040->dev->of_node;
142 int i, nr_irqs, irq_base, ret; 145 int i, nr_irqs, irq_base, ret;
143 u8 val; 146 u8 val;
144 147
@@ -158,6 +161,9 @@ int twl6040_irq_init(struct twl6040 *twl6040)
158 } 161 }
159 twl6040->irq_base = irq_base; 162 twl6040->irq_base = irq_base;
160 163
164 irq_domain_add_legacy(node, ARRAY_SIZE(twl6040_irqs), irq_base, 0,
165 &irq_domain_simple_ops, NULL);
166
161 /* Register them with genirq */ 167 /* Register them with genirq */
162 for (i = irq_base; i < irq_base + nr_irqs; i++) { 168 for (i = irq_base; i < irq_base + nr_irqs; i++) {
163 irq_set_chip_data(i, twl6040); 169 irq_set_chip_data(i, twl6040);