forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ...
- Loading branch information
Showing
38 changed files
with
814 additions
and
413 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/gpio/qcom,wcd934x-gpio.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: WCD9340/WCD9341 GPIO controller | ||
|
||
maintainers: | ||
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | ||
|
||
description: | | ||
Qualcomm Technologies Inc WCD9340/WCD9341 Audio Codec has integrated | ||
gpio controller to control 5 gpios on the chip. | ||
properties: | ||
compatible: | ||
enum: | ||
- qcom,wcd9340-gpio | ||
- qcom,wcd9341-gpio | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
gpio-controller: true | ||
|
||
'#gpio-cells': | ||
const: 2 | ||
|
||
required: | ||
- compatible | ||
- reg | ||
- gpio-controller | ||
- "#gpio-cells" | ||
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
wcdgpio: gpio@42 { | ||
compatible = "qcom,wcd9340-gpio"; | ||
reg = <0x042 0x2>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
}; | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
# Copyright 2019 Bootlin | ||
%YAML 1.2 | ||
--- | ||
$id: "http://devicetree.org/schemas/gpio/xylon,logicvc-gpio.yaml#" | ||
$schema: "http://devicetree.org/meta-schemas/core.yaml#" | ||
|
||
title: Xylon LogiCVC GPIO controller | ||
|
||
maintainers: | ||
- Paul Kocialkowski <paul.kocialkowski@bootlin.com> | ||
|
||
description: | | ||
The LogiCVC GPIO describes the GPIO block included in the LogiCVC display | ||
controller. These are meant to be used for controlling display-related | ||
signals. | ||
The controller exposes GPIOs from the display and power control registers, | ||
which are mapped by the driver as follows: | ||
- GPIO[4:0] (display control) mapped to index 0-4 | ||
- EN_BLIGHT (power control) mapped to index 5 | ||
- EN_VDD (power control) mapped to index 6 | ||
- EN_VEE (power control) mapped to index 7 | ||
- V_EN (power control) mapped to index 8 | ||
properties: | ||
$nodename: | ||
pattern: "^gpio@[0-9a-f]+$" | ||
|
||
compatible: | ||
enum: | ||
- xylon,logicvc-3.02.a-gpio | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
"#gpio-cells": | ||
const: 2 | ||
|
||
gpio-controller: true | ||
|
||
gpio-line-names: | ||
minItems: 1 | ||
maxItems: 9 | ||
|
||
required: | ||
- compatible | ||
- reg | ||
- "#gpio-cells" | ||
- gpio-controller | ||
|
||
examples: | ||
- | | ||
logicvc: logicvc@43c00000 { | ||
compatible = "xylon,logicvc-3.02.a", "syscon", "simple-mfd"; | ||
reg = <0x43c00000 0x6000>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
logicvc_gpio: gpio@40 { | ||
compatible = "xylon,logicvc-3.02.a-gpio"; | ||
reg = <0x40 0x40>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
gpio-line-names = "GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO4", | ||
"EN_BLIGHT", "EN_VDD", "EN_VEE", "V_EN"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | ||
# Copyright 2019 Bootlin | ||
%YAML 1.2 | ||
--- | ||
$id: "http://devicetree.org/schemas/mfd/xylon,logicvc.yaml#" | ||
$schema: "http://devicetree.org/meta-schemas/core.yaml#" | ||
|
||
title: Xylon LogiCVC multi-function device | ||
|
||
maintainers: | ||
- Paul Kocialkowski <paul.kocialkowski@bootlin.com> | ||
|
||
description: | | ||
The LogiCVC is a display controller that also contains a GPIO controller. | ||
As a result, a multi-function device is exposed as parent of the display | ||
and GPIO blocks. | ||
properties: | ||
compatible: | ||
items: | ||
- enum: | ||
- xylon,logicvc-3.02.a | ||
- const: syscon | ||
- const: simple-mfd | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
select: | ||
properties: | ||
compatible: | ||
contains: | ||
enum: | ||
- xylon,logicvc-3.02.a | ||
|
||
required: | ||
- compatible | ||
|
||
required: | ||
- compatible | ||
- reg | ||
|
||
examples: | ||
- | | ||
logicvc: logicvc@43c00000 { | ||
compatible = "xylon,logicvc-3.02.a", "syscon", "simple-mfd"; | ||
reg = <0x43c00000 0x6000>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ Contents: | |
:maxdepth: 2 | ||
|
||
intro | ||
using-gpio | ||
driver | ||
consumer | ||
board | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
========================= | ||
Using GPIO Lines in Linux | ||
========================= | ||
|
||
The Linux kernel exists to abstract and present hardware to users. GPIO lines | ||
as such are normally not user facing abstractions. The most obvious, natural | ||
and preferred way to use GPIO lines is to let kernel hardware drivers deal | ||
with them. | ||
|
||
For examples of already existing generic drivers that will also be good | ||
examples for any other kernel drivers you want to author, refer to | ||
:doc:`drivers-on-gpio` | ||
|
||
For any kind of mass produced system you want to support, such as servers, | ||
laptops, phones, tablets, routers, and any consumer or office or business goods | ||
using appropriate kernel drivers is paramount. Submit your code for inclusion | ||
in the upstream Linux kernel when you feel it is mature enough and you will get | ||
help to refine it, see :doc:`../../process/submitting-patches`. | ||
|
||
In Linux GPIO lines also have a userspace ABI. | ||
|
||
The userspace ABI is intended for one-off deployments. Examples are prototypes, | ||
factory lines, maker community projects, workshop specimen, production tools, | ||
industrial automation, PLC-type use cases, door controllers, in short a piece | ||
of specialized equipment that is not produced by the numbers, requiring | ||
operators to have a deep knowledge of the equipment and knows about the | ||
software-hardware interface to be set up. They should not have a natural fit | ||
to any existing kernel subsystem and not be a good fit for an operating system, | ||
because of not being reusable or abstract enough, or involving a lot of non | ||
computer hardware related policy. | ||
|
||
Applications that have a good reason to use the industrial I/O (IIO) subsystem | ||
from userspace will likely be a good fit for using GPIO lines from userspace as | ||
well. | ||
|
||
Do not under any circumstances abuse the GPIO userspace ABI to cut corners in | ||
any product development projects. If you use it for prototyping, then do not | ||
productify the prototype: rewrite it using proper kernel drivers. Do not under | ||
any circumstances deploy any uniform products using GPIO from userspace. | ||
|
||
The userspace ABI is a character device for each GPIO hardware unit (GPIO chip). | ||
These devices will appear on the system as ``/dev/gpiochip0`` thru | ||
``/dev/gpiochipN``. Examples of how to directly use the userspace ABI can be | ||
found in the kernel tree ``tools/gpio`` subdirectory. | ||
|
||
For structured and managed applications, we recommend that you make use of the | ||
libgpiod_ library. This provides helper abstractions, command line utlities | ||
and arbitration for multiple simultaneous consumers on the same GPIO chip. | ||
|
||
.. _libgpiod: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.