Skip to content

Commit fa889d8

Browse files
committed
Merge tag 'gpio-v5.6-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.6 kernel cycle. This is a pretty calm cycle so far, nothing special going on really. Some more changes will come in from the irqchip and pin control trees. I also deleted an orphan include file for FMC that was dangling since subsystem was removed. Core changes: - Document the usecases for the kernelspace vs userspace handling of GPIOs. - Handle MSI (message signalled interrupts) properly in the core hierarchical irqdomain code. - Fix a rare race condition while initializing the descriptor array. New drivers: - Xylon LogiCVC GPIO driver. - WDC934x GPIO controller driver. Driver improvements: - Implemented suspend/resume in the Tegra driver. - MPC8xx edge detection fixup. - Properly convert ThunderX to use hierarchical irqdomain with GPIOLIB_IRQCHIP on top of the revert of the previous buggy switchover. This time it works (hopefully). Misc: - Drop a FMC remnant file <linux/ipmi-fru.h> - A slew of fixes" * tag 'gpio-v5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (48 commits) MAINTAINERS: Replace Tien Hock Loh as Altera PIO maintainer gpiolib: hold gpio devices lock until ->descs array is initialised gpio: aspeed-sgpio: fixed typos gpio: mvebu: clear irq in edge cause register before unmask edge irq gpiolib: Lower verbosity when allocating hierarchy irq gpiolib: Remove duplicated function gpio_do_set_config() gpio: Fix the no return statement warning gpio: wcd934x: Add support to wcd934x gpio controller gpiolib: remove set but not used variable 'config' gpio: vx855: fixed a typo gpio: mockup: sort headers alphabetically gpio: mockup: update the license tag gpio: Remove the unused flags gpiolib: Set lockdep class for hierarchical irq domains gpio: thunderx: Switch to GPIOLIB_IRQCHIP gpiolib: Add the support for the msi parent domain gpiolib: Add support for the irqdomain which doesn't use irq_fwspec as arg gpio: Add use guidance documentation dt-bindings: gpio: wcd934x: Add bindings for gpio gpio: altera: change to platform_get_irq_optional to avoid false-positive error ...
2 parents b3a6082 + 0282c72 commit fa889d8

38 files changed

+814
-413
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/qcom,wcd934x-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: WCD9340/WCD9341 GPIO controller
8+
9+
maintainers:
10+
- Srinivas Kandagatla <[email protected]>
11+
12+
description: |
13+
Qualcomm Technologies Inc WCD9340/WCD9341 Audio Codec has integrated
14+
gpio controller to control 5 gpios on the chip.
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- qcom,wcd9340-gpio
20+
- qcom,wcd9341-gpio
21+
22+
reg:
23+
maxItems: 1
24+
25+
gpio-controller: true
26+
27+
'#gpio-cells':
28+
const: 2
29+
30+
required:
31+
- compatible
32+
- reg
33+
- gpio-controller
34+
- "#gpio-cells"
35+
36+
additionalProperties: false
37+
38+
examples:
39+
- |
40+
wcdgpio: gpio@42 {
41+
compatible = "qcom,wcd9340-gpio";
42+
reg = <0x042 0x2>;
43+
gpio-controller;
44+
#gpio-cells = <2>;
45+
};
46+
47+
...

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Required Properties:
1818
- "renesas,gpio-r8a7793": for R8A7793 (R-Car M2-N) compatible GPIO controller.
1919
- "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
2020
- "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
21-
- "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
21+
- "renesas,gpio-r8a7796": for R8A77960 (R-Car M3-W) compatible GPIO controller.
22+
- "renesas,gpio-r8a77961": for R8A77961 (R-Car M3-W+) compatible GPIO controller.
2223
- "renesas,gpio-r8a77965": for R8A77965 (R-Car M3-N) compatible GPIO controller.
2324
- "renesas,gpio-r8a77970": for R8A77970 (R-Car V3M) compatible GPIO controller.
2425
- "renesas,gpio-r8a77980": for R8A77980 (R-Car V3H) compatible GPIO controller.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
# Copyright 2019 Bootlin
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/gpio/xylon,logicvc-gpio.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: Xylon LogiCVC GPIO controller
9+
10+
maintainers:
11+
- Paul Kocialkowski <[email protected]>
12+
13+
description: |
14+
The LogiCVC GPIO describes the GPIO block included in the LogiCVC display
15+
controller. These are meant to be used for controlling display-related
16+
signals.
17+
18+
The controller exposes GPIOs from the display and power control registers,
19+
which are mapped by the driver as follows:
20+
- GPIO[4:0] (display control) mapped to index 0-4
21+
- EN_BLIGHT (power control) mapped to index 5
22+
- EN_VDD (power control) mapped to index 6
23+
- EN_VEE (power control) mapped to index 7
24+
- V_EN (power control) mapped to index 8
25+
26+
properties:
27+
$nodename:
28+
pattern: "^gpio@[0-9a-f]+$"
29+
30+
compatible:
31+
enum:
32+
- xylon,logicvc-3.02.a-gpio
33+
34+
reg:
35+
maxItems: 1
36+
37+
"#gpio-cells":
38+
const: 2
39+
40+
gpio-controller: true
41+
42+
gpio-line-names:
43+
minItems: 1
44+
maxItems: 9
45+
46+
required:
47+
- compatible
48+
- reg
49+
- "#gpio-cells"
50+
- gpio-controller
51+
52+
examples:
53+
- |
54+
logicvc: logicvc@43c00000 {
55+
compatible = "xylon,logicvc-3.02.a", "syscon", "simple-mfd";
56+
reg = <0x43c00000 0x6000>;
57+
58+
#address-cells = <1>;
59+
#size-cells = <1>;
60+
61+
logicvc_gpio: gpio@40 {
62+
compatible = "xylon,logicvc-3.02.a-gpio";
63+
reg = <0x40 0x40>;
64+
gpio-controller;
65+
#gpio-cells = <2>;
66+
gpio-line-names = "GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO4",
67+
"EN_BLIGHT", "EN_VDD", "EN_VEE", "V_EN";
68+
};
69+
};
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+
# Copyright 2019 Bootlin
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/mfd/xylon,logicvc.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: Xylon LogiCVC multi-function device
9+
10+
maintainers:
11+
- Paul Kocialkowski <[email protected]>
12+
13+
description: |
14+
The LogiCVC is a display controller that also contains a GPIO controller.
15+
As a result, a multi-function device is exposed as parent of the display
16+
and GPIO blocks.
17+
18+
properties:
19+
compatible:
20+
items:
21+
- enum:
22+
- xylon,logicvc-3.02.a
23+
- const: syscon
24+
- const: simple-mfd
25+
26+
reg:
27+
maxItems: 1
28+
29+
select:
30+
properties:
31+
compatible:
32+
contains:
33+
enum:
34+
- xylon,logicvc-3.02.a
35+
36+
required:
37+
- compatible
38+
39+
required:
40+
- compatible
41+
- reg
42+
43+
examples:
44+
- |
45+
logicvc: logicvc@43c00000 {
46+
compatible = "xylon,logicvc-3.02.a", "syscon", "simple-mfd";
47+
reg = <0x43c00000 0x6000>;
48+
#address-cells = <1>;
49+
#size-cells = <1>;
50+
};

Documentation/devicetree/bindings/vendor-prefixes.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,8 @@ patternProperties:
10601060
description: Xilinx
10611061
"^xunlong,.*":
10621062
description: Shenzhen Xunlong Software CO.,Limited
1063+
"^xylon,.*":
1064+
description: Xylon
10631065
"^yones-toptech,.*":
10641066
description: Yones Toptech Co., Ltd.
10651067
"^ysoft,.*":

Documentation/driver-api/driver-model/devres.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ DRM
267267

268268
GPIO
269269
devm_gpiod_get()
270+
devm_gpiod_get_array()
271+
devm_gpiod_get_array_optional()
270272
devm_gpiod_get_index()
271273
devm_gpiod_get_index_optional()
272274
devm_gpiod_get_optional()

Documentation/driver-api/gpio/drivers-on-gpio.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ to emulate MCTRL (modem control) signals CTS/RTS by using two GPIO lines. The
9595
MTD NOR flash has add-ons for extra GPIO lines too, though the address bus is
9696
usually connected directly to the flash.
9797

98-
Use those instead of talking directly to the GPIOs using sysfs; they integrate
99-
with kernel frameworks better than your userspace code could. Needless to say,
100-
just using the appropriate kernel drivers will simplify and speed up your
101-
embedded hacking in particular by providing ready-made components.
98+
Use those instead of talking directly to the GPIOs from userspace; they
99+
integrate with kernel frameworks better than your userspace code could.
100+
Needless to say, just using the appropriate kernel drivers will simplify and
101+
speed up your embedded hacking in particular by providing ready-made components.

Documentation/driver-api/gpio/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Contents:
88
:maxdepth: 2
99

1010
intro
11+
using-gpio
1112
driver
1213
consumer
1314
board
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
=========================
2+
Using GPIO Lines in Linux
3+
=========================
4+
5+
The Linux kernel exists to abstract and present hardware to users. GPIO lines
6+
as such are normally not user facing abstractions. The most obvious, natural
7+
and preferred way to use GPIO lines is to let kernel hardware drivers deal
8+
with them.
9+
10+
For examples of already existing generic drivers that will also be good
11+
examples for any other kernel drivers you want to author, refer to
12+
:doc:`drivers-on-gpio`
13+
14+
For any kind of mass produced system you want to support, such as servers,
15+
laptops, phones, tablets, routers, and any consumer or office or business goods
16+
using appropriate kernel drivers is paramount. Submit your code for inclusion
17+
in the upstream Linux kernel when you feel it is mature enough and you will get
18+
help to refine it, see :doc:`../../process/submitting-patches`.
19+
20+
In Linux GPIO lines also have a userspace ABI.
21+
22+
The userspace ABI is intended for one-off deployments. Examples are prototypes,
23+
factory lines, maker community projects, workshop specimen, production tools,
24+
industrial automation, PLC-type use cases, door controllers, in short a piece
25+
of specialized equipment that is not produced by the numbers, requiring
26+
operators to have a deep knowledge of the equipment and knows about the
27+
software-hardware interface to be set up. They should not have a natural fit
28+
to any existing kernel subsystem and not be a good fit for an operating system,
29+
because of not being reusable or abstract enough, or involving a lot of non
30+
computer hardware related policy.
31+
32+
Applications that have a good reason to use the industrial I/O (IIO) subsystem
33+
from userspace will likely be a good fit for using GPIO lines from userspace as
34+
well.
35+
36+
Do not under any circumstances abuse the GPIO userspace ABI to cut corners in
37+
any product development projects. If you use it for prototyping, then do not
38+
productify the prototype: rewrite it using proper kernel drivers. Do not under
39+
any circumstances deploy any uniform products using GPIO from userspace.
40+
41+
The userspace ABI is a character device for each GPIO hardware unit (GPIO chip).
42+
These devices will appear on the system as ``/dev/gpiochip0`` thru
43+
``/dev/gpiochipN``. Examples of how to directly use the userspace ABI can be
44+
found in the kernel tree ``tools/gpio`` subdirectory.
45+
46+
For structured and managed applications, we recommend that you make use of the
47+
libgpiod_ library. This provides helper abstractions, command line utlities
48+
and arbitration for multiple simultaneous consumers on the same GPIO chip.
49+
50+
.. _libgpiod: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ S: Maintained
734734
F: drivers/mailbox/mailbox-altera.c
735735

736736
ALTERA PIO DRIVER
737-
M: Tien Hock Loh <thloh@altera.com>
737+
M: Joyce Ooi <joyce.ooi@intel.com>
738738
739739
S: Maintained
740740
F: drivers/gpio/gpio-altera.c

0 commit comments

Comments
 (0)