aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
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/gpio
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/gpio')
-rw-r--r--drivers/gpio/gpio-mpc8xxx.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index 5cd04b65c556..e6568c19c939 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);