Skip to content

Commit e7324e9

Browse files
committed
overlays: Ensure that defined pin groups are used
In order to prevent confusing problems where pin configuration is not be applied, an upcoming change to the overlaycheck utility will add a check that all added pin groups are in some way referenced by the overlay. Before that can be done, it is necessary to ensure that all existing overlays pass that test. This patch modifies some overlays by adding the required "pinctrl-0" properties, but for others that are just setting GPIOs to inputs and outputs, where those same GPIOs are declared by <name>-gpios properties, it is better to drop the pin groups and let the GPIO subsystem set up the GPIOs as required. Removing this duplication may be helpful in the future should we ever decide to enable the exclusive GPIO vs pinctrl locking (.strict in struct pinmux_ops). See: https://forums.raspberrypi.com/viewtopic.php?t=393742 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent a57d19f commit e7324e9

12 files changed

+46
-101
lines changed

arch/arm/boot/dts/overlays/at86rf233-overlay.dts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,10 @@
3434
};
3535
};
3636

37-
fragment@2 {
38-
target = <&gpio>;
39-
__overlay__ {
40-
lowpan0_pins: lowpan0_pins {
41-
brcm,pins = <23 24 25>;
42-
brcm,function = <0 1 1>; /* in out out */
43-
};
44-
};
45-
};
46-
4737
__overrides__ {
48-
interrupt = <&lowpan0>, "interrupts:0",
49-
<&lowpan0_pins>, "brcm,pins:0";
50-
reset = <&lowpan0>, "reset-gpio:4",
51-
<&lowpan0_pins>, "brcm,pins:4";
52-
sleep = <&lowpan0>, "sleep-gpio:4",
53-
<&lowpan0_pins>, "brcm,pins:8";
38+
interrupt = <&lowpan0>, "interrupts:0";
39+
reset = <&lowpan0>, "reset-gpio:4";
40+
sleep = <&lowpan0>, "sleep-gpio:4";
5441
speed = <&lowpan0>, "spi-max-frequency:0";
5542
trim = <&lowpan0>, "xtal-trim.0";
5643
};

arch/arm/boot/dts/overlays/audiosense-pi-overlay.dts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@
3434
};
3535
};
3636

37-
fragment@2 {
38-
target = <&gpio>;
39-
__overlay__ {
40-
codec_rst: codec-rst {
41-
brcm,pins = <26>;
42-
brcm,function = <BCM2835_FSEL_GPIO_OUT>;
43-
};
44-
};
45-
};
46-
4737
fragment@3 {
4838
target = <&i2c1>;
4939
__overlay__ {

arch/arm/boot/dts/overlays/chipcap2-overlay.dts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@
3030
};
3131

3232
fragment@1 {
33-
target = <&gpio>;
34-
__overlay__ {
35-
chipcap2_pins: chipcap2_pins {
36-
brcm,pins = <4 5 6 26>;
37-
brcm,function = <0 0 0 1>;
38-
};
39-
};
40-
};
41-
42-
fragment@2 {
4333
target-path = "/";
4434
__overlay__ {
4535
chipcap2_reg: chipcap2_reg {
@@ -54,13 +44,9 @@
5444
};
5545

5646
__overrides__ {
57-
ready_pin = <&chipcap2>, "interrupts:0",
58-
<&chipcap2_pins>, "brcm,pins:0";
59-
low_pin = <&chipcap2>, "interrupts:8",
60-
<&chipcap2_pins>, "brcm,pins:4";
61-
high_pin = <&chipcap2>, "interrupts:16",
62-
<&chipcap2_pins>, "brcm,pins:8";
63-
reg_pin = <&chipcap2_reg>, "gpio:4",
64-
<&chipcap2_pins>, "brcm,pins:12";
47+
ready_pin = <&chipcap2>, "interrupts:0";
48+
low_pin = <&chipcap2>, "interrupts:8";
49+
high_pin = <&chipcap2>, "interrupts:16";
50+
reg_pin = <&chipcap2_reg>, "gpio:4";
6551
};
6652
};

arch/arm/boot/dts/overlays/dacberry400-overlay.dts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@
2525
};
2626

2727
fragment@2 {
28-
target = <&gpio>;
29-
__overlay__ {
30-
codec_rst: codec-rst {
31-
brcm,pins = <26>;
32-
brcm,function = <1>;
33-
};
34-
};
35-
};
36-
37-
fragment@3 {
3828
target = <&i2c1>;
3929
__overlay__ {
4030
#address-cells = <1>;
@@ -58,7 +48,7 @@
5848
};
5949
};
6050

61-
fragment@4 {
51+
fragment@3 {
6252
target = <&sound>;
6353
__overlay__ {
6454
compatible = "osaelectronics,dacberry400";

arch/arm/boot/dts/overlays/draws-overlay.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@
176176
brcm,pull = <1>;
177177
};
178178

179-
aic3204_gpio: aic3204_gpio {
180-
brcm,pins = <26>;
181-
};
182-
183179
sc16is752_irq: sc16is752_irq {
184180
brcm,pins = <17>;
185181
brcm,function = <0>;

arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,8 @@
1616
};
1717
};
1818

19-
fragment@1 {
20-
target = <&gpio>;
21-
__overlay__ {
22-
power_ctrl_pins: power_ctrl_pins {
23-
brcm,pins = <26>;
24-
brcm,function = <1>; // out
25-
};
26-
};
27-
};
28-
2919
__overrides__ {
30-
gpiopin = <&power_ctrl>,"gpios:4",
31-
<&power_ctrl_pins>,"brcm,pins:0";
20+
gpiopin = <&power_ctrl>,"gpios:4";
3221
active_low = <&power_ctrl>,"gpios:8";
3322
input = <&power_ctrl>,"input?";
3423
export = <&power_ctrl>,"export?";

arch/arm/boot/dts/overlays/mcp23s17-overlay.dts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
status = "okay";
104104
#interrupt-cells=<2>;
105105
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-0-int-gpio parameter */
106+
pinctrl-0 = <&spi0_0_int_pins>;
107+
pinctrl-names = "default";
106108
};
107109
};
108110
};
@@ -124,6 +126,8 @@
124126
status = "okay";
125127
#interrupt-cells=<2>;
126128
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi0-1-int-gpio parameter */
129+
pinctrl-0 = <&spi0_1_int_pins>;
130+
pinctrl-names = "default";
127131
};
128132
};
129133
};
@@ -145,6 +149,8 @@
145149
status = "okay";
146150
#interrupt-cells=<2>;
147151
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-0-int-gpio parameter */
152+
pinctrl-0 = <&spi1_0_int_pins>;
153+
pinctrl-names = "default";
148154
};
149155
};
150156
};
@@ -166,6 +172,8 @@
166172
status = "okay";
167173
#interrupt-cells=<2>;
168174
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-1-int-gpio parameter */
175+
pinctrl-0 = <&spi1_1_int_pins>;
176+
pinctrl-names = "default";
169177
};
170178
};
171179
};
@@ -187,6 +195,8 @@
187195
status = "okay";
188196
#interrupt-cells=<2>;
189197
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi1-2-int-gpio parameter */
198+
pinctrl-0 = <&spi1_2_int_pins>;
199+
pinctrl-names = "default";
190200
};
191201
};
192202
};
@@ -208,6 +218,8 @@
208218
status = "okay";
209219
#interrupt-cells=<2>;
210220
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-0-int-gpio parameter */
221+
pinctrl-0 = <&spi2_0_int_pins>;
222+
pinctrl-names = "default";
211223
};
212224
};
213225
};
@@ -229,6 +241,8 @@
229241
status = "okay";
230242
#interrupt-cells=<2>;
231243
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-1-int-gpio parameter */
244+
pinctrl-0 = <&spi2_1_int_pins>;
245+
pinctrl-names = "default";
232246
};
233247
};
234248
};
@@ -250,6 +264,8 @@
250264
status = "okay";
251265
#interrupt-cells=<2>;
252266
interrupts = <0 2>; /* 1st word overwritten by mcp23s08-spi2-2-int-gpio parameter */
267+
pinctrl-0 = <&spi2_2_int_pins>;
268+
pinctrl-names = "default";
253269
};
254270
};
255271
};
@@ -271,6 +287,8 @@
271287
status = "okay";
272288
#interrupt-cells=<2>;
273289
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-0-int-gpio parameter */
290+
pinctrl-0 = <&spi0_0_int_pins>;
291+
pinctrl-names = "default";
274292
};
275293
};
276294
};
@@ -292,6 +310,8 @@
292310
status = "okay";
293311
#interrupt-cells=<2>;
294312
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi0-1-int-gpio parameter */
313+
pinctrl-0 = <&spi0_1_int_pins>;
314+
pinctrl-names = "default";
295315
};
296316
};
297317
};
@@ -313,6 +333,8 @@
313333
status = "okay";
314334
#interrupt-cells=<2>;
315335
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-0-int-gpio parameter */
336+
pinctrl-0 = <&spi1_0_int_pins>;
337+
pinctrl-names = "default";
316338
};
317339
};
318340
};
@@ -334,6 +356,8 @@
334356
status = "okay";
335357
#interrupt-cells=<2>;
336358
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-1-int-gpio parameter */
359+
pinctrl-0 = <&spi1_1_int_pins>;
360+
pinctrl-names = "default";
337361
};
338362
};
339363
};
@@ -355,6 +379,8 @@
355379
status = "okay";
356380
#interrupt-cells=<2>;
357381
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi1-2-int-gpio parameter */
382+
pinctrl-0 = <&spi1_2_int_pins>;
383+
pinctrl-names = "default";
358384
};
359385
};
360386
};
@@ -376,6 +402,8 @@
376402
status = "okay";
377403
#interrupt-cells=<2>;
378404
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-0-int-gpio parameter */
405+
pinctrl-0 = <&spi2_0_int_pins>;
406+
pinctrl-names = "default";
379407
};
380408
};
381409
};
@@ -397,6 +425,8 @@
397425
status = "okay";
398426
#interrupt-cells=<2>;
399427
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-1-int-gpio parameter */
428+
pinctrl-0 = <&spi2_1_int_pins>;
429+
pinctrl-names = "default";
400430
};
401431
};
402432
};
@@ -418,6 +448,8 @@
418448
status = "okay";
419449
#interrupt-cells=<2>;
420450
interrupts = <0 2>; /* 1st word overwritten by mcp23s17-spi2-2-int-gpio parameter */
451+
pinctrl-0 = <&spi2_2_int_pins>;
452+
pinctrl-names = "default";
421453
};
422454
};
423455
};

arch/arm/boot/dts/overlays/sunfounder-pipower3-overlay.dts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,7 @@
2828
};
2929
};
3030
};
31-
fragment@3 {
32-
target = <&gpio>;
33-
__overlay__ {
34-
power_ctrl_pins: power_ctrl_pins {
35-
brcm,pins = <26>;
36-
brcm,function = <1>; // out
37-
};
38-
};
39-
};
4031
__overrides__ {
41-
poweroff_pin = <&power_ctrl>,"gpios:4",
42-
<&power_ctrl_pins>,"brcm,pins:0";
32+
poweroff_pin = <&power_ctrl>,"gpios:4";
4333
};
4434
};

arch/arm/boot/dts/overlays/tinylcd35-overlay.dts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@
5050
fragment@3 {
5151
target = <&gpio>;
5252
__overlay__ {
53-
tinylcd35_pins: tinylcd35_pins {
54-
brcm,pins = <25 24 18>;
55-
brcm,function = <1>; /* out */
56-
};
57-
tinylcd35_ts_pins: tinylcd35_ts_pins {
58-
brcm,pins = <5>;
59-
brcm,function = <0>; /* in */
60-
};
6153
keypad_pins: keypad_pins {
6254
brcm,pins = <4 17 22 23 27>;
6355
brcm,function = <0>; /* in */
@@ -76,10 +68,6 @@
7668
tinylcd35: tinylcd35@0{
7769
compatible = "neosec,tinylcd";
7870
reg = <0>;
79-
pinctrl-names = "default";
80-
pinctrl-0 = <&tinylcd35_pins>,
81-
<&tinylcd35_ts_pins>;
82-
8371
spi-max-frequency = <48000000>;
8472
rotate = <270>;
8573
fps = <20>;
@@ -211,8 +199,7 @@
211199
fps = <&tinylcd35>,"fps:0";
212200
debug = <&tinylcd35>,"debug:0";
213201
touch = <&tinylcd35_ts>,"status";
214-
touchgpio = <&tinylcd35_ts_pins>,"brcm,pins:0",
215-
<&tinylcd35_ts>,"interrupts:0",
202+
touchgpio = <&tinylcd35_ts>,"interrupts:0",
216203
<&tinylcd35_ts>,"pendown-gpio:4";
217204
xohms = <&tinylcd35_ts>,"ti,x-plate-ohms;0";
218205
rtc-pcf = <0>,"=5";

arch/arm/boot/dts/overlays/udrc-overlay.dts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@
115115
brcm,function = <1>;
116116
brcm,pull = <1>;
117117
};
118-
119-
aic3204_gpio: aic3204_gpio {
120-
brcm,pins = <26>;
121-
};
122118
};
123119
};
124120

0 commit comments

Comments
 (0)