diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-04-09 06:12:04 -0400 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-04-10 22:00:05 -0400 |
commit | b8f649f1f531914a30ecb420e7565ee04dccc2ad (patch) | |
tree | 42b2bc905fce1c892511ff81a250d7330b33a4ed /drivers/gpio/gpio-pxa.c | |
parent | 2cab0292285ce3180224c130d2fb1104aee44ff1 (diff) |
ARM: pxa: move PXA_GPIO_TO_IRQ macro
Since PXA_GPIO_TO_IRQ() & MMP_GPIO_TO_IRQ() macro are depended on
arch code, move them from gpio driver to platform driver instead.
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.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index fe74b0cc2bcb..a0905b20f48e 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -574,19 +574,18 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
574 | int gpio, irq, ret, use_of = 0; | 574 | int gpio, irq, ret, use_of = 0; |
575 | int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; | 575 | int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; |
576 | 576 | ||
577 | ret = pxa_gpio_probe_dt(pdev); | 577 | info = dev_get_platdata(&pdev->dev); |
578 | if (ret < 0) { | 578 | if (info) { |
579 | irq_base = info->irq_base; | ||
580 | if (irq_base <= 0) | ||
581 | return -EINVAL; | ||
579 | pxa_last_gpio = pxa_gpio_nums(pdev); | 582 | pxa_last_gpio = pxa_gpio_nums(pdev); |
580 | #ifdef CONFIG_ARCH_PXA | ||
581 | if (gpio_is_pxa_type(gpio_type)) | ||
582 | irq_base = PXA_GPIO_TO_IRQ(0); | ||
583 | #endif | ||
584 | #ifdef CONFIG_ARCH_MMP | ||
585 | if (gpio_is_mmp_type(gpio_type)) | ||
586 | irq_base = MMP_GPIO_TO_IRQ(0); | ||
587 | #endif | ||
588 | } else { | 583 | } else { |
584 | irq_base = 0; | ||
589 | use_of = 1; | 585 | use_of = 1; |
586 | ret = pxa_gpio_probe_dt(pdev); | ||
587 | if (ret < 0) | ||
588 | return -EINVAL; | ||
590 | } | 589 | } |
591 | 590 | ||
592 | if (!pxa_last_gpio) | 591 | if (!pxa_last_gpio) |
@@ -623,7 +622,6 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
623 | } | 622 | } |
624 | 623 | ||
625 | /* Initialize GPIO chips */ | 624 | /* Initialize GPIO chips */ |
626 | info = dev_get_platdata(&pdev->dev); | ||
627 | pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL); | 625 | pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL); |
628 | 626 | ||
629 | /* clear all GPIO edge detects */ | 627 | /* clear all GPIO edge detects */ |