aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 13:27:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 13:27:19 -0400
commitc207f3a43194e108dda43dc9a1ce507335cff6b9 (patch)
tree55880f8301e8546b1908f69947d0d41aaa044814 /drivers/mfd
parentc7c66c0cb0c77b1a8edf09bca57d922312d58030 (diff)
parente7cc3aca0f6a36b018934264ee20bee45dc13e29 (diff)
Merge tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6
Pull irq_domain support for all architectures from Grant Likely: "Generialize powerpc's irq_host as irq_domain This branch takes the PowerPC irq_host infrastructure (reverse mapping from Linux IRQ numbers to hardware irq numbering), generalizes it, renames it to irq_domain, and makes it available to all architectures. Originally the plan has been to create an all-new irq_domain implementation which addresses some of the powerpc shortcomings such as not handling 1:1 mappings well, but doing that proved to be far more difficult and invasive than generalizing the working code and refactoring it in-place. So, this branch rips out the 'new' irq_domain and replaces it with the modified powerpc version (in a fully bisectable way of course). It converts all users over to the new API and makes irq_domain selectable on any architecture. No architecture is forced to enable irq_domain, but the infrastructure is required for doing OpenFirmware style irq translations. It will even work on SPARC even though SPARC has it's own mechanism for translating irqs at boot time. MIPS, microblaze, embedded x86 and c6x are converted too. The resulting irq_domain code is probably still too verbose and can be optimized more, but that can be done incrementally and is a task for follow-on patches." * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6: (31 commits) dt: fix twl4030 for non-dt compile on x86 mfd: twl-core: Add IRQ_DOMAIN dependency devicetree: Add empty of_platform_populate() for !CONFIG_OF_ADDRESS (sparc) irq_domain: Centralize definition of irq_dispose_mapping() irq_domain/mips: Allow irq_domain on MIPS irq_domain/x86: Convert x86 (embedded) to use common irq_domain ppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c irq_domain/microblaze: Convert microblaze to use irq_domains irq_domain/powerpc: Replace custom xlate functions with library functions irq_domain/powerpc: constify irq_domain_ops irq_domain/c6x: Use library of xlate functions irq_domain/c6x: constify irq_domain structures irq_domain/c6x: Convert c6x to use generic irq_domain support. irq_domain: constify irq_domain_ops irq_domain: Create common xlate functions that device drivers can use irq_domain: Remove irq_domain_add_simple() irq_domain: Remove 'new' irq_domain in favour of the ppc one mfd: twl-core.c: Fix the number of interrupts managed by twl4030 of/address: add empty static inlines for !CONFIG_OF irq_domain: Add support for base irq and hwirq in legacy mappings ...
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/Kconfig1
-rw-r--r--drivers/mfd/twl-core.c22
2 files changed, 7 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..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: