.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/arch/arm/plat-pxa/gpio.c |
---|
3 | 4 | * |
---|
.. | .. |
---|
6 | 7 | * Author: Nicolas Pitre |
---|
7 | 8 | * Created: Jun 15, 2001 |
---|
8 | 9 | * Copyright: MontaVista Software Inc. |
---|
9 | | - * |
---|
10 | | - * This program is free software; you can redistribute it and/or modify |
---|
11 | | - * it under the terms of the GNU General Public License version 2 as |
---|
12 | | - * published by the Free Software Foundation. |
---|
13 | 10 | */ |
---|
14 | 11 | #include <linux/module.h> |
---|
15 | 12 | #include <linux/clk.h> |
---|
.. | .. |
---|
364 | 361 | pchip->chip.set = pxa_gpio_set; |
---|
365 | 362 | pchip->chip.to_irq = pxa_gpio_to_irq; |
---|
366 | 363 | pchip->chip.ngpio = ngpio; |
---|
367 | | - |
---|
368 | | - if (pxa_gpio_has_pinctrl()) { |
---|
369 | | - pchip->chip.request = gpiochip_generic_request; |
---|
370 | | - pchip->chip.free = gpiochip_generic_free; |
---|
371 | | - } |
---|
| 364 | + pchip->chip.request = gpiochip_generic_request; |
---|
| 365 | + pchip->chip.free = gpiochip_generic_free; |
---|
372 | 366 | |
---|
373 | 367 | #ifdef CONFIG_OF_GPIO |
---|
374 | 368 | pchip->chip.of_node = np; |
---|
.. | .. |
---|
577 | 571 | return 0; |
---|
578 | 572 | } |
---|
579 | 573 | |
---|
580 | | -const struct irq_domain_ops pxa_irq_domain_ops = { |
---|
| 574 | +static const struct irq_domain_ops pxa_irq_domain_ops = { |
---|
581 | 575 | .map = pxa_irq_domain_map, |
---|
582 | 576 | .xlate = irq_domain_xlate_twocell, |
---|
583 | 577 | }; |
---|
.. | .. |
---|
622 | 616 | { |
---|
623 | 617 | struct pxa_gpio_chip *pchip; |
---|
624 | 618 | struct pxa_gpio_bank *c; |
---|
625 | | - struct resource *res; |
---|
626 | 619 | struct clk *clk; |
---|
627 | 620 | struct pxa_gpio_platform_data *info; |
---|
628 | 621 | void __iomem *gpio_reg_base; |
---|
.. | .. |
---|
656 | 649 | if (!pchip->irqdomain) |
---|
657 | 650 | return -ENOMEM; |
---|
658 | 651 | |
---|
659 | | - irq0 = platform_get_irq_byname(pdev, "gpio0"); |
---|
660 | | - irq1 = platform_get_irq_byname(pdev, "gpio1"); |
---|
| 652 | + irq0 = platform_get_irq_byname_optional(pdev, "gpio0"); |
---|
| 653 | + irq1 = platform_get_irq_byname_optional(pdev, "gpio1"); |
---|
661 | 654 | irq_mux = platform_get_irq_byname(pdev, "gpio_mux"); |
---|
662 | 655 | if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0) |
---|
663 | 656 | || (irq_mux <= 0)) |
---|
.. | .. |
---|
665 | 658 | |
---|
666 | 659 | pchip->irq0 = irq0; |
---|
667 | 660 | pchip->irq1 = irq1; |
---|
668 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
669 | | - if (!res) |
---|
670 | | - return -EINVAL; |
---|
671 | | - gpio_reg_base = devm_ioremap(&pdev->dev, res->start, |
---|
672 | | - resource_size(res)); |
---|
673 | | - if (!gpio_reg_base) |
---|
674 | | - return -EINVAL; |
---|
| 661 | + |
---|
| 662 | + gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); |
---|
| 663 | + if (IS_ERR(gpio_reg_base)) |
---|
| 664 | + return PTR_ERR(gpio_reg_base); |
---|
675 | 665 | |
---|
676 | 666 | clk = clk_get(&pdev->dev, NULL); |
---|
677 | 667 | if (IS_ERR(clk)) { |
---|
.. | .. |
---|
816 | 806 | #define pxa_gpio_resume NULL |
---|
817 | 807 | #endif |
---|
818 | 808 | |
---|
819 | | -struct syscore_ops pxa_gpio_syscore_ops = { |
---|
| 809 | +static struct syscore_ops pxa_gpio_syscore_ops = { |
---|
820 | 810 | .suspend = pxa_gpio_suspend, |
---|
821 | 811 | .resume = pxa_gpio_resume, |
---|
822 | 812 | }; |
---|