aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r--drivers/mfd/twl-core.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 8ce3959c6919..54727ef005d6 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -38,6 +38,7 @@
38#include <linux/of.h> 38#include <linux/of.h>
39#include <linux/of_irq.h> 39#include <linux/of_irq.h>
40#include <linux/of_platform.h> 40#include <linux/of_platform.h>
41#include <linux/irq.h>
41#include <linux/irqdomain.h> 42#include <linux/irqdomain.h>
42 43
43#include <linux/regulator/machine.h> 44#include <linux/regulator/machine.h>
@@ -149,7 +150,7 @@
149 150
150#define TWL_MODULE_LAST TWL4030_MODULE_LAST 151#define TWL_MODULE_LAST TWL4030_MODULE_LAST
151 152
152#define TWL4030_NR_IRQS 8 153#define TWL4030_NR_IRQS 34 /* core:8, power:8, gpio: 18 */
153#define TWL6030_NR_IRQS 20 154#define TWL6030_NR_IRQS 20
154 155
155/* Base Address defns for twl4030_map[] */ 156/* Base Address defns for twl4030_map[] */
@@ -263,10 +264,6 @@ struct twl_client {
263 264
264static struct twl_client twl_modules[TWL_NUM_SLAVES]; 265static struct twl_client twl_modules[TWL_NUM_SLAVES];
265 266
266#ifdef CONFIG_IRQ_DOMAIN
267static struct irq_domain domain;
268#endif
269
270/* mapping the module id to slave id and base address */ 267/* mapping the module id to slave id and base address */
271struct twl_mapping { 268struct twl_mapping {
272 unsigned char sid; /* Slave ID */ 269 unsigned char sid; /* Slave ID */
@@ -1227,14 +1224,8 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1227 1224
1228 pdata->irq_base = status; 1225 pdata->irq_base = status;
1229 pdata->irq_end = pdata->irq_base + nr_irqs; 1226 pdata->irq_end = pdata->irq_base + nr_irqs;
1230 1227 irq_domain_add_legacy(node, nr_irqs, pdata->irq_base, 0,
1231#ifdef CONFIG_IRQ_DOMAIN 1228 &irq_domain_simple_ops, NULL);
1232 domain.irq_base = pdata->irq_base;
1233 domain.nr_irq = nr_irqs;
1234 domain.of_node = of_node_get(node);
1235 domain.ops = &irq_domain_simple_ops;
1236 irq_domain_add(&domain);
1237#endif
1238 1229
1239 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { 1230 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
1240 dev_dbg(&client->dev, "can't talk I2C?\n"); 1231 dev_dbg(&client->dev, "can't talk I2C?\n");
@@ -1315,11 +1306,10 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1315 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); 1306 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
1316 } 1307 }
1317 1308
1318#ifdef CONFIG_OF_DEVICE 1309 status = -ENODEV;
1319 if (node) 1310 if (node)
1320 status = of_platform_populate(node, NULL, NULL, &client->dev); 1311 status = of_platform_populate(node, NULL, NULL, &client->dev);
1321 else 1312 if (status)
1322#endif
1323 status = add_children(pdata, id->driver_data); 1313 status = add_children(pdata, id->driver_data);
1324 1314
1325fail: 1315fail: