aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/Kconfig1
-rw-r--r--drivers/mfd/twl-core.c21
2 files changed, 6 insertions, 16 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index f147395bac9a..1489c3540f96 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -201,6 +201,7 @@ config MENELAUS
201config TWL4030_CORE 201config TWL4030_CORE
202 bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support" 202 bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
203 depends on I2C=y && GENERIC_HARDIRQS 203 depends on I2C=y && GENERIC_HARDIRQS
204 select IRQ_DOMAIN
204 help 205 help
205 Say yes here if you have TWL4030 / TWL6030 family chip on your board. 206 Say yes here if you have TWL4030 / TWL6030 family chip on your board.
206 This core driver provides register access and IRQ handling 207 This core driver provides register access and IRQ handling
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 8ce3959c6919..4970d43952db 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -149,7 +149,7 @@
149 149
150#define TWL_MODULE_LAST TWL4030_MODULE_LAST 150#define TWL_MODULE_LAST TWL4030_MODULE_LAST
151 151
152#define TWL4030_NR_IRQS 8 152#define TWL4030_NR_IRQS 34 /* core:8, power:8, gpio: 18 */
153#define TWL6030_NR_IRQS 20 153#define TWL6030_NR_IRQS 20
154 154
155/* Base Address defns for twl4030_map[] */ 155/* Base Address defns for twl4030_map[] */
@@ -263,10 +263,6 @@ struct twl_client {
263 263
264static struct twl_client twl_modules[TWL_NUM_SLAVES]; 264static struct twl_client twl_modules[TWL_NUM_SLAVES];
265 265
266#ifdef CONFIG_IRQ_DOMAIN
267static struct irq_domain domain;
268#endif
269
270/* mapping the module id to slave id and base address */ 266/* mapping the module id to slave id and base address */
271struct twl_mapping { 267struct twl_mapping {
272 unsigned char sid; /* Slave ID */ 268 unsigned char sid; /* Slave ID */
@@ -1227,14 +1223,8 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1227 1223
1228 pdata->irq_base = status; 1224 pdata->irq_base = status;
1229 pdata->irq_end = pdata->irq_base + nr_irqs; 1225 pdata->irq_end = pdata->irq_base + nr_irqs;
1230 1226 irq_domain_add_legacy(node, nr_irqs, pdata->irq_base, 0,
1231#ifdef CONFIG_IRQ_DOMAIN 1227 &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 1228
1239 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { 1229 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
1240 dev_dbg(&client->dev, "can't talk I2C?\n"); 1230 dev_dbg(&client->dev, "can't talk I2C?\n");
@@ -1315,11 +1305,10 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1315 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); 1305 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
1316 } 1306 }
1317 1307
1318#ifdef CONFIG_OF_DEVICE 1308 status = -ENODEV;
1319 if (node) 1309 if (node)
1320 status = of_platform_populate(node, NULL, NULL, &client->dev); 1310 status = of_platform_populate(node, NULL, NULL, &client->dev);
1321 else 1311 if (status)
1322#endif
1323 status = add_children(pdata, id->driver_data); 1312 status = add_children(pdata, id->driver_data);
1324 1313
1325fail: 1314fail: