Skip to content

Commit 42e8a83

Browse files
committed
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 42e8a83

16 files changed

+201
-8
lines changed

arch/arm/boot/dts/overlays/README

Lines changed: 59 additions & 1 deletion
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,14 +2171,16 @@ 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

21712179

21722180
[ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ]
21732181

21742182

2175-
Name: i2c-pwm-pca9685a
2183+
Name: i2c-pwm-9685a
21762184
Info: Adds support for an NXP PCA9685A I2C PWM controller on i2c_arm
21772185
Load: dtoverlay=i2c-pwm-pca9685a,<param>=<val>
21782186
Params: addr I2C address of PCA9685A (default 0x40)
@@ -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,7 @@ 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
25222534

25232535
Name: i2c0
25242536
Info: Change i2c0 pin usage. Not all pin combinations are usable on all
@@ -2661,6 +2673,7 @@ Params: interrupt GPIO used for interrupt (default 4)
26612673
touchscreen (in pixels)
26622674
sizey Touchscreen size y, vertical resolution of
26632675
touchscreen (in pixels)
2676+
i2c-path Override I2C path to allow for i2c-gpio buses
26642677

26652678

26662679
Name: imx219
@@ -3138,6 +3151,7 @@ Params: gpiopin Gpio pin connected to the INTA output of the
31383151
overlay - BCM2711 only)
31393152
i2c6 Choose the I2C6 bus (configure with the i2c6
31403153
overlay - BCM2711 only)
3154+
i2c-path Override I2C path to allow for i2c-gpio buses
31413155

31423156

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

35913616

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

36023638

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

42614308

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

42794337

42804338
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)