aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-03-05 11:57:58 -0500
committerArnd Bergmann <arnd@arndb.de>2012-03-05 11:58:11 -0500
commit3a70b7e05f62d4e1bfd5744368ea1fd855b6e03c (patch)
tree0a74b982ab63dd20433bfe6abefdc8dd1b7336b4 /drivers
parent7cb7f82611dddb4b471d42d0fad645dd0dc3f360 (diff)
parent280ad7fda5f95211857fda38960f2b6fdf6edd3e (diff)
Merge branch 'depends/irqdomain' into next/drivers
This is needed in order for the tegra/soc-drivers branch to work. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-mpc8xxx.c30
-rw-r--r--drivers/mfd/Kconfig1
-rw-r--r--drivers/mfd/twl-core.c21
-rw-r--r--drivers/net/phy/mdio-gpio.c4
-rw-r--r--drivers/of/platform.c4
5 files changed, 16 insertions, 44 deletions
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 5cd04b65c55..e6568c19c93 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -37,7 +37,7 @@ struct mpc8xxx_gpio_chip {
37 * open drain mode safely 37 * open drain mode safely
38 */ 38 */
39 u32 data; 39 u32 data;
40 struct irq_host *irq; 40 struct irq_domain *irq;
41 void *of_dev_id_data; 41 void *of_dev_id_data;
42}; 42};
43 43
@@ -281,7 +281,7 @@ static struct irq_chip mpc8xxx_irq_chip = {
281 .irq_set_type = mpc8xxx_irq_set_type, 281 .irq_set_type = mpc8xxx_irq_set_type,
282}; 282};
283 283
284static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq, 284static int mpc8xxx_gpio_irq_map(struct irq_domain *h, unsigned int virq,
285 irq_hw_number_t hw) 285 irq_hw_number_t hw)
286{ 286{
287 struct mpc8xxx_gpio_chip *mpc8xxx_gc = h->host_data; 287 struct mpc8xxx_gpio_chip *mpc8xxx_gc = h->host_data;
@@ -296,24 +296,9 @@ static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq,
296 return 0; 296 return 0;
297} 297}
298 298
299static int mpc8xxx_gpio_irq_xlate(struct irq_host *h, struct device_node *ct, 299static struct irq_domain_ops mpc8xxx_gpio_irq_ops = {
300 const u32 *intspec, unsigned int intsize,
301 irq_hw_number_t *out_hwirq,
302 unsigned int *out_flags)
303
304{
305 /* interrupt sense values coming from the device tree equal either
306 * EDGE_FALLING or EDGE_BOTH
307 */
308 *out_hwirq = intspec[0];
309 *out_flags = intspec[1];
310
311 return 0;
312}
313
314static struct irq_host_ops mpc8xxx_gpio_irq_ops = {
315 .map = mpc8xxx_gpio_irq_map, 300 .map = mpc8xxx_gpio_irq_map,
316 .xlate = mpc8xxx_gpio_irq_xlate, 301 .xlate = irq_domain_xlate_twocell,
317}; 302};
318 303
319static struct of_device_id mpc8xxx_gpio_ids[] __initdata = { 304static struct of_device_id mpc8xxx_gpio_ids[] __initdata = {
@@ -364,9 +349,8 @@ static void __init mpc8xxx_add_controller(struct device_node *np)
364 if (hwirq == NO_IRQ) 349 if (hwirq == NO_IRQ)
365 goto skip_irq; 350 goto skip_irq;
366 351
367 mpc8xxx_gc->irq = 352 mpc8xxx_gc->irq = irq_domain_add_linear(np, MPC8XXX_GPIO_PINS,
368 irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, MPC8XXX_GPIO_PINS, 353 &mpc8xxx_gpio_irq_ops, mpc8xxx_gc);
369 &mpc8xxx_gpio_irq_ops, MPC8XXX_GPIO_PINS);
370 if (!mpc8xxx_gc->irq) 354 if (!mpc8xxx_gc->irq)
371 goto skip_irq; 355 goto skip_irq;
372 356
@@ -374,8 +358,6 @@ static void __init mpc8xxx_add_controller(struct device_node *np)
374 if (id) 358 if (id)
375 mpc8xxx_gc->of_dev_id_data = id->data; 359 mpc8xxx_gc->of_dev_id_data = id->data;
376 360
377 mpc8xxx_gc->irq->host_data = mpc8xxx_gc;
378
379 /* ack and mask all irqs */ 361 /* ack and mask all irqs */
380 out_be32(mm_gc->regs + GPIO_IER, 0xffffffff); 362 out_be32(mm_gc->regs + GPIO_IER, 0xffffffff);
381 out_be32(mm_gc->regs + GPIO_IMR, 0); 363 out_be32(mm_gc->regs + GPIO_IMR, 0);
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index f147395bac9..1489c3540f9 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 8ce3959c691..4970d43952d 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:
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 50e8e5e7446..7189adf54bd 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -255,13 +255,13 @@ static inline int __init mdio_ofgpio_init(void)
255 return platform_driver_register(&mdio_ofgpio_driver); 255 return platform_driver_register(&mdio_ofgpio_driver);
256} 256}
257 257
258static inline void __exit mdio_ofgpio_exit(void) 258static inline void mdio_ofgpio_exit(void)
259{ 259{
260 platform_driver_unregister(&mdio_ofgpio_driver); 260 platform_driver_unregister(&mdio_ofgpio_driver);
261} 261}
262#else 262#else
263static inline int __init mdio_ofgpio_init(void) { return 0; } 263static inline int __init mdio_ofgpio_init(void) { return 0; }
264static inline void __exit mdio_ofgpio_exit(void) { } 264static inline void mdio_ofgpio_exit(void) { }
265#endif /* CONFIG_OF_GPIO */ 265#endif /* CONFIG_OF_GPIO */
266 266
267static struct platform_driver mdio_gpio_driver = { 267static struct platform_driver mdio_gpio_driver = {
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index cae9477a6ed..343ad29e211 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
55#include <asm/dcr.h> 55#include <asm/dcr.h>
56#endif 56#endif
57 57
58#if !defined(CONFIG_SPARC) 58#ifdef CONFIG_OF_ADDRESS
59/* 59/*
60 * The following routines scan a subtree and registers a device for 60 * The following routines scan a subtree and registers a device for
61 * each applicable node. 61 * each applicable node.
@@ -462,4 +462,4 @@ int of_platform_populate(struct device_node *root,
462 of_node_put(root); 462 of_node_put(root);
463 return rc; 463 return rc;
464} 464}
465#endif /* !CONFIG_SPARC */ 465#endif /* CONFIG_OF_ADDRESS */