Skip to content

Commit 2c47f0d

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
BCM270X_DT: Allow multiple instances of w1-gpio overlays
Upcoming firmware will modify the address portion of node names when their "reg" property is written by a dtparam. Modify the w1-gpio overlays to write the gpiopin parameter value to "reg" properties, so that multiple instances can be loaded simultaneously. Note: The value of the "address" is unimportant - the w1 subsystem assigns instance numbers to buses sequentially from 1, and it is not necessary to know which bus a device is on in order to find it.
1 parent db68841 commit 2c47f0d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fragment@1 {
2424
target = <&gpio>;
2525
__overlay__ {
26-
w1_pins: w1_pins {
26+
w1_pins: w1_pins@0 {
2727
brcm,pins = <4>;
2828
brcm,function = <0>; // in (initially)
2929
brcm,pull = <0>; // off
@@ -33,7 +33,9 @@
3333

3434
__overrides__ {
3535
gpiopin = <&w1>,"gpios:4",
36-
<&w1_pins>,"brcm,pins:0";
36+
<&w1>,"reg:0",
37+
<&w1_pins>,"brcm,pins:0",
38+
<&w1_pins>,"reg:0";
3739
pullup = <&w1>,"rpi,parasitic-power:0";
3840
};
3941
};

arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fragment@1 {
2424
target = <&gpio>;
2525
__overlay__ {
26-
w1_pins: w1_pins {
26+
w1_pins: w1_pins@0 {
2727
brcm,pins = <4 5>;
2828
brcm,function = <0 1>; // in out
2929
brcm,pull = <0 0>; // off off
@@ -33,7 +33,9 @@
3333

3434
__overrides__ {
3535
gpiopin = <&w1>,"gpios:4",
36-
<&w1_pins>,"brcm,pins:0";
36+
<&w1>,"reg:0",
37+
<&w1_pins>,"brcm,pins:0",
38+
<&w1_pins>,"reg:0";
3739
extpullup = <&w1>,"gpios:16",
3840
<&w1_pins>,"brcm,pins:4";
3941
pullup = <&w1>,"rpi,parasitic-power:0";

0 commit comments

Comments
 (0)