Skip to content

Commit 99a0d9f

Browse files
committed
Merge tag 'gpio-v5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v5.5 kernel cycle Core changes: - Expose pull up/down flags for the GPIO character device to userspace. After clear input from the RaspberryPi and Beagle communities, it has been established that prototyping, industrial automation and make communities strongly need this feature, and as we want people to use the character device, we have implemented the simple pull up/down interface for GPIO lines. This means we can specify that a (chip-specific) pull up/down resistor can be enabled, but does not offer fine-grained control such as cases where the resistance of the same pull resistor can be controlled (yet). - Introduce devm_fwnode_gpiod_get_index() and start to phase out the old symbol devm_fwnode_get_index_gpiod_from_child(). - A bit of documentation clean-up work. - Introduce a define for GPIO line directions and deploy it in all GPIO drivers in the drivers/gpio directory. - Add a special callback to populate pin ranges when cooperating with the pin control subsystem and registering ranges as part of adding a gpiolib driver and a gpio_irq_chip driver at the same time. This is also deployed in the Intel Merrifield driver. New drivers: - RDA Micro GPIO controller. - XGS-iproc GPIO driver. Driver improvements: - Wake event and debounce support on the Tegra 186 driver. - Finalize the Aspeed SGPIO driver. - MPC8xxx uses a normal IRQ handler rather than a chained handler" * tag 'gpio-v5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (64 commits) gpio: Add TODO item for regmap helper Documentation: gpio: driver.rst: Fix warnings gpio: of: Fix bogus reference to gpiod_get_count() gpiolib: Grammar s/manager/managed/ gpio: lynxpoint: Setup correct IRQ handlers MAINTAINERS: Replace my email by one @kernel.org gpiolib: acpi: Make acpi_gpiochip_alloc_event always return AE_OK gpio/mpc8xxx: fix qoriq GPIO reading gpio: mpc8xxx: Don't overwrite default irq_set_type callback gpiolib: acpi: Print pin number on acpi_gpiochip_alloc_event errors gpiolib: fix coding style in gpiod_hog() drm/bridge: ti-tfp410: switch to using fwnode_gpiod_get_index() gpio: merrifield: Pass irqchip when adding gpiochip gpio: merrifield: Add GPIO <-> pin mapping ranges via callback gpiolib: Introduce ->add_pin_ranges() callback gpio: mmio: remove untrue leftover comment gpio: em: Use platform_get_irq() to obtain interrupts gpio: tegra186: Add debounce support gpio: tegra186: Program interrupt route mapping gpio: tegra186: Derive register offsets from bank/port ...
2 parents 3732391 + 41c4616 commit 99a0d9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1849
-598
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/brcm,xgs-iproc-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom XGS iProc GPIO controller
8+
9+
maintainers:
10+
- Chris Packham <[email protected]>
11+
12+
description: |
13+
This controller is the Chip Common A GPIO present on a number of Broadcom
14+
switch ASICs with integrated SoCs.
15+
16+
properties:
17+
compatible:
18+
const: brcm,iproc-gpio-cca
19+
20+
reg:
21+
items:
22+
- description: the I/O address containing the GPIO controller
23+
registers.
24+
- description: the I/O address containing the Chip Common A interrupt
25+
registers.
26+
27+
gpio-controller: true
28+
29+
'#gpio-cells':
30+
const: 2
31+
32+
ngpios:
33+
minimum: 0
34+
maximum: 32
35+
36+
interrupt-controller: true
37+
38+
'#interrupt-cells':
39+
const: 2
40+
41+
interrupts:
42+
maxItems: 1
43+
44+
required:
45+
- compatible
46+
- reg
47+
- "#gpio-cells"
48+
- gpio-controller
49+
50+
dependencies:
51+
interrupt-controller: [ interrupts ]
52+
53+
examples:
54+
- |
55+
#include <dt-bindings/interrupt-controller/irq.h>
56+
#include <dt-bindings/interrupt-controller/arm-gic.h>
57+
gpio@18000060 {
58+
compatible = "brcm,iproc-gpio-cca";
59+
#gpio-cells = <2>;
60+
reg = <0x18000060 0x50>,
61+
<0x18000000 0x50>;
62+
ngpios = <12>;
63+
gpio-controller;
64+
interrupt-controller;
65+
#interrupt-cells = <2>;
66+
interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
67+
};
68+
69+
70+
...
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/gpio-rda.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: RDA Micro GPIO controller
8+
9+
maintainers:
10+
- Manivannan Sadhasivam <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: rda,8810pl-gpio
15+
16+
reg:
17+
maxItems: 1
18+
19+
gpio-controller: true
20+
21+
"#gpio-cells":
22+
const: 2
23+
24+
ngpios:
25+
description:
26+
Number of available gpios in a bank.
27+
minimum: 1
28+
maximum: 32
29+
30+
interrupt-controller: true
31+
32+
"#interrupt-cells":
33+
const: 2
34+
35+
interrupts:
36+
maxItems: 1
37+
38+
required:
39+
- compatible
40+
- reg
41+
- gpio-controller
42+
- "#gpio-cells"
43+
- ngpios
44+
- interrupt-controller
45+
- "#interrupt-cells"
46+
- interrupts
47+
48+
additionalProperties: false
49+
50+
...

Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required Properties:
88
- "renesas,gpio-r8a7745": for R8A7745 (RZ/G1E) compatible GPIO controller.
99
- "renesas,gpio-r8a77470": for R8A77470 (RZ/G1C) compatible GPIO controller.
1010
- "renesas,gpio-r8a774a1": for R8A774A1 (RZ/G2M) compatible GPIO controller.
11+
- "renesas,gpio-r8a774b1": for R8A774B1 (RZ/G2N) compatible GPIO controller.
1112
- "renesas,gpio-r8a774c0": for R8A774C0 (RZ/G2E) compatible GPIO controller.
1213
- "renesas,gpio-r8a7778": for R8A7778 (R-Car M1) compatible GPIO controller.
1314
- "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.

Documentation/driver-api/bt8xxgpio.rst renamed to Documentation/driver-api/gpio/bt8xxgpio.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
A driver for a selfmade cheap BT8xx based PCI GPIO-card (bt8xxgpio)
33
===================================================================
44

5-
For advanced documentation, see http://www.bu3sch.de/btgpio.php
5+
For advanced documentation, see https://bues.ch/cms/unmaintained/btgpio.html
66

77
A generic digital 24-port PCI GPIO card can be built out of an ordinary
88
Brooktree bt848, bt849, bt878 or bt879 based analog TV tuner card. The

Documentation/driver-api/gpio/driver.rst

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GPIO Driver Interface
55
This document serves as a guide for writers of GPIO chip drivers.
66

77
Each GPIO controller driver needs to include the following header, which defines
8-
the structures used to define a GPIO driver:
8+
the structures used to define a GPIO driver::
99

1010
#include <linux/gpio/driver.h>
1111

@@ -398,12 +398,15 @@ provided. A big portion of overhead code will be managed by gpiolib,
398398
under the assumption that your interrupts are 1-to-1-mapped to the
399399
GPIO line index:
400400

401-
GPIO line offset Hardware IRQ
402-
0 0
403-
1 1
404-
2 2
405-
... ...
406-
ngpio-1 ngpio-1
401+
.. csv-table::
402+
:header: GPIO line offset, Hardware IRQ
403+
404+
0,0
405+
1,1
406+
2,2
407+
...,...
408+
ngpio-1, ngpio-1
409+
407410

408411
If some GPIO lines do not have corresponding IRQs, the bitmask valid_mask
409412
and the flag need_valid_mask in gpio_irq_chip can be used to mask off some
@@ -413,7 +416,9 @@ The preferred way to set up the helpers is to fill in the
413416
struct gpio_irq_chip inside struct gpio_chip before adding the gpio_chip.
414417
If you do this, the additional irq_chip will be set up by gpiolib at the
415418
same time as setting up the rest of the GPIO functionality. The following
416-
is a typical example of a cascaded interrupt handler using gpio_irq_chip:
419+
is a typical example of a cascaded interrupt handler using gpio_irq_chip::
420+
421+
.. code-block:: c
417422
418423
/* Typical state container with dynamic irqchip */
419424
struct my_gpio {
@@ -448,7 +453,9 @@ is a typical example of a cascaded interrupt handler using gpio_irq_chip:
448453
return devm_gpiochip_add_data(dev, &g->gc, g);
449454
450455
The helper support using hierarchical interrupt controllers as well.
451-
In this case the typical set-up will look like this:
456+
In this case the typical set-up will look like this::
457+
458+
.. code-block:: c
452459
453460
/* Typical state container with dynamic irqchip */
454461
struct my_gpio {

Documentation/driver-api/gpio/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Contents:
1313
board
1414
drivers-on-gpio
1515
legacy
16+
bt8xxgpio
1617

1718
Core
1819
====

Documentation/driver-api/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ available subsections can be seen below.
7070
fpga/index
7171
acpi/index
7272
backlight/lp855x-driver.rst
73-
bt8xxgpio
7473
connector
7574
console
7675
dcdbas

MAINTAINERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,9 +2183,11 @@ L: [email protected] (moderated for non-subscribers)
21832183
S: Maintained
21842184
F: arch/arm/boot/dts/rda8810pl-*
21852185
F: drivers/clocksource/timer-rda.c
2186+
F: drivers/gpio/gpio-rda.c
21862187
F: drivers/irqchip/irq-rda-intc.c
21872188
F: drivers/tty/serial/rda-uart.c
21882189
F: Documentation/devicetree/bindings/arm/rda.yaml
2190+
F: Documentation/devicetree/bindings/gpio/gpio-rda.yaml
21892191
F: Documentation/devicetree/bindings/interrupt-controller/rda,8810pl-intc.txt
21902192
F: Documentation/devicetree/bindings/serial/rda,8810pl-uart.txt
21912193
F: Documentation/devicetree/bindings/timer/rda,8810pl-timer.txt
@@ -8329,7 +8331,7 @@ F: Documentation/fb/intelfb.rst
83298331
F: drivers/video/fbdev/intelfb/
83308332

83318333
INTEL GPIO DRIVERS
8332-
M: Andy Shevchenko <[email protected]>
8334+
M: Andy Shevchenko <[email protected]>
83338335
83348336
S: Maintained
83358337
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git
@@ -8483,7 +8485,7 @@ F: arch/x86/include/asm/intel_pmc_ipc.h
84838485
F: arch/x86/include/asm/intel_punit_ipc.h
84848486

84858487
INTEL PMIC GPIO DRIVERS
8486-
M: Andy Shevchenko <[email protected]>
8488+
M: Andy Shevchenko <[email protected]>
84878489
S: Maintained
84888490
T: git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git
84898491
F: drivers/gpio/gpio-*cove.c

drivers/ata/ahci_imx.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <linux/platform_device.h>
1212
#include <linux/regmap.h>
1313
#include <linux/ahci_platform.h>
14+
#include <linux/gpio/consumer.h>
1415
#include <linux/of_device.h>
15-
#include <linux/of_gpio.h>
1616
#include <linux/mfd/syscon.h>
1717
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
1818
#include <linux/libata.h>
@@ -100,7 +100,7 @@ struct imx_ahci_priv {
100100
struct clk *phy_pclk0;
101101
struct clk *phy_pclk1;
102102
void __iomem *phy_base;
103-
int clkreq_gpio;
103+
struct gpio_desc *clkreq_gpiod;
104104
struct regmap *gpr;
105105
bool no_device;
106106
bool first_time;
@@ -980,7 +980,6 @@ static struct scsi_host_template ahci_platform_sht = {
980980

981981
static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
982982
{
983-
int ret;
984983
struct resource *phy_res;
985984
struct platform_device *pdev = imxpriv->ahci_pdev;
986985
struct device_node *np = dev->of_node;
@@ -1033,20 +1032,12 @@ static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
10331032
}
10341033

10351034
/* Fetch GPIO, then enable the external OSC */
1036-
imxpriv->clkreq_gpio = of_get_named_gpio(np, "clkreq-gpio", 0);
1037-
if (gpio_is_valid(imxpriv->clkreq_gpio)) {
1038-
ret = devm_gpio_request_one(dev, imxpriv->clkreq_gpio,
1039-
GPIOF_OUT_INIT_LOW,
1040-
"SATA CLKREQ");
1041-
if (ret == -EBUSY) {
1042-
dev_info(dev, "clkreq had been initialized.\n");
1043-
} else if (ret) {
1044-
dev_err(dev, "%d unable to get clkreq.\n", ret);
1045-
return ret;
1046-
}
1047-
} else if (imxpriv->clkreq_gpio == -EPROBE_DEFER) {
1048-
return imxpriv->clkreq_gpio;
1049-
}
1035+
imxpriv->clkreq_gpiod = devm_gpiod_get_optional(dev, "clkreq",
1036+
GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
1037+
if (IS_ERR(imxpriv->clkreq_gpiod))
1038+
return PTR_ERR(imxpriv->clkreq_gpiod);
1039+
if (imxpriv->clkreq_gpiod)
1040+
gpiod_set_consumer_name(imxpriv->clkreq_gpiod, "SATA CLKREQ");
10501041

10511042
return 0;
10521043
}

drivers/gpio/Kconfig

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ config GPIO_ASPEED
120120
help
121121
Say Y here to support Aspeed AST2400 and AST2500 GPIO controllers.
122122

123+
config GPIO_ASPEED_SGPIO
124+
bool "Aspeed SGPIO support"
125+
depends on (ARCH_ASPEED || COMPILE_TEST) && OF_GPIO
126+
select GPIO_GENERIC
127+
select GPIOLIB_IRQCHIP
128+
help
129+
Say Y here to support Aspeed AST2500 SGPIO functionality.
130+
123131
config GPIO_ATH79
124132
tristate "Atheros AR71XX/AR724X/AR913X GPIO support"
125133
default y if ATH79
@@ -147,6 +155,15 @@ config GPIO_BCM_KONA
147155
help
148156
Turn on GPIO support for Broadcom "Kona" chips.
149157

158+
config GPIO_BCM_XGS_IPROC
159+
tristate "BRCM XGS iProc GPIO support"
160+
depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST)
161+
select GPIO_GENERIC
162+
select GPIOLIB_IRQCHIP
163+
default ARCH_BCM_IPROC
164+
help
165+
Say yes here to enable GPIO support for Broadcom XGS iProc SoCs.
166+
150167
config GPIO_BRCMSTB
151168
tristate "BRCMSTB GPIO support"
152169
default y if (ARCH_BRCMSTB || BMIPS_GENERIC)
@@ -435,6 +452,15 @@ config GPIO_RCAR
435452
help
436453
Say yes here to support GPIO on Renesas R-Car SoCs.
437454

455+
config GPIO_RDA
456+
bool "RDA Micro GPIO controller support"
457+
depends on ARCH_RDA || COMPILE_TEST
458+
depends on OF_GPIO
459+
select GPIO_GENERIC
460+
select GPIOLIB_IRQCHIP
461+
help
462+
Say Y here to support RDA Micro GPIO controller.
463+
438464
config GPIO_REG
439465
bool
440466
help
@@ -531,6 +557,7 @@ config GPIO_TEGRA186
531557
depends on ARCH_TEGRA_186_SOC || COMPILE_TEST
532558
depends on OF_GPIO
533559
select GPIOLIB_IRQCHIP
560+
select IRQ_DOMAIN_HIERARCHY
534561
help
535562
Say yes here to support GPIO pins on NVIDIA Tegra186 SoCs.
536563

@@ -1320,7 +1347,7 @@ config GPIO_BT8XX
13201347
The card needs to be physically altered for using it as a
13211348
GPIO card. For more information on how to build a GPIO card
13221349
from a BT8xx TV card, see the documentation file at
1323-
Documentation/driver-api/bt8xxgpio.rst
1350+
Documentation/driver-api/gpio/bt8xxgpio.rst
13241351

13251352
If unsure, say N.
13261353

0 commit comments

Comments
 (0)