Skip to content

Commit 1b2951d

Browse files
committed
Merge tag 'gpio-v4.17-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 v4.17 kernel cycle: New drivers: - Nintendo Wii GameCube GPIO, known as "Hollywood" - Raspberry Pi mailbox service GPIO expander - Spreadtrum main SC9860 SoC and IEC GPIO controllers. Improvements: - Implemented .get_multiple() callback for most of the high-performance industrial GPIO cards for the ISA bus. - ISA GPIO drivers now select the ISA_BUS_API instead of depending on it. This is merged with the same pattern for all the ISA drivers and some other Kconfig cleanups related to this. Cleanup: - Delete the TZ1090 GPIO drivers following the deletion of this SoC from the ARM tree. - Move the documentation over to driver-api to conform with the rest of the kernel documentation build. - Continue to make the GPIO drivers include only <linux/gpio/driver.h> and not the too broad <linux/gpio.h> that we want to get rid of. - Managed to remove VLA allocation from two drivers pending more fixes in this area for the next merge window. - Misc janitorial fixes" * tag 'gpio-v4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (77 commits) gpio: Add Spreadtrum PMIC EIC driver support gpio: Add Spreadtrum EIC driver support dt-bindings: gpio: Add Spreadtrum EIC controller documentation gpio: ath79: Fix potential NULL dereference in ath79_gpio_probe() pinctrl: qcom: Don't allow protected pins to be requested gpiolib: Support 'gpio-reserved-ranges' property gpiolib: Change bitmap allocation to kmalloc_array gpiolib: Extract mask allocation into subroutine dt-bindings: gpio: Add a gpio-reserved-ranges property gpio: mockup: fix a potential crash when creating debugfs entries gpio: pca953x: add compatibility for pcal6524 and pcal9555a gpio: dwapb: Add support for a bus clock gpio: Remove VLA from xra1403 driver gpio: Remove VLA from MAX3191X driver gpio: ws16c48: Implement get_multiple callback gpio: gpio-mm: Implement get_multiple callback gpio: 104-idi-48: Implement get_multiple callback gpio: 104-dio-48e: Implement get_multiple callback gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks gpio: pci-idio-16: Implement get_multiple callback ...
2 parents 06dd3df + 348f3cd commit 1b2951d

Some content is hidden

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

77 files changed

+2771
-1274
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Spreadtrum EIC controller bindings
2+
3+
The EIC is the abbreviation of external interrupt controller, which can
4+
be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
5+
one is in digital chip, and another one is in PMIC. The digital chip EIC
6+
controller contains 4 sub-modules: EIC-debounce, EIC-latch, EIC-async and
7+
EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
8+
module.
9+
10+
The EIC-debounce sub-module provides up to 8 source input signal
11+
connections. A debounce mechanism is used to capture the input signals'
12+
stable status (millisecond resolution) and a single-trigger mechanism
13+
is introduced into this sub-module to enhance the input event detection
14+
reliability. In addition, this sub-module's clock can be shut off
15+
automatically to reduce power dissipation. Moreover the debounce range
16+
is from 1ms to 4s with a step size of 1ms. The input signal will be
17+
ignored if it is asserted for less than 1 ms.
18+
19+
The EIC-latch sub-module is used to latch some special power down signals
20+
and generate interrupts, since the EIC-latch does not depend on the APB
21+
clock to capture signals.
22+
23+
The EIC-async sub-module uses a 32kHz clock to capture the short signals
24+
(microsecond resolution) to generate interrupts by level or edge trigger.
25+
26+
The EIC-sync is similar with GPIO's input function, which is a synchronized
27+
signal input register. It can generate interrupts by level or edge trigger
28+
when detecting input signals.
29+
30+
Required properties:
31+
- compatible: Should be one of the following:
32+
"sprd,sc9860-eic-debounce",
33+
"sprd,sc9860-eic-latch",
34+
"sprd,sc9860-eic-async",
35+
"sprd,sc9860-eic-sync",
36+
"sprd,sc27xx-eic".
37+
- reg: Define the base and range of the I/O address space containing
38+
the GPIO controller registers.
39+
- gpio-controller: Marks the device node as a GPIO controller.
40+
- #gpio-cells: Should be <2>. The first cell is the gpio number and
41+
the second cell is used to specify optional parameters.
42+
- interrupt-controller: Marks the device node as an interrupt controller.
43+
- #interrupt-cells: Should be <2>. Specifies the number of cells needed
44+
to encode interrupt source.
45+
- interrupts: Should be the port interrupt shared by all the gpios.
46+
47+
Example:
48+
eic_debounce: gpio@40210000 {
49+
compatible = "sprd,sc9860-eic-debounce";
50+
reg = <0 0x40210000 0 0x80>;
51+
gpio-controller;
52+
#gpio-cells = <2>;
53+
interrupt-controller;
54+
#interrupt-cells = <2>;
55+
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
56+
};
57+
58+
eic_latch: gpio@40210080 {
59+
compatible = "sprd,sc9860-eic-latch";
60+
reg = <0 0x40210080 0 0x20>;
61+
gpio-controller;
62+
#gpio-cells = <2>;
63+
interrupt-controller;
64+
#interrupt-cells = <2>;
65+
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
66+
};
67+
68+
eic_async: gpio@402100a0 {
69+
compatible = "sprd,sc9860-eic-async";
70+
reg = <0 0x402100a0 0 0x20>;
71+
gpio-controller;
72+
#gpio-cells = <2>;
73+
interrupt-controller;
74+
#interrupt-cells = <2>;
75+
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
76+
};
77+
78+
eic_sync: gpio@402100c0 {
79+
compatible = "sprd,sc9860-eic-sync";
80+
reg = <0 0x402100c0 0 0x20>;
81+
gpio-controller;
82+
#gpio-cells = <2>;
83+
interrupt-controller;
84+
#interrupt-cells = <2>;
85+
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
86+
};
87+
88+
pmic_eic: gpio@300 {
89+
compatible = "sprd,sc27xx-eic";
90+
reg = <0x300>;
91+
interrupt-parent = <&sc2731_pmic>;
92+
interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
93+
gpio-controller;
94+
#gpio-cells = <2>;
95+
interrupt-controller;
96+
#interrupt-cells = <2>;
97+
};

Documentation/devicetree/bindings/gpio/gpio-pca953x.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Required properties:
1616
nxp,pca9574
1717
nxp,pca9575
1818
nxp,pca9698
19+
nxp,pcal6524
20+
nxp,pcal9555a
1921
maxim,max7310
2022
maxim,max7312
2123
maxim,max7313
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Spreadtrum GPIO controller bindings
2+
3+
The controller's registers are organized as sets of sixteen 16-bit
4+
registers with each set controlling a bank of up to 16 pins. A single
5+
interrupt is shared for all of the banks handled by the controller.
6+
7+
Required properties:
8+
- compatible: Should be "sprd,sc9860-gpio".
9+
- reg: Define the base and range of the I/O address space containing
10+
the GPIO controller registers.
11+
- gpio-controller: Marks the device node as a GPIO controller.
12+
- #gpio-cells: Should be <2>. The first cell is the gpio number and
13+
the second cell is used to specify optional parameters.
14+
- interrupt-controller: Marks the device node as an interrupt controller.
15+
- #interrupt-cells: Should be <2>. Specifies the number of cells needed
16+
to encode interrupt source.
17+
- interrupts: Should be the port interrupt shared by all the gpios.
18+
19+
Example:
20+
ap_gpio: gpio@40280000 {
21+
compatible = "sprd,sc9860-gpio";
22+
reg = <0 0x40280000 0 0x1000>;
23+
gpio-controller;
24+
#gpio-cells = <2>;
25+
interrupt-controller;
26+
#interrupt-cells = <2>;
27+
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
28+
};

Documentation/devicetree/bindings/gpio/gpio-tz1090-pdc.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

Documentation/devicetree/bindings/gpio/gpio-tz1090.txt

Lines changed: 0 additions & 88 deletions
This file was deleted.

Documentation/devicetree/bindings/gpio/gpio.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ in a lot of designs, some using all 32 bits, some using 18 and some using
151151
first 18 GPIOs, at local offset 0 .. 17, are in use.
152152

153153
If these GPIOs do not happen to be the first N GPIOs at offset 0...N-1, an
154-
additional bitmask is needed to specify which GPIOs are actually in use,
155-
and which are dummies. The bindings for this case has not yet been
156-
specified, but should be specified if/when such hardware appears.
154+
additional set of tuples is needed to specify which GPIOs are unusable, with
155+
the gpio-reserved-ranges binding. This property indicates the start and size
156+
of the GPIOs that can't be used.
157157

158158
Optionally, a GPIO controller may have a "gpio-line-names" property. This is
159159
an array of strings defining the names of the GPIO lines going out of the
@@ -178,6 +178,7 @@ gpio-controller@00000000 {
178178
gpio-controller;
179179
#gpio-cells = <2>;
180180
ngpios = <18>;
181+
gpio-reserved-ranges = <0 4>, <12 2>;
181182
gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R",
182183
"LED G", "LED B", "Col A", "Col B", "Col C", "Col D",
183184
"Row A", "Row B", "Row C", "Row D", "NMI button",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Nintendo Wii (Hollywood) GPIO controller
2+
3+
Required properties:
4+
- compatible: "nintendo,hollywood-gpio
5+
- reg: Physical base address and length of the controller's registers.
6+
- gpio-controller: Marks the device node as a GPIO controller.
7+
- #gpio-cells: Should be <2>. The first cell is the pin number and the
8+
second cell is used to specify optional parameters:
9+
- bit 0 specifies polarity (0 for normal, 1 for inverted).
10+
11+
Optional properties:
12+
- ngpios: see Documentation/devicetree/bindings/gpio/gpio.txt
13+
- interrupt-controller: Marks the device node as an interrupt controller.
14+
- #interrupt-cells: Should be two.
15+
- interrupts: Interrupt specifier for the controller's Broadway (PowerPC)
16+
interrupt.
17+
- interrupt-parent: phandle of the parent interrupt controller.
18+
19+
Example:
20+
21+
GPIO: gpio@d8000c0 {
22+
#gpio-cells = <2>;
23+
compatible = "nintendo,hollywood-gpio";
24+
reg = <0x0d8000c0 0x40>;
25+
gpio-controller;
26+
ngpios = <24>;
27+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Raspberry Pi GPIO expander
2+
3+
The Raspberry Pi 3 GPIO expander is controlled by the VC4 firmware. The
4+
firmware exposes a mailbox interface that allows the ARM core to control the
5+
GPIO lines on the expander.
6+
7+
The Raspberry Pi GPIO expander node must be a child node of the Raspberry Pi
8+
firmware node.
9+
10+
Required properties:
11+
12+
- compatible : Should be "raspberrypi,firmware-gpio"
13+
- gpio-controller : Marks the device node as a gpio controller
14+
- #gpio-cells : Should be two. The first cell is the pin number, and
15+
the second cell is used to specify the gpio polarity:
16+
0 = active high
17+
1 = active low
18+
19+
Example:
20+
21+
firmware: firmware-rpi {
22+
compatible = "raspberrypi,bcm2835-firmware";
23+
mboxes = <&mailbox>;
24+
25+
expgpio: gpio {
26+
compatible = "raspberrypi,firmware-gpio";
27+
gpio-controller;
28+
#gpio-cells = <2>;
29+
};
30+
};

Documentation/devicetree/bindings/powerpc/nintendo/wii.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,7 @@ Nintendo Wii device tree
152152

153153
1.l) The General Purpose I/O (GPIO) controller node
154154

155-
Represents the dual access 32 GPIO controller interface.
156-
157-
Required properties:
158-
159-
- #gpio-cells : <2>
160-
- compatible : should be "nintendo,hollywood-gpio"
161-
- reg : should contain the IPC registers location and length
162-
- gpio-controller
155+
see Documentation/devicetree/bindings/gpio/nintendo,hollywood-gpio.txt
163156

164157
1.m) The control node
165158

0 commit comments

Comments
 (0)