Skip to content

Commit

Permalink
dtoverlays: Add override for target-path on I2C overlays
Browse files Browse the repository at this point in the history
To allow for attaching any of the standard overlays to a
bitbashed i2c-gpio bus, allow specifying the target path for
the overlay.

Suggested by:
https://forums.raspberrypi.com/viewtopic.php?t=381059
2 overlays implemented as examples, but could be applied to all.

Example:
dtoverlay=i2c-gpio,i2c_gpio_sda=10,i2c_gpio_scl=11
dtoverlay=mcp23017,i2c-path=/i2c@0
dtoverlay=i2c-gpio,i2c_gpio_sda=12,i2c_gpio_scl=13,bus=3
dtoverlay=mcp23017,i2c-path=/i2c@3

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 committed Dec 16, 2024
1 parent 77c09f1 commit cda0203
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ Params: addr I2C bus address of device. Set based on how the
overlay - BCM2711 only)
i2c6 Choose the I2C6 bus (configure with the i2c6
overlay - BCM2711 only)
i2c-path Override I2C path to allow for i2c-gpio buses

Channel parameters can be set for each enabled channel.
A maximum of 4 channels can be enabled (letters a thru d).
Expand Down Expand Up @@ -3138,6 +3139,7 @@ Params: gpiopin Gpio pin connected to the INTA output of the
overlay - BCM2711 only)
i2c6 Choose the I2C6 bus (configure with the i2c6
overlay - BCM2711 only)
i2c-path Override I2C path to allow for i2c-gpio buses


Name: mcp23s17
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/ads1115-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,7 @@
<&frag100>, "target-path=i2c5";
i2c6 = <&frag100>, "target?=0",
<&frag100>, "target-path=i2c6";
i2c-path = <&frag100>, "target?=0",
<&frag100>, "target-path";
};
};
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/overlays/mcp23017-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
<&frag100>, "target-path=i2c5";
i2c6 = <&frag100>, "target?=0",
<&frag100>, "target-path=i2c6";
i2c-path = <&frag100>, "target?=0",
<&frag100>, "target-path";
};
};

0 comments on commit cda0203

Please sign in to comment.