Skip to content

Commit 4d2b6ff

Browse files
6by9popcornmix
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 0fdd13b commit 4d2b6ff

16 files changed

+201
-7
lines changed

Diff for: arch/arm/boot/dts/overlays/README

+59
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).
@@ -1253,6 +1254,7 @@ Params: sizex Touchscreen size x (default 800)
12531254
addr Sets the address for the touch controller. Note
12541255
that the device must be configured to use the
12551256
specified address.
1257+
i2c-path Override I2C path to allow for i2c-gpio buses
12561258

12571259

12581260
Name: enc28j60
@@ -1454,6 +1456,7 @@ Info: Enables I2C connected Goodix gt9271 multiple touch controller using
14541456
Load: dtoverlay=goodix,<param>=<val>
14551457
Params: interrupt GPIO used for interrupt (default 4)
14561458
reset GPIO used for reset (default 17)
1459+
i2c-path Override I2C path to allow for i2c-gpio buses
14571460

14581461

14591462
Name: googlevoicehat-soundcard
@@ -1745,6 +1748,7 @@ Params: addr I2C address of PCF8574
17451748
display_height Height of the display in characters (default 2)
17461749

17471750
display_width Width of the display in characters (default 16)
1751+
i2c-path Override I2C path to allow for i2c-gpio buses
17481752

17491753

17501754
Name: hd44780-lcd
@@ -2110,6 +2114,8 @@ Params: addr Sets the address for the fan controller. Note
21102114
i2c6 Choose the I2C6 bus (configure with the i2c6
21112115
overlay - BCM2711 only)
21122116

2117+
i2c-path Override I2C path to allow for i2c-gpio buses
2118+
21132119
minpwm PWM setting for the fan when the SoC is below
21142120
mintemp (range 0-255. default 0)
21152121
maxpwm PWM setting for the fan when the SoC is above
@@ -2180,6 +2186,8 @@ Params: pca9542 Select the NXP PCA9542 device
21802186
i2c6 Choose the I2C6 bus (configure with the i2c6
21812187
overlay - BCM2711 only)
21822188

2189+
i2c-path Override I2C path to allow for i2c-gpio buses
2190+
21832191
disconnect_on_idle Force the mux to disconnect all child buses
21842192
after every transaction.
21852193

@@ -2201,6 +2209,7 @@ Params: addr I2C address of PCA9685A (default 0x40)
22012209
overlay - BCM2711 only)
22022210
i2c6 Choose the I2C6 bus (configure with the i2c6
22032211
overlay - BCM2711 only)
2212+
i2c-path Override I2C path to allow for i2c-gpio buses
22042213

22052214

22062215
Name: i2c-rtc
@@ -2270,6 +2279,8 @@ Params: abx80x Select one of the ABx80x family:
22702279
i2c6 Choose the I2C6 bus (configure with the i2c6
22712280
overlay - BCM2711 only)
22722281

2282+
i2c-path Override I2C path to allow for i2c-gpio buses
2283+
22732284
addr Sets the address for the RTC. Note that the
22742285
device must be configured to use the specified
22752286
address.
@@ -2551,6 +2562,8 @@ Params: addr Set the address for the ADT7410, AS73211,
25512562
i2c6 Choose the I2C6 bus (configure with the i2c6
25522563
overlay - BCM2711 only)
25532564

2565+
i2c-path Override I2C path to allow for i2c-gpio buses
2566+
25542567

25552568
Name: i2c0
25562569
Info: Change i2c0 pin usage. Not all pin combinations are usable on all
@@ -2693,6 +2706,7 @@ Params: interrupt GPIO used for interrupt (default 4)
26932706
touchscreen (in pixels)
26942707
sizey Touchscreen size y, vertical resolution of
26952708
touchscreen (in pixels)
2709+
i2c-path Override I2C path to allow for i2c-gpio buses
26962710

26972711

26982712
Name: imx219
@@ -3170,6 +3184,7 @@ Params: gpiopin Gpio pin connected to the INTA output of the
31703184
overlay - BCM2711 only)
31713185
i2c6 Choose the I2C6 bus (configure with the i2c6
31723186
overlay - BCM2711 only)
3187+
i2c-path Override I2C path to allow for i2c-gpio buses
31733188

31743189

31753190
Name: mcp23s17
@@ -3619,6 +3634,17 @@ Params: addr I2C address of expander. Default 0x20.
36193634
cat9554 Select the Onnn CAT9554 (8 bit)
36203635
pca9654 Select the Onnn PCA9654 (8 bit)
36213636
xra1202 Select the Exar XRA1202 (8 bit)
3637+
i2c0 Choose the I2C0 bus on GPIOs 0&1
3638+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
3639+
i2c3 Choose the I2C3 bus (configure with the i2c3
3640+
overlay - BCM2711 only)
3641+
i2c4 Choose the I2C3 bus (configure with the i2c3
3642+
overlay - BCM2711 only)
3643+
i2c5 Choose the I2C5 bus (configure with the i2c4
3644+
overlay - BCM2711 only)
3645+
i2c6 Choose the I2C6 bus (configure with the i2c6
3646+
overlay - BCM2711 only)
3647+
i2c-path Override I2C path to allow for i2c-gpio buses
36223648

36233649

36243650
Name: pcf857x
@@ -3630,6 +3656,17 @@ Params: addr I2C address of expander. Default
36303656
pcf8574a Select the NXP PCF8574A (8 bit)
36313657
pcf8575 Select the NXP PCF8575 (16 bit)
36323658
pca8574 Select the NXP PCA8574 (8 bit)
3659+
i2c0 Choose the I2C0 bus on GPIOs 0&1
3660+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
3661+
i2c3 Choose the I2C3 bus (configure with the i2c3
3662+
overlay - BCM2711 only)
3663+
i2c4 Choose the I2C3 bus (configure with the i2c3
3664+
overlay - BCM2711 only)
3665+
i2c5 Choose the I2C5 bus (configure with the i2c4
3666+
overlay - BCM2711 only)
3667+
i2c6 Choose the I2C6 bus (configure with the i2c6
3668+
overlay - BCM2711 only)
3669+
i2c-path Override I2C path to allow for i2c-gpio buses
36333670

36343671

36353672
Name: pcie-32bit-dma
@@ -4291,6 +4328,17 @@ Load: dtoverlay=sc16is750-i2c,<param>=<val>
42914328
Params: int_pin GPIO used for IRQ (default 24)
42924329
addr Address (default 0x48)
42934330
xtal On-board crystal frequency (default 14745600)
4331+
i2c0 Choose the I2C0 bus on GPIOs 0&1
4332+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
4333+
i2c3 Choose the I2C3 bus (configure with the i2c3
4334+
overlay - BCM2711 only)
4335+
i2c4 Choose the I2C4 bus (configure with the i2c4
4336+
overlay - BCM2711 only)
4337+
i2c5 Choose the I2C5 bus (configure with the i2c5
4338+
overlay - BCM2711 only)
4339+
i2c6 Choose the I2C6 bus (configure with the i2c6
4340+
overlay - BCM2711 only)
4341+
i2c-path Override I2C path to allow for i2c-gpio buses
42944342

42954343

42964344
Name: sc16is750-spi0
@@ -4309,6 +4357,17 @@ Load: dtoverlay=sc16is752-i2c,<param>=<val>
43094357
Params: int_pin GPIO used for IRQ (default 24)
43104358
addr Address (default 0x48)
43114359
xtal On-board crystal frequency (default 14745600)
4360+
i2c0 Choose the I2C0 bus on GPIOs 0&1
4361+
i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
4362+
i2c3 Choose the I2C3 bus (configure with the i2c3
4363+
overlay - BCM2711 only)
4364+
i2c4 Choose the I2C4 bus (configure with the i2c4
4365+
overlay - BCM2711 only)
4366+
i2c5 Choose the I2C5 bus (configure with the i2c5
4367+
overlay - BCM2711 only)
4368+
i2c6 Choose the I2C6 bus (configure with the i2c6
4369+
overlay - BCM2711 only)
4370+
i2c-path Override I2C path to allow for i2c-gpio buses
43124371

43134372

43144373
Name: sc16is752-spi0

Diff for: arch/arm/boot/dts/overlays/ads1115-overlay.dts

+2
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
};

Diff for: arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts

+3
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
};

Diff for: arch/arm/boot/dts/overlays/goodix-overlay.dts

+3-1
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
};

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

+3-1
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
};

Diff for: arch/arm/boot/dts/overlays/i2c-fan-overlay.dts

+2
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";

Diff for: arch/arm/boot/dts/overlays/i2c-mux-overlay.dts

+2
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>,

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

+2
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
};

Diff for: arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts

+2
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
};

Diff for: arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts

+2
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
};

Diff for: arch/arm/boot/dts/overlays/ilitek251x-overlay.dts

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
};
1717
};
1818

19-
fragment@1 {
19+
frag1: fragment@1 {
2020
target = <&i2c1>;
2121
__overlay__ {
2222
#address-cells = <1>;
@@ -41,5 +41,7 @@
4141
<&ili251x>,"interrupts:0";
4242
sizex = <&ili251x>,"touchscreen-size-x:0";
4343
sizey = <&ili251x>,"touchscreen-size-y:0";
44+
i2c-path = <&frag1>, "target?=0",
45+
<&frag1>, "target-path";
4446
};
4547
};

Diff for: arch/arm/boot/dts/overlays/mcp23017-overlay.dts

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@
9898
<&frag100>, "target-path=i2c5";
9999
i2c6 = <&frag100>, "target?=0",
100100
<&frag100>, "target-path=i2c6";
101+
i2c-path = <&frag100>, "target?=0",
102+
<&frag100>, "target-path";
101103
};
102104
};
103105

Diff for: arch/arm/boot/dts/overlays/pca953x-overlay.dts

+29-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/{
66
compatible = "brcm,bcm2835";
77

8-
fragment@0 {
8+
frag0: fragment@0 {
99
target = <&i2c_arm>;
1010
__overlay__ {
1111
#address-cells = <1>;
@@ -204,6 +204,20 @@
204204
};
205205
};
206206

207+
fragment@100 {
208+
target = <&i2c0if>;
209+
__dormant__ {
210+
status = "okay";
211+
};
212+
};
213+
214+
fragment@101 {
215+
target = <&i2c0mux>;
216+
__dormant__ {
217+
status = "okay";
218+
};
219+
};
220+
207221
__overrides__ {
208222
addr = <&pca>,"reg:0";
209223
pca6416 = <0>, "+1";
@@ -236,5 +250,19 @@
236250
cat9554 = <0>, "+28";
237251
pca9654 = <0>, "+29";
238252
xra1202 = <0>, "+30";
253+
i2c0 = <&frag0>, "target:0=",<&i2c0>,
254+
<0>,"+100+101";
255+
i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
256+
<0>,"+100+101";
257+
i2c3 = <&frag0>, "target?=0",
258+
<&frag0>, "target-path=i2c3";
259+
i2c4 = <&frag0>, "target?=0",
260+
<&frag0>, "target-path=i2c4";
261+
i2c5 = <&frag0>, "target?=0",
262+
<&frag0>, "target-path=i2c5";
263+
i2c6 = <&frag0>, "target?=0",
264+
<&frag0>, "target-path=i2c6";
265+
i2c-path = <&frag0>, "target?=0",
266+
<&frag0>, "target-path";
239267
};
240268
};

Diff for: arch/arm/boot/dts/overlays/pcf857x-overlay.dts

+29-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/ {
77
compatible = "brcm,bcm2835";
88

9-
fragment@0 {
9+
frag0: fragment@0 {
1010
target = <&i2c_arm>;
1111
__overlay__ {
1212
#address-cells = <1>;
@@ -22,11 +22,39 @@
2222
};
2323
};
2424

25+
fragment@100 {
26+
target = <&i2c0if>;
27+
__dormant__ {
28+
status = "okay";
29+
};
30+
};
31+
32+
fragment@101 {
33+
target = <&i2c0mux>;
34+
__dormant__ {
35+
status = "okay";
36+
};
37+
};
38+
2539
__overrides__ {
2640
pcf8574 = <&pcf857x>,"compatible=nxp,pcf8574", <&pcf857x>,"reg:0=0x20";
2741
pcf8574a = <&pcf857x>,"compatible=nxp,pcf8574a", <&pcf857x>,"reg:0=0x38";
2842
pcf8575 = <&pcf857x>,"compatible=nxp,pcf8575", <&pcf857x>,"reg:0=0x20";
2943
pca8574 = <&pcf857x>,"compatible=nxp,pca8574", <&pcf857x>,"reg:0=0x20";
3044
addr = <&pcf857x>,"reg:0";
45+
i2c0 = <&frag0>, "target:0=",<&i2c0>,
46+
<0>,"+100+101";
47+
i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
48+
<0>,"+100+101";
49+
i2c3 = <&frag0>, "target?=0",
50+
<&frag0>, "target-path=i2c3";
51+
i2c4 = <&frag0>, "target?=0",
52+
<&frag0>, "target-path=i2c4";
53+
i2c5 = <&frag0>, "target?=0",
54+
<&frag0>, "target-path=i2c5";
55+
i2c6 = <&frag0>, "target?=0",
56+
<&frag0>, "target-path=i2c6";
57+
i2c-path = <&frag0>, "target?=0",
58+
<&frag0>, "target-path";
3159
};
3260
};

0 commit comments

Comments
 (0)