aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-pxa.c
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2013-04-09 10:27:50 -0400
committerHaojian Zhuang <haojian.zhuang@linaro.org>2013-04-10 22:00:34 -0400
commitf87311743eaf8597ddc045a2b5d9fe41f32ae87b (patch)
tree1f76a93833d3da1c7fc3fa2abef39a3d52819795 /drivers/gpio/gpio-pxa.c
parentb8f649f1f531914a30ecb420e7565ee04dccc2ad (diff)
ARM: mmp: add more compatible names in gpio driver
Since more driver names are added into platform id, do the same thing on compatible names for DT mode. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pxa.c')
-rw-r--r--drivers/gpio/gpio-pxa.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index a0905b20f48e..b80717e1ce5b 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -499,8 +499,13 @@ static int pxa_gpio_nums(struct platform_device *pdev)
499 499
500#ifdef CONFIG_OF 500#ifdef CONFIG_OF
501static struct of_device_id pxa_gpio_dt_ids[] = { 501static struct of_device_id pxa_gpio_dt_ids[] = {
502 { .compatible = "mrvl,pxa-gpio" }, 502 { .compatible = "intel,pxa25x-gpio", .data = &pxa25x_id, },
503 { .compatible = "mrvl,mmp-gpio", .data = (void *)MMP_GPIO }, 503 { .compatible = "intel,pxa26x-gpio", .data = &pxa26x_id, },
504 { .compatible = "intel,pxa27x-gpio", .data = &pxa27x_id, },
505 { .compatible = "intel,pxa3xx-gpio", .data = &pxa3xx_id, },
506 { .compatible = "marvell,pxa93x-gpio", .data = &pxa93x_id, },
507 { .compatible = "marvell,mmp-gpio", .data = &mmp_id, },
508 { .compatible = "marvell,mmp2-gpio", .data = &mmp2_id, },
504 {} 509 {}
505}; 510};
506 511
@@ -520,16 +525,18 @@ const struct irq_domain_ops pxa_irq_domain_ops = {
520 525
521static int pxa_gpio_probe_dt(struct platform_device *pdev) 526static int pxa_gpio_probe_dt(struct platform_device *pdev)
522{ 527{
523 int ret, nr_banks, nr_gpios; 528 int ret, nr_gpios;
524 struct device_node *prev, *next, *np = pdev->dev.of_node; 529 struct device_node *prev, *next, *np = pdev->dev.of_node;
525 const struct of_device_id *of_id = 530 const struct of_device_id *of_id =
526 of_match_device(pxa_gpio_dt_ids, &pdev->dev); 531 of_match_device(pxa_gpio_dt_ids, &pdev->dev);
532 const struct pxa_gpio_id *gpio_id;
527 533
528 if (!of_id) { 534 if (!of_id || !of_id->data) {
529 dev_err(&pdev->dev, "Failed to find gpio controller\n"); 535 dev_err(&pdev->dev, "Failed to find gpio controller\n");
530 return -EFAULT; 536 return -EFAULT;
531 } 537 }
532 gpio_type = (int)of_id->data; 538 gpio_id = of_id->data;
539 gpio_type = gpio_id->type;
533 540
534 next = of_get_next_child(np, NULL); 541 next = of_get_next_child(np, NULL);
535 prev = next; 542 prev = next;
@@ -538,14 +545,8 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev)
538 ret = -EINVAL; 545 ret = -EINVAL;
539 goto err; 546 goto err;
540 } 547 }
541 for (nr_banks = 1; ; nr_banks++) {
542 next = of_get_next_child(np, prev);
543 if (!next)
544 break;
545 prev = next;
546 }
547 of_node_put(prev); 548 of_node_put(prev);
548 nr_gpios = nr_banks << 5; 549 nr_gpios = gpio_id->gpio_nums;
549 pxa_last_gpio = nr_gpios - 1; 550 pxa_last_gpio = nr_gpios - 1;
550 551
551 irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0); 552 irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0);