Skip to content

Commit b75fd2a

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add override for target-path on I2C overlays
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 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]>
1 parent 77c09f1 commit b75fd2a

16 files changed

+201
-7
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ Params: addr I2C bus address of device. Set based on how the
555555
overlay - BCM2711 only)
556556
i2c6 Choose the I2C6 bus (configure with the i2c6
557557
overlay - BCM2711 only)
558+
i2c-path Override I2C path to allow for i2c-gpio buses
558559

559560
Channel parameters can be set for each enabled channel.
560561
A maximum of 4 channels can be enabled (letters a thru d).
@@ -1238,6 +1239,7 @@ Params: sizex Touchscreen size x (default 800)
12381239
addr Sets the address for the touch controller. Note
12391240
that the device must be configured to use the
12401241
specified address.
1242+
i2c-path Override I2C path to allow for i2c-gpio buses
12411243

12421244

12431245
Name: enc28j60
@@ -1439,6 +1441,7 @@ Info: Enables I2C connected Goodix gt9271 multiple touch controller using
14391441
Load: dtoverlay=goodix,<param>=<val>
14401442
Params: interrupt GPIO used for interrupt (default 4)
14411443
reset GPIO used for reset (default 17)
1444+
i2c-path Override I2C path to allow for i2c-gpio buses
14421445

14431446

14441447
Name: googlevoicehat-soundcard
@@ -1730,6 +1733,7 @@ Params: addr I2C address of PCF8574
17301733
display_height Height of the display in characters (default 2)
17311734

17321735
display_width Width of the display in characters (default 16)
1736+
i2c-path Override I2C path to allow for i2c-gpio buses
17331737

17341738

17351739
Name: hd44780-lcd
@@ -2095,6 +2099,8 @@ Params: addr Sets the address for the fan controller. Note
20952099
i2c6 Choose the I2C6 bus (configure with the i2c6
20962100
overlay - BCM2711 only)
20972101

2102+
i2c-path Override I2C path to allow for i2c-gpio buses
2103+
20982104
minpwm PWM setting for the fan when the SoC is below
20992105
mintemp (range 0-255. default 0)
21002106
maxpwm PWM setting for the fan when the SoC is above
@@ -2165,6 +2171,8 @@ Params: pca9542 Select the NXP PCA9542 device
21652171
i2c6 Choose the I2C6 bus (configure with the i2c6
21662172
overlay - BCM2711 only)
21672173

2174+
i2c-path Override I2C path to allow for i2c-gpio buses
2175+
21682176
disconnect_on_idle Force the mux to disconnect all child buses
21692177
after every transaction.
21702178

@@ -2186,6 +2194,7 @@ Params: addr I2C address of PCA9685A (default 0x40)
21862194
overlay - BCM2711 only)
21872195
i2c6 Choose the I2C6 bus (configure with the i2c6
21882196
overlay - BCM2711 only)
2197+
i2c-path Override I2C path to allow for i2c-gpio buses
21892198

21902199

21912200
Name: i2c-rtc
@@ -2255,6 +2264,8 @@ Params: abx80x Select one of the ABx80x family:
22552264
i2c6 Choose the I2C6 bus (configure with the i2c6
22562265
overlay - BCM2711 only)
22572266

2267+
i2c-path Override I2C path to allow for i2c-gpio buses
2268+
22582269
addr Sets the address for the RTC. Note that the
22592270
device must be configured to use the specified
22602271
address.
@@ -2519,6 +2530,8 @@ Params: addr Set the address for the ADT7410, BH1750, BME280,
25192530
i2c6 Choose the I2C6 bus (configure with the i2c6
25202531
overlay - BCM2711 only)
25212532

2533+
i2c-path Override I2C path to allow for i2c-gpio buses
2534+
25222535

25232536
Name: i2c0
25242537
Info: Change i2c0 pin usage. Not all pin combinations are usable on all
@@ -2661,6 +2674,7 @@ Params: interrupt GPIO used for interrupt (default 4)
26612674
touchscreen (in pixels)
26622675
sizey Touchscreen size y, vertical resolution of
26632676
touchscreen (in pixels)
2677+
i2c-path Override I2C path to allow for i2c-gpio buses
26642678

26652679

26662680
Name: imx219
@@ -3138,6 +3152,7 @@ Params: gpiopin Gpio pin connected to the INTA output of the
31383152
overlay - BCM2711 only)
31393153
i2c6 Choose the I2C6 bus (configure with the i2c6
31403154
overlay - BCM2711 only)
3155+
i2c-path Override I2C path to allow for i2c-gpio buses
31413156

31423157

31433158
Name: mcp23s17
@@ -3587,6 +3602,17 @@ Params: addr I2C address of expander. Default 0x20.
35873602
cat9554 Select the Onnn CAT9554 (8 bit)
35883603
pca9654 Select the Onnn PCA9654 (8 bit)
35893604
xra1202 Select the Exar XRA1202 (8 bit)
3605+
i2c0 Choose the I2C0 bus on GPIOs 0&1
3606+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
3607+
i2c3 Choose the I2C3 bus (configure with the i2c3
3608+
overlay - BCM2711 only)
3609+
i2c4 Choose the I2C3 bus (configure with the i2c3
3610+
overlay - BCM2711 only)
3611+
i2c5 Choose the I2C5 bus (configure with the i2c4
3612+
overlay - BCM2711 only)
3613+
i2c6 Choose the I2C6 bus (configure with the i2c6
3614+
overlay - BCM2711 only)
3615+
i2c-path Override I2C path to allow for i2c-gpio buses
35903616

35913617

35923618
Name: pcf857x
@@ -3598,6 +3624,17 @@ Params: addr I2C address of expander. Default
35983624
pcf8574a Select the NXP PCF8574A (8 bit)
35993625
pcf8575 Select the NXP PCF8575 (16 bit)
36003626
pca8574 Select the NXP PCA8574 (8 bit)
3627+
i2c0 Choose the I2C0 bus on GPIOs 0&1
3628+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
3629+
i2c3 Choose the I2C3 bus (configure with the i2c3
3630+
overlay - BCM2711 only)
3631+
i2c4 Choose the I2C3 bus (configure with the i2c3
3632+
overlay - BCM2711 only)
3633+
i2c5 Choose the I2C5 bus (configure with the i2c4
3634+
overlay - BCM2711 only)
3635+
i2c6 Choose the I2C6 bus (configure with the i2c6
3636+
overlay - BCM2711 only)
3637+
i2c-path Override I2C path to allow for i2c-gpio buses
36013638

36023639

36033640
Name: pcie-32bit-dma
@@ -4257,6 +4294,17 @@ Load: dtoverlay=sc16is750-i2c,<param>=<val>
42574294
Params: int_pin GPIO used for IRQ (default 24)
42584295
addr Address (default 0x48)
42594296
xtal On-board crystal frequency (default 14745600)
4297+
i2c0 Choose the I2C0 bus on GPIOs 0&1
4298+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
4299+
i2c3 Choose the I2C3 bus (configure with the i2c3
4300+
overlay - BCM2711 only)
4301+
i2c4 Choose the I2C4 bus (configure with the i2c4
4302+
overlay - BCM2711 only)
4303+
i2c5 Choose the I2C5 bus (configure with the i2c5
4304+
overlay - BCM2711 only)
4305+
i2c6 Choose the I2C6 bus (configure with the i2c6
4306+
overlay - BCM2711 only)
4307+
i2c-path Override I2C path to allow for i2c-gpio buses
42604308

42614309

42624310
Name: sc16is750-spi0
@@ -4275,6 +4323,17 @@ Load: dtoverlay=sc16is752-i2c,<param>=<val>
42754323
Params: int_pin GPIO used for IRQ (default 24)
42764324
addr Address (default 0x48)
42774325
xtal On-board crystal frequency (default 14745600)
4326+
i2c0 Choose the I2C0 bus on GPIOs 0&1
4327+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
4328+
i2c3 Choose the I2C3 bus (configure with the i2c3
4329+
overlay - BCM2711 only)
4330+
i2c4 Choose the I2C4 bus (configure with the i2c4
4331+
overlay - BCM2711 only)
4332+
i2c5 Choose the I2C5 bus (configure with the i2c5
4333+
overlay - BCM2711 only)
4334+
i2c6 Choose the I2C6 bus (configure with the i2c6
4335+
overlay - BCM2711 only)
4336+
i2c-path Override I2C path to allow for i2c-gpio buses
42784337

42794338

42804339
Name: sc16is752-spi0

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,7 @@
131131
<&frag100>, "target-path=i2c5";
132132
i2c6 = <&frag100>, "target?=0",
133133
<&frag100>, "target-path=i2c6";
134+
i2c-path = <&frag100>, "target?=0",
135+
<&frag100>, "target-path";
134136
};
135137
};

arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
i2c6 = <&ts_i2c_frag>, "target?=0",
4242
<&ts_i2c_frag>, "target-path=i2c6",
4343
<0>,"-0-1";
44+
i2c-path = <&ts_i2c_frag>, "target?=0",
45+
<&ts_i2c_frag>, "target-path",
46+
<0>,"-0-1";
4447
addr = <&ft5406>,"reg:0";
4548
};
4649
};

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
};
1717
};
1818

19-
fragment@1 {
19+
i2c_frag: fragment@1 {
2020
target = <&i2c1>;
2121
__overlay__ {
2222
#address-cells = <1>;
@@ -42,5 +42,7 @@
4242
<&gt9271>,"irq-gpios:4";
4343
reset = <&goodix_pins>,"brcm,pins:4",
4444
<&gt9271>,"reset-gpios:4";
45+
i2c-path = <&i2c_frag>, "target?=0",
46+
<&i2c_frag>, "target-path";
4547
};
4648
};

arch/arm/boot/dts/overlays/hd44780-i2c-lcd-overlay.dts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/ {
55
compatible = "brcm,bcm2835";
66

7-
fragment@0 {
7+
i2c_frag: fragment@0 {
88
target = <&i2c_arm>;
99
__overlay__ {
1010
status = "okay";
@@ -52,6 +52,8 @@
5252
display_height = <&lcd_screen>,"display-height-chars:0";
5353
display_width = <&lcd_screen>,"display-width-chars:0";
5454
addr = <&pcf857x>,"reg:0";
55+
i2c-path = <&i2c_frag>, "target?=0",
56+
<&i2c_frag>, "target-path";
5557
};
5658

5759
};

arch/arm/boot/dts/overlays/i2c-fan-overlay.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
<&frag100>, "target-path=i2c5";
9494
i2c6 = <&frag100>, "target?=0",
9595
<&frag100>, "target-path=i2c6";
96+
i2c-path = <&frag100>, "target?=0",
97+
<&frag100>, "target-path";
9698
addr = <&emc2301>,"reg:0";
9799
minpwm = <&emc2301>,"emc2305,pwm-min.0";
98100
maxpwm = <&emc2301>,"emc2305,pwm-max.0";

arch/arm/boot/dts/overlays/i2c-mux-overlay.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@
175175
<&frag100>, "target-path=i2c5";
176176
i2c6 = <&frag100>, "target?=0",
177177
<&frag100>, "target-path=i2c6";
178+
i2c-path = <&frag100>, "target?=0",
179+
<&frag100>, "target-path";
178180
disconnect_on_idle =
179181
<&pca9542>,"idle-state:0=", <MUX_IDLE_DISCONNECT>,
180182
<&pca9545>,"idle-state:0=", <MUX_IDLE_DISCONNECT>,

arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,7 @@
5757
<&frag100>, "target-path=i2c5";
5858
i2c6 = <&frag100>, "target?=0",
5959
<&frag100>, "target-path=i2c6";
60+
i2c-path = <&frag100>, "target?=0",
61+
<&frag100>, "target-path";
6062
};
6163
};

arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@
3838
<&frag100>, "target-path=i2c5";
3939
i2c6 = <&frag100>, "target?=0",
4040
<&frag100>, "target-path=i2c6";
41+
i2c-path = <&frag100>, "target?=0",
42+
<&frag100>, "target-path";
4143
};
4244
};

arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@
3838
<&frag100>, "target-path=i2c5";
3939
i2c6 = <&frag100>, "target?=0",
4040
<&frag100>, "target-path=i2c6";
41+
i2c-path = <&frag100>, "target?=0",
42+
<&frag100>, "target-path";
4143
};
4244
};

0 commit comments

Comments
 (0)