Skip to content

Commit c0f234f

Browse files
committed
Merge tag 'gpio-updates-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio updates from Bartosz Golaszewski: "We have a new GPIO multiplexer driver, bunch of driver updates and refactoring in the core GPIO library. GPIO core: - teach gpiolib to work with software nodes for HW description - remove ARCH_NR_GPIOS treewide as we no longer impose any limit on the number of GPIOS since the allocation became entirely dynamic - add support for HW quirks for Cirrus CS42L56 codec, Marvell NFC controller, Freescale PCIe and Ethernet controller, Himax LCDs and Mediatek mt2701 - refactor OF quirk code - some general refactoring of the OF and ACPI code, adding new helpers, minor tweaks and fixes, making fwnode usage consistent etc. GPIO uAPI: - fix an issue where the user-space can trigger a NULL-pointer dereference in the kernel by opening a device file, forcing a driver unbind and then calling one of the syscalls on the associated file descriptor New drivers: - add gpio-latch: a new GPIO multiplexer based on latches connected to other GPIOs Driver updates: - convert i2c GPIO expanders to using .probe_new() - drop the gpio-sta2x11 driver - factor out common code for the ACCES IDIO-16 family of controllers and use this new library wherever applicable in drivers - add DT support to gpio-hisi - allow building gpio-davinci as a module and increase its maxItems property - add support for a new model to gpio-pca9570 - other minor changes to various drivers" * tag 'gpio-updates-for-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (66 commits) gpio: sim: set a limit on the number of GPIOs gpiolib: protect the GPIO device against being dropped while in use by user-space gpiolib: cdev: fix NULL-pointer dereferences gpiolib: Provide to_gpio_device() helper gpiolib: Unify access to the device properties gpio: Do not include <linux/kernel.h> when not really needed. gpio: pcf857x: Convert to i2c's .probe_new() gpio: pca953x: Convert to i2c's .probe_new() gpio: max732x: Convert to i2c's .probe_new() dt-bindings: gpio: gpio-davinci: Increase maxItems in gpio-line-names gpiolib: ensure that fwnode is properly set gpio: sl28cpld: Replace irqchip mask_invert with unmask_base gpiolib: of: Use correct fwnode for DT-probed chips gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() gpiolib: of: Prepare of_mm_gpiochip_add_data() for fwnode gpiolib: add support for software nodes gpiolib: consolidate GPIO lookups gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes gpiolib: acpi: change acpi_find_gpio() to accept firmware node ...
2 parents 9fa4abc + 11e47bb commit c0f234f

Some content is hidden

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

50 files changed

+1614
-1213
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ properties:
3535
gpio-line-names:
3636
description: strings describing the names of each gpio line.
3737
minItems: 1
38-
maxItems: 100
38+
maxItems: 144
3939

4040
"#gpio-cells":
4141
const: 2
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/gpio-latch.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: GPIO latch controller
8+
9+
maintainers:
10+
- Sascha Hauer <[email protected]>
11+
12+
description: |
13+
This binding describes a GPIO multiplexer based on latches connected to
14+
other GPIOs, like this:
15+
16+
CLK0 ----------------------. ,--------.
17+
CLK1 -------------------. `--------|> #0 |
18+
| | |
19+
OUT0 ----------------+--|-----------|D0 Q0|-----|<
20+
OUT1 --------------+-|--|-----------|D1 Q1|-----|<
21+
OUT2 ------------+-|-|--|-----------|D2 Q2|-----|<
22+
OUT3 ----------+-|-|-|--|-----------|D3 Q3|-----|<
23+
OUT4 --------+-|-|-|-|--|-----------|D4 Q4|-----|<
24+
OUT5 ------+-|-|-|-|-|--|-----------|D5 Q5|-----|<
25+
OUT6 ----+-|-|-|-|-|-|--|-----------|D6 Q6|-----|<
26+
OUT7 --+-|-|-|-|-|-|-|--|-----------|D7 Q7|-----|<
27+
| | | | | | | | | `--------'
28+
| | | | | | | | |
29+
| | | | | | | | | ,--------.
30+
| | | | | | | | `-----------|> #1 |
31+
| | | | | | | | | |
32+
| | | | | | | `--------------|D0 Q0|-----|<
33+
| | | | | | `----------------|D1 Q1|-----|<
34+
| | | | | `------------------|D2 Q2|-----|<
35+
| | | | `--------------------|D3 Q3|-----|<
36+
| | | `----------------------|D4 Q4|-----|<
37+
| | `------------------------|D5 Q5|-----|<
38+
| `--------------------------|D6 Q6|-----|<
39+
`----------------------------|D7 Q7|-----|<
40+
`--------'
41+
42+
The number of clk-gpios and latched-gpios is not fixed. The actual number
43+
of number of latches and the number of inputs per latch is derived from
44+
the number of GPIOs given in the corresponding device tree properties.
45+
46+
properties:
47+
compatible:
48+
const: gpio-latch
49+
"#gpio-cells":
50+
const: 2
51+
52+
clk-gpios:
53+
description: Array of GPIOs to be used to clock a latch
54+
55+
latched-gpios:
56+
description: Array of GPIOs to be used as inputs per latch
57+
58+
setup-duration-ns:
59+
description: Delay in nanoseconds to wait after the latch inputs have been
60+
set up
61+
62+
clock-duration-ns:
63+
description: Delay in nanoseconds to wait between clock output changes
64+
65+
gpio-controller: true
66+
67+
gpio-line-names: true
68+
69+
required:
70+
- compatible
71+
- "#gpio-cells"
72+
- gpio-controller
73+
- clk-gpios
74+
- latched-gpios
75+
76+
additionalProperties: false
77+
78+
examples:
79+
- |
80+
gpio-latch {
81+
#gpio-cells = <2>;
82+
pinctrl-names = "default";
83+
pinctrl-0 = <&pinctrl_di_do_leds>;
84+
compatible = "gpio-latch";
85+
gpio-controller;
86+
setup-duration-ns = <100>;
87+
clock-duration-ns = <100>;
88+
89+
clk-gpios = <&gpio3 7 0>, <&gpio3 8 0>;
90+
latched-gpios = <&gpio3 21 0>, <&gpio3 22 0>,
91+
<&gpio3 23 0>, <&gpio3 24 0>,
92+
<&gpio3 25 0>, <&gpio3 26 0>,
93+
<&gpio3 27 0>, <&gpio3 28 0>;
94+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ maintainers:
1212
properties:
1313
compatible:
1414
enum:
15+
- dlg,slg7xl45106
1516
- nxp,pca9570
1617
- nxp,pca9571
1718

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/gpio/hisilicon,ascend910-gpio.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: HiSilicon common GPIO controller
8+
9+
maintainers:
10+
- Jay Fang <[email protected]>
11+
12+
description:
13+
The HiSilicon common GPIO controller can be used for many different
14+
types of SoC such as Huawei Ascend AI series chips.
15+
16+
properties:
17+
compatible:
18+
const: hisilicon,ascend910-gpio
19+
20+
reg:
21+
maxItems: 1
22+
23+
interrupts:
24+
maxItems: 1
25+
26+
gpio-controller: true
27+
28+
"#gpio-cells":
29+
const: 2
30+
31+
ngpios:
32+
minimum: 1
33+
maximum: 32
34+
35+
required:
36+
- compatible
37+
- reg
38+
- interrupts
39+
- gpio-controller
40+
- "#gpio-cells"
41+
- ngpios
42+
43+
additionalProperties: false
44+
45+
examples:
46+
- |
47+
#include <dt-bindings/interrupt-controller/arm-gic.h>
48+
49+
gpio@840d0000 {
50+
compatible = "hisilicon,ascend910-gpio";
51+
reg = <0x840d0000 0x1000>;
52+
ngpios = <32>;
53+
gpio-controller;
54+
#gpio-cells = <2>;
55+
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
56+
};

Documentation/driver-api/gpio/legacy.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,6 @@ Platform Support
558558
To force-enable this framework, a platform's Kconfig will "select" GPIOLIB,
559559
else it is up to the user to configure support for GPIO.
560560

561-
It may also provide a custom value for ARCH_NR_GPIOS, so that it better
562-
reflects the number of GPIOs in actual use on that platform, without
563-
wasting static table space. (It should count both built-in/SoC GPIOs and
564-
also ones on GPIO expanders.
565-
566561
If neither of these options are selected, the platform does not support
567562
GPIOs through GPIO-lib and the code cannot be enabled by the user.
568563

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,13 @@ L: [email protected]
312312
S: Maintained
313313
F: drivers/counter/104-quad-8.c
314314

315+
ACCES IDIO-16 GPIO LIBRARY
316+
M: William Breathitt Gray <[email protected]>
317+
318+
S: Maintained
319+
F: drivers/gpio/gpio-idio-16.c
320+
F: drivers/gpio/gpio-idio-16.h
321+
315322
ACCES PCI-IDIO-16 GPIO DRIVER
316323
M: William Breathitt Gray <[email protected]>
317324
@@ -9266,6 +9273,7 @@ HISILICON GPIO DRIVER
92669273
M: Jay Fang <[email protected]>
92679274
92689275
S: Maintained
9276+
F: Documentation/devicetree/bindings/gpio/hisilicon,ascend910-gpio.yaml
92699277
F: drivers/gpio/gpio-hisi.c
92709278

92719279
HISILICON HIGH PERFORMANCE RSA ENGINE DRIVER (HPRE)

arch/arm/Kconfig

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,27 +1158,6 @@ config ARM_PSCI
11581158
0022A ("Power State Coordination Interface System Software on
11591159
ARM processors").
11601160

1161-
# The GPIO number here must be sorted by descending number. In case of
1162-
# a multiplatform kernel, we just want the highest value required by the
1163-
# selected platforms.
1164-
config ARCH_NR_GPIO
1165-
int
1166-
default 2048 if ARCH_INTEL_SOCFPGA
1167-
default 1024 if ARCH_BRCMSTB || ARCH_RENESAS || ARCH_TEGRA || \
1168-
ARCH_ZYNQ || ARCH_ASPEED
1169-
default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \
1170-
SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210
1171-
default 416 if ARCH_SUNXI
1172-
default 392 if ARCH_U8500
1173-
default 352 if ARCH_VT8500
1174-
default 288 if ARCH_ROCKCHIP
1175-
default 264 if MACH_H4700
1176-
default 0
1177-
help
1178-
Maximum number of GPIOs in the system.
1179-
1180-
If unsure, leave the default value.
1181-
11821161
config HZ_FIXED
11831162
int
11841163
default 128 if SOC_AT91RM9200

arch/arm/include/asm/gpio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#ifndef _ARCH_ARM_GPIO_H
33
#define _ARCH_ARM_GPIO_H
44

5-
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
65
#include <asm-generic/gpio.h>
76

87
/* The trivial gpiolib dispatchers */

arch/arm64/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,18 +2168,6 @@ config STACKPROTECTOR_PER_TASK
21682168
def_bool y
21692169
depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
21702170

2171-
# The GPIO number here must be sorted by descending number. In case of
2172-
# a multiplatform kernel, we just want the highest value required by the
2173-
# selected platforms.
2174-
config ARCH_NR_GPIO
2175-
int
2176-
default 2048 if ARCH_APPLE
2177-
default 0
2178-
help
2179-
Maximum number of GPIOs in the system.
2180-
2181-
If unsure, leave the default value.
2182-
21832171
config UNWIND_PATCH_PAC_INTO_SCS
21842172
bool "Enable shadow call stack dynamically using code patching"
21852173
# needs Clang with https://reviews.llvm.org/D111780 incorporated

arch/x86/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,6 @@ config ARCH_HAS_CPU_RELAX
361361
config ARCH_HIBERNATION_POSSIBLE
362362
def_bool y
363363

364-
config ARCH_NR_GPIO
365-
int
366-
default 1024 if X86_64
367-
default 512
368-
369364
config ARCH_SUSPEND_POSSIBLE
370365
def_bool y
371366

0 commit comments

Comments
 (0)