Skip to content

Commit aacc73c

Browse files
committed
Merge tag 'gpio-updates-for-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio updates from Bartosz Golaszewski: "We have three new drivers, some refactoring in the GPIO core, lots of various changes across many drivers, new configfs interface for the virtual gpio-aggregator module and DT-bindings updates. The treewide conversion of GPIO drivers to using the new value setter callbacks is ongoing with another round of GPIO drivers updated. You will also see these commits coming in from other subsystems as with the relevant changes merged into mainline last cycle, I've started converting GPIO providers located elsewhere than drivers/gpio/. GPIO core: - use more lock guards where applicable - refactor GPIO ACPI code and shrink it in the process by 8% - move GPIO ACPI quirks into a separate file - remove unneeded #ifdef - convert GPIO devres helpers to using devm_add_action() where applicable which shrinks and simplifies the code - refactor GPIO descriptor validation in GPIO consumer interfaces - don't allow setting values on input lines in the GPIO core which will take off the burden from GPIO drivers of checking this down the line - provide gpiod_is_equal() as a way of safely comparing two GPIO descriptors (the only current user is in regulator core) New drivers: - add the GPIO module for the max77759 multifunction device - add the GPIO driver for the VeriSilicon BLZP1600 GPIO controller - add the GPIO driver for the Spacemit K1 SoC Driver improvements: - convert more drivers to using the new GPIO line value setter callbacks - convert more drivers to making the irq_chip immutable as is recommended by the interrupt subsystem - extend build testing coverage by enabling more modules to be built with COMPILE_TEST=y - extend the gpio-aggregator module with a configfs interface that makes the setup easier for user-space than the existing driver-level sysfs attributes and also adds more advanced configuration features (such as referring to aggregated lines by their original names or modifying their names as exposed by the aggregated chip) - add a missing mutex_destroy() in gpio-imx-scu - add an OF polarity quirk for s5m8767 - allow building gpio-vf610 as a loadable module - make gpio-mxc not hardcode its GPIO base number with GPIO SYSFS interface disabled (another small step towards getting rid of the global GPIO numberspace) - add support for level-triggered interrupts to gpio-pca953x - don't double-check the ngpios property in gpio-ds4520 as GPIO core already does it - don't double-check the number of GPIOs in gpio-imx-scu as GPIO core already does it - remove unused callbacks from gpio-max3191x DT bindings: - add device-tree bindings for max77759, spacemit,k1 and blzp1600 (new drivers added this cycle) - document more properties for gpio-vf610 and gpio-tegra186 - document a new pca95xx variant - fix style of examples in several GPIO DT-binding documents Misc: - TODO list updates" * tag 'gpio-updates-for-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (123 commits) gpio: timberdale: select GPIOLIB_IRQCHIP gpio: lpc18xx: select GPIOLIB_IRQCHIP gpio: grgpio: select GPIOLIB_IRQCHIP gpio: bcm-kona: select GPIOLIB_IRQCHIP dt-bindings: gpio: vf610: add ngpios and gpio-reserved-ranges gpio: davinci: select GPIOLIB_IRQCHIP gpiolib-acpi: Update file references in the Documentation and MAINTAINERS gpiolib: acpi: Move quirks to a separate file gpiolib: acpi: Add acpi_gpio_need_run_edge_events_on_boot() getter gpiolib: acpi: Handle deferred list via new API gpiolib: acpi: Make sure we fill struct acpi_gpio_info gpiolib: acpi: Switch to use enum in acpi_gpio_in_ignore_list() gpiolib: acpi: Use temporary variable for struct acpi_gpio_info gpiolib: remove unneeded #ifdef gpio: mpc8xxx: select GPIOLIB_IRQCHIP gpio: pxa: select GPIOLIB_IRQCHIP gpio: pxa: Make irq_chip immutable gpio: timberdale: Make irq_chip immutable gpio: xgene-sb: Make irq_chip immutable gpio: davinci: Make irq_chip immutable ...
2 parents a9e6060 + 8b8ef30 commit aacc73c

File tree

94 files changed

+5541
-1162
lines changed

Some content is hidden

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

94 files changed

+5541
-1162
lines changed

Documentation/admin-guide/gpio/gpio-aggregator.rst

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,113 @@ write-only attribute files in sysfs.
6969
$ echo gpio-aggregator.0 > delete_device
7070
7171
72+
Aggregating GPIOs using Configfs
73+
--------------------------------
74+
75+
**Group:** ``/config/gpio-aggregator``
76+
77+
This is the root directory of the gpio-aggregator configfs tree.
78+
79+
**Group:** ``/config/gpio-aggregator/<example-name>``
80+
81+
This directory represents a GPIO aggregator device. You can assign any
82+
name to ``<example-name>`` (e.g. ``agg0``), except names starting with
83+
``_sysfs`` prefix, which are reserved for auto-generated configfs
84+
entries corresponding to devices created via Sysfs.
85+
86+
**Attribute:** ``/config/gpio-aggregator/<example-name>/live``
87+
88+
The ``live`` attribute allows to trigger the actual creation of the device
89+
once it's fully configured. Accepted values are:
90+
91+
* ``1``, ``yes``, ``true`` : enable the virtual device
92+
* ``0``, ``no``, ``false`` : disable the virtual device
93+
94+
**Attribute:** ``/config/gpio-aggregator/<example-name>/dev_name``
95+
96+
The read-only ``dev_name`` attribute exposes the name of the device as it
97+
will appear in the system on the platform bus (e.g. ``gpio-aggregator.0``).
98+
This is useful for identifying a character device for the newly created
99+
aggregator. If it's ``gpio-aggregator.0``,
100+
``/sys/devices/platform/gpio-aggregator.0/gpiochipX`` path tells you that the
101+
GPIO device id is ``X``.
102+
103+
You must create subdirectories for each virtual line you want to
104+
instantiate, named exactly as ``line0``, ``line1``, ..., ``lineY``, when
105+
you want to instantiate ``Y+1`` (Y >= 0) lines. Configure all lines before
106+
activating the device by setting ``live`` to 1.
107+
108+
**Group:** ``/config/gpio-aggregator/<example-name>/<lineY>/``
109+
110+
This directory represents a GPIO line to include in the aggregator.
111+
112+
**Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/key``
113+
114+
**Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/offset``
115+
116+
The default values after creating the ``<lineY>`` directory are:
117+
118+
* ``key`` : <empty>
119+
* ``offset`` : -1
120+
121+
``key`` must always be explicitly configured, while ``offset`` depends.
122+
Two configuration patterns exist for each ``<lineY>``:
123+
124+
(a). For lookup by GPIO line name:
125+
126+
* Set ``key`` to the line name.
127+
* Ensure ``offset`` remains -1 (the default).
128+
129+
(b). For lookup by GPIO chip name and the line offset within the chip:
130+
131+
* Set ``key`` to the chip name.
132+
* Set ``offset`` to the line offset (0 <= ``offset`` < 65535).
133+
134+
**Attribute:** ``/config/gpio-aggregator/<example-name>/<lineY>/name``
135+
136+
The ``name`` attribute sets a custom name for lineY. If left unset, the
137+
line will remain unnamed.
138+
139+
Once the configuration is done, the ``'live'`` attribute must be set to 1
140+
in order to instantiate the aggregator device. It can be set back to 0 to
141+
destroy the virtual device. The module will synchronously wait for the new
142+
aggregator device to be successfully probed and if this doesn't happen, writing
143+
to ``'live'`` will result in an error. This is a different behaviour from the
144+
case when you create it using sysfs ``new_device`` interface.
145+
146+
.. note::
147+
148+
For aggregators created via Sysfs, the configfs entries are
149+
auto-generated and appear as ``/config/gpio-aggregator/_sysfs.<N>/``. You
150+
cannot add or remove line directories with mkdir(2)/rmdir(2). To modify
151+
lines, you must use the "delete_device" interface to tear down the
152+
existing device and reconfigure it from scratch. However, you can still
153+
toggle the aggregator with the ``live`` attribute and adjust the
154+
``key``, ``offset``, and ``name`` attributes for each line when ``live``
155+
is set to 0 by hand (i.e. it's not waiting for deferred probe).
156+
157+
Sample configuration commands
158+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159+
160+
.. code-block:: sh
161+
162+
# Create a directory for an aggregator device
163+
$ mkdir /sys/kernel/config/gpio-aggregator/agg0
164+
165+
# Configure each line
166+
$ mkdir /sys/kernel/config/gpio-aggregator/agg0/line0
167+
$ echo gpiochip0 > /sys/kernel/config/gpio-aggregator/agg0/line0/key
168+
$ echo 6 > /sys/kernel/config/gpio-aggregator/agg0/line0/offset
169+
$ echo test0 > /sys/kernel/config/gpio-aggregator/agg0/line0/name
170+
$ mkdir /sys/kernel/config/gpio-aggregator/agg0/line1
171+
$ echo gpiochip0 > /sys/kernel/config/gpio-aggregator/agg0/line1/key
172+
$ echo 7 > /sys/kernel/config/gpio-aggregator/agg0/line1/offset
173+
$ echo test1 > /sys/kernel/config/gpio-aggregator/agg0/line1/name
174+
175+
# Activate the aggregator device
176+
$ echo 1 > /sys/kernel/config/gpio-aggregator/agg0/live
177+
178+
72179
Generic GPIO Driver
73180
-------------------
74181

Documentation/devicetree/bindings/gpio/atmel,at91rm9200-gpio.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ examples:
6969
#include <dt-bindings/interrupt-controller/irq.h>
7070
7171
gpio@fffff400 {
72-
compatible = "atmel,at91rm9200-gpio";
73-
reg = <0xfffff400 0x200>;
74-
interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
75-
#gpio-cells = <2>;
76-
gpio-controller;
77-
interrupt-controller;
78-
#interrupt-cells = <2>;
79-
clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
72+
compatible = "atmel,at91rm9200-gpio";
73+
reg = <0xfffff400 0x200>;
74+
interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
75+
#gpio-cells = <2>;
76+
gpio-controller;
77+
interrupt-controller;
78+
#interrupt-cells = <2>;
79+
clocks = <&pmc PMC_TYPE_PERIPHERAL 2>;
8080
};
8181
...
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/blaize,blzp1600-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Blaize BLZP1600 GPIO controller
8+
9+
description:
10+
Blaize BLZP1600 GPIO controller is an implementation of the VeriSilicon
11+
APB GPIO v0.2 IP block. It has 32 ports each of which are intended to be
12+
represented as child nodes with the generic GPIO-controller properties
13+
as described in this binding's file.
14+
15+
maintainers:
16+
- Nikolaos Pasaloukos <nikolaos.pasaloukos@blaize.com>
17+
- James Cowgill <james.cowgill@blaize.com>
18+
- Matt Redfearn <matt.redfearn@blaize.com>
19+
- Neil Jones <neil.jones@blaize.com>
20+
21+
properties:
22+
$nodename:
23+
pattern: "^gpio@[0-9a-f]+$"
24+
25+
compatible:
26+
enum:
27+
- blaize,blzp1600-gpio
28+
29+
reg:
30+
maxItems: 1
31+
32+
gpio-controller: true
33+
34+
'#gpio-cells':
35+
const: 2
36+
37+
ngpios:
38+
default: 32
39+
minimum: 1
40+
maximum: 32
41+
42+
interrupts:
43+
maxItems: 1
44+
45+
gpio-line-names: true
46+
47+
interrupt-controller: true
48+
49+
'#interrupt-cells':
50+
const: 2
51+
52+
required:
53+
- compatible
54+
- reg
55+
- gpio-controller
56+
- '#gpio-cells'
57+
58+
dependencies:
59+
interrupt-controller: [ interrupts ]
60+
61+
additionalProperties: false
62+
63+
examples:
64+
- |
65+
#include <dt-bindings/interrupt-controller/arm-gic.h>
66+
67+
gpio: gpio@4c0000 {
68+
compatible = "blaize,blzp1600-gpio";
69+
reg = <0x004c0000 0x1000>;
70+
gpio-controller;
71+
#gpio-cells = <2>;
72+
ngpios = <32>;
73+
interrupt-controller;
74+
#interrupt-cells = <2>;
75+
interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
76+
};
77+
...

Documentation/devicetree/bindings/gpio/fairchild,74hc595.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ unevaluatedProperties: false
7171
examples:
7272
- |
7373
spi {
74-
#address-cells = <1>;
75-
#size-cells = <0>;
76-
77-
gpio5: gpio5@0 {
78-
compatible = "fairchild,74hc595";
79-
reg = <0>;
80-
gpio-controller;
81-
#gpio-cells = <2>;
82-
registers-number = <4>;
83-
spi-max-frequency = <100000>;
84-
};
74+
#address-cells = <1>;
75+
#size-cells = <0>;
76+
77+
gpio5@0 {
78+
compatible = "fairchild,74hc595";
79+
reg = <0>;
80+
gpio-controller;
81+
#gpio-cells = <2>;
82+
registers-number = <4>;
83+
spi-max-frequency = <100000>;
84+
};
8585
};

Documentation/devicetree/bindings/gpio/gpio-mxs.yaml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -84,52 +84,52 @@ examples:
8484
reg = <0x80018000 0x2000>;
8585
8686
gpio@0 {
87-
compatible = "fsl,imx28-gpio";
88-
reg = <0>;
89-
interrupts = <127>;
90-
gpio-controller;
91-
#gpio-cells = <2>;
92-
interrupt-controller;
93-
#interrupt-cells = <2>;
87+
compatible = "fsl,imx28-gpio";
88+
reg = <0>;
89+
interrupts = <127>;
90+
gpio-controller;
91+
#gpio-cells = <2>;
92+
interrupt-controller;
93+
#interrupt-cells = <2>;
9494
};
9595
9696
gpio@1 {
97-
compatible = "fsl,imx28-gpio";
98-
reg = <1>;
99-
interrupts = <126>;
100-
gpio-controller;
101-
#gpio-cells = <2>;
102-
interrupt-controller;
103-
#interrupt-cells = <2>;
97+
compatible = "fsl,imx28-gpio";
98+
reg = <1>;
99+
interrupts = <126>;
100+
gpio-controller;
101+
#gpio-cells = <2>;
102+
interrupt-controller;
103+
#interrupt-cells = <2>;
104104
};
105105
106106
gpio@2 {
107-
compatible = "fsl,imx28-gpio";
108-
reg = <2>;
109-
interrupts = <125>;
110-
gpio-controller;
111-
#gpio-cells = <2>;
112-
interrupt-controller;
113-
#interrupt-cells = <2>;
107+
compatible = "fsl,imx28-gpio";
108+
reg = <2>;
109+
interrupts = <125>;
110+
gpio-controller;
111+
#gpio-cells = <2>;
112+
interrupt-controller;
113+
#interrupt-cells = <2>;
114114
};
115115
116116
gpio@3 {
117-
compatible = "fsl,imx28-gpio";
118-
reg = <3>;
119-
interrupts = <124>;
120-
gpio-controller;
121-
#gpio-cells = <2>;
122-
interrupt-controller;
123-
#interrupt-cells = <2>;
117+
compatible = "fsl,imx28-gpio";
118+
reg = <3>;
119+
interrupts = <124>;
120+
gpio-controller;
121+
#gpio-cells = <2>;
122+
interrupt-controller;
123+
#interrupt-cells = <2>;
124124
};
125125
126126
gpio@4 {
127-
compatible = "fsl,imx28-gpio";
128-
reg = <4>;
129-
interrupts = <123>;
130-
gpio-controller;
131-
#gpio-cells = <2>;
132-
interrupt-controller;
133-
#interrupt-cells = <2>;
127+
compatible = "fsl,imx28-gpio";
128+
reg = <4>;
129+
interrupts = <123>;
130+
gpio-controller;
131+
#gpio-cells = <2>;
132+
interrupt-controller;
133+
#interrupt-cells = <2>;
134134
};
135135
};

Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ description: |+
1616
properties:
1717
compatible:
1818
oneOf:
19+
- items:
20+
- const: toradex,ecgpiol16
21+
- const: nxp,pcal6416
1922
- items:
2023
- const: diodes,pi4ioe5v6534q
2124
- const: nxp,pcal6534
@@ -132,6 +135,7 @@ allOf:
132135
- maxim,max7325
133136
- maxim,max7326
134137
- maxim,max7327
138+
- toradex,ecgpiol16
135139
then:
136140
properties:
137141
reset-gpios: false

Documentation/devicetree/bindings/gpio/gpio-vf610.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ properties:
7070
minItems: 1
7171
maxItems: 4
7272

73+
gpio-reserved-ranges: true
74+
75+
ngpios:
76+
minimum: 1
77+
maximum: 32
78+
default: 32
79+
7380
patternProperties:
7481
"^.+-hog(-[0-9]+)?$":
7582
type: object

0 commit comments

Comments
 (0)