| .. | .. |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 246 | 243 | switch (gpio_type) { |
|---|
| 247 | 244 | case PXA3XX_GPIO: |
|---|
| 248 | 245 | case MMP2_GPIO: |
|---|
| 246 | + case MMP_GPIO: |
|---|
| 249 | 247 | return false; |
|---|
| 250 | 248 | |
|---|
| 251 | 249 | default: |
|---|
| .. | .. |
|---|
| 364 | 362 | pchip->chip.set = pxa_gpio_set; |
|---|
| 365 | 363 | pchip->chip.to_irq = pxa_gpio_to_irq; |
|---|
| 366 | 364 | 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 | | - } |
|---|
| 365 | + pchip->chip.request = gpiochip_generic_request; |
|---|
| 366 | + pchip->chip.free = gpiochip_generic_free; |
|---|
| 372 | 367 | |
|---|
| 373 | 368 | #ifdef CONFIG_OF_GPIO |
|---|
| 374 | 369 | pchip->chip.of_node = np; |
|---|
| .. | .. |
|---|
| 577 | 572 | return 0; |
|---|
| 578 | 573 | } |
|---|
| 579 | 574 | |
|---|
| 580 | | -const struct irq_domain_ops pxa_irq_domain_ops = { |
|---|
| 575 | +static const struct irq_domain_ops pxa_irq_domain_ops = { |
|---|
| 581 | 576 | .map = pxa_irq_domain_map, |
|---|
| 582 | 577 | .xlate = irq_domain_xlate_twocell, |
|---|
| 583 | 578 | }; |
|---|
| .. | .. |
|---|
| 622 | 617 | { |
|---|
| 623 | 618 | struct pxa_gpio_chip *pchip; |
|---|
| 624 | 619 | struct pxa_gpio_bank *c; |
|---|
| 625 | | - struct resource *res; |
|---|
| 626 | 620 | struct clk *clk; |
|---|
| 627 | 621 | struct pxa_gpio_platform_data *info; |
|---|
| 628 | 622 | void __iomem *gpio_reg_base; |
|---|
| .. | .. |
|---|
| 656 | 650 | if (!pchip->irqdomain) |
|---|
| 657 | 651 | return -ENOMEM; |
|---|
| 658 | 652 | |
|---|
| 659 | | - irq0 = platform_get_irq_byname(pdev, "gpio0"); |
|---|
| 660 | | - irq1 = platform_get_irq_byname(pdev, "gpio1"); |
|---|
| 653 | + irq0 = platform_get_irq_byname_optional(pdev, "gpio0"); |
|---|
| 654 | + irq1 = platform_get_irq_byname_optional(pdev, "gpio1"); |
|---|
| 661 | 655 | irq_mux = platform_get_irq_byname(pdev, "gpio_mux"); |
|---|
| 662 | 656 | if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0) |
|---|
| 663 | 657 | || (irq_mux <= 0)) |
|---|
| .. | .. |
|---|
| 665 | 659 | |
|---|
| 666 | 660 | pchip->irq0 = irq0; |
|---|
| 667 | 661 | 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; |
|---|
| 662 | + |
|---|
| 663 | + gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 664 | + if (IS_ERR(gpio_reg_base)) |
|---|
| 665 | + return PTR_ERR(gpio_reg_base); |
|---|
| 675 | 666 | |
|---|
| 676 | 667 | clk = clk_get(&pdev->dev, NULL); |
|---|
| 677 | 668 | if (IS_ERR(clk)) { |
|---|
| .. | .. |
|---|
| 816 | 807 | #define pxa_gpio_resume NULL |
|---|
| 817 | 808 | #endif |
|---|
| 818 | 809 | |
|---|
| 819 | | -struct syscore_ops pxa_gpio_syscore_ops = { |
|---|
| 810 | +static struct syscore_ops pxa_gpio_syscore_ops = { |
|---|
| 820 | 811 | .suspend = pxa_gpio_suspend, |
|---|
| 821 | 812 | .resume = pxa_gpio_resume, |
|---|
| 822 | 813 | }; |
|---|