1 From b75fd2a9385e1358fa82218184e73513f9a5e57f Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 16 Dec 2024 15:11:08 +0000
4 Subject: [PATCH] dtoverlays: Add override for target-path on I2C overlays
6 To allow for attaching any of the standard overlays to a
7 bitbashed i2c-gpio bus, allow specifying the target path for
11 https://forums.raspberrypi.com/viewtopic.php?t=381059
14 dtoverlay=i2c-gpio,i2c_gpio_sda=10,i2c_gpio_scl=11
15 dtoverlay=mcp23017,i2c-path=/i2c@0
16 dtoverlay=i2c-gpio,i2c_gpio_sda=12,i2c_gpio_scl=13,bus=3
17 dtoverlay=mcp23017,i2c-path=/i2c@3
19 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
21 arch/arm/boot/dts/overlays/README | 59 +++++++++++++++++++
22 .../arm/boot/dts/overlays/ads1115-overlay.dts | 2 +
23 .../boot/dts/overlays/edt-ft5406-overlay.dts | 3 +
24 arch/arm/boot/dts/overlays/goodix-overlay.dts | 4 +-
25 .../dts/overlays/hd44780-i2c-lcd-overlay.dts | 4 +-
26 .../arm/boot/dts/overlays/i2c-fan-overlay.dts | 2 +
27 .../arm/boot/dts/overlays/i2c-mux-overlay.dts | 2 +
28 .../dts/overlays/i2c-pwm-pca9685a-overlay.dts | 2 +
29 .../arm/boot/dts/overlays/i2c-rtc-overlay.dts | 2 +
30 .../boot/dts/overlays/i2c-sensor-overlay.dts | 2 +
31 .../boot/dts/overlays/ilitek251x-overlay.dts | 4 +-
32 .../boot/dts/overlays/mcp23017-overlay.dts | 2 +
33 .../arm/boot/dts/overlays/pca953x-overlay.dts | 30 +++++++++-
34 .../arm/boot/dts/overlays/pcf857x-overlay.dts | 30 +++++++++-
35 .../dts/overlays/sc16is750-i2c-overlay.dts | 30 +++++++++-
36 .../dts/overlays/sc16is752-i2c-overlay.dts | 30 +++++++++-
37 16 files changed, 201 insertions(+), 7 deletions(-)
39 --- a/arch/arm/boot/dts/overlays/README
40 +++ b/arch/arm/boot/dts/overlays/README
41 @@ -555,6 +555,7 @@ Params: addr I2C bus
42 overlay - BCM2711 only)
43 i2c6 Choose the I2C6 bus (configure with the i2c6
44 overlay - BCM2711 only)
45 + i2c-path Override I2C path to allow for i2c-gpio buses
47 Channel parameters can be set for each enabled channel.
48 A maximum of 4 channels can be enabled (letters a thru d).
49 @@ -1238,6 +1239,7 @@ Params: sizex Touchscr
50 addr Sets the address for the touch controller. Note
51 that the device must be configured to use the
53 + i2c-path Override I2C path to allow for i2c-gpio buses
57 @@ -1439,6 +1441,7 @@ Info: Enables I2C connected Goodix gt9
58 Load: dtoverlay=goodix,<param>=<val>
59 Params: interrupt GPIO used for interrupt (default 4)
60 reset GPIO used for reset (default 17)
61 + i2c-path Override I2C path to allow for i2c-gpio buses
64 Name: googlevoicehat-soundcard
65 @@ -1730,6 +1733,7 @@ Params: addr I2C addr
66 display_height Height of the display in characters (default 2)
68 display_width Width of the display in characters (default 16)
69 + i2c-path Override I2C path to allow for i2c-gpio buses
73 @@ -2095,6 +2099,8 @@ Params: addr Sets the
74 i2c6 Choose the I2C6 bus (configure with the i2c6
75 overlay - BCM2711 only)
77 + i2c-path Override I2C path to allow for i2c-gpio buses
79 minpwm PWM setting for the fan when the SoC is below
80 mintemp (range 0-255. default 0)
81 maxpwm PWM setting for the fan when the SoC is above
82 @@ -2165,6 +2171,8 @@ Params: pca9542 Select t
83 i2c6 Choose the I2C6 bus (configure with the i2c6
84 overlay - BCM2711 only)
86 + i2c-path Override I2C path to allow for i2c-gpio buses
88 disconnect_on_idle Force the mux to disconnect all child buses
89 after every transaction.
91 @@ -2186,6 +2194,7 @@ Params: addr I2C addr
92 overlay - BCM2711 only)
93 i2c6 Choose the I2C6 bus (configure with the i2c6
94 overlay - BCM2711 only)
95 + i2c-path Override I2C path to allow for i2c-gpio buses
99 @@ -2255,6 +2264,8 @@ Params: abx80x Select o
100 i2c6 Choose the I2C6 bus (configure with the i2c6
101 overlay - BCM2711 only)
103 + i2c-path Override I2C path to allow for i2c-gpio buses
105 addr Sets the address for the RTC. Note that the
106 device must be configured to use the specified
108 @@ -2519,6 +2530,8 @@ Params: addr Set the
109 i2c6 Choose the I2C6 bus (configure with the i2c6
110 overlay - BCM2711 only)
112 + i2c-path Override I2C path to allow for i2c-gpio buses
116 Info: Change i2c0 pin usage. Not all pin combinations are usable on all
117 @@ -2661,6 +2674,7 @@ Params: interrupt GPIO use
118 touchscreen (in pixels)
119 sizey Touchscreen size y, vertical resolution of
120 touchscreen (in pixels)
121 + i2c-path Override I2C path to allow for i2c-gpio buses
125 @@ -3138,6 +3152,7 @@ Params: gpiopin Gpio pin
126 overlay - BCM2711 only)
127 i2c6 Choose the I2C6 bus (configure with the i2c6
128 overlay - BCM2711 only)
129 + i2c-path Override I2C path to allow for i2c-gpio buses
133 @@ -3587,6 +3602,17 @@ Params: addr I2C addr
134 cat9554 Select the Onnn CAT9554 (8 bit)
135 pca9654 Select the Onnn PCA9654 (8 bit)
136 xra1202 Select the Exar XRA1202 (8 bit)
137 + i2c0 Choose the I2C0 bus on GPIOs 0&1
138 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
139 + i2c3 Choose the I2C3 bus (configure with the i2c3
140 + overlay - BCM2711 only)
141 + i2c4 Choose the I2C3 bus (configure with the i2c3
142 + overlay - BCM2711 only)
143 + i2c5 Choose the I2C5 bus (configure with the i2c4
144 + overlay - BCM2711 only)
145 + i2c6 Choose the I2C6 bus (configure with the i2c6
146 + overlay - BCM2711 only)
147 + i2c-path Override I2C path to allow for i2c-gpio buses
151 @@ -3598,6 +3624,17 @@ Params: addr I2C addr
152 pcf8574a Select the NXP PCF8574A (8 bit)
153 pcf8575 Select the NXP PCF8575 (16 bit)
154 pca8574 Select the NXP PCA8574 (8 bit)
155 + i2c0 Choose the I2C0 bus on GPIOs 0&1
156 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
157 + i2c3 Choose the I2C3 bus (configure with the i2c3
158 + overlay - BCM2711 only)
159 + i2c4 Choose the I2C3 bus (configure with the i2c3
160 + overlay - BCM2711 only)
161 + i2c5 Choose the I2C5 bus (configure with the i2c4
162 + overlay - BCM2711 only)
163 + i2c6 Choose the I2C6 bus (configure with the i2c6
164 + overlay - BCM2711 only)
165 + i2c-path Override I2C path to allow for i2c-gpio buses
169 @@ -4257,6 +4294,17 @@ Load: dtoverlay=sc16is750-i2c,<param>=
170 Params: int_pin GPIO used for IRQ (default 24)
171 addr Address (default 0x48)
172 xtal On-board crystal frequency (default 14745600)
173 + i2c0 Choose the I2C0 bus on GPIOs 0&1
174 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
175 + i2c3 Choose the I2C3 bus (configure with the i2c3
176 + overlay - BCM2711 only)
177 + i2c4 Choose the I2C4 bus (configure with the i2c4
178 + overlay - BCM2711 only)
179 + i2c5 Choose the I2C5 bus (configure with the i2c5
180 + overlay - BCM2711 only)
181 + i2c6 Choose the I2C6 bus (configure with the i2c6
182 + overlay - BCM2711 only)
183 + i2c-path Override I2C path to allow for i2c-gpio buses
187 @@ -4275,6 +4323,17 @@ Load: dtoverlay=sc16is752-i2c,<param>=
188 Params: int_pin GPIO used for IRQ (default 24)
189 addr Address (default 0x48)
190 xtal On-board crystal frequency (default 14745600)
191 + i2c0 Choose the I2C0 bus on GPIOs 0&1
192 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
193 + i2c3 Choose the I2C3 bus (configure with the i2c3
194 + overlay - BCM2711 only)
195 + i2c4 Choose the I2C4 bus (configure with the i2c4
196 + overlay - BCM2711 only)
197 + i2c5 Choose the I2C5 bus (configure with the i2c5
198 + overlay - BCM2711 only)
199 + i2c6 Choose the I2C6 bus (configure with the i2c6
200 + overlay - BCM2711 only)
201 + i2c-path Override I2C path to allow for i2c-gpio buses
205 --- a/arch/arm/boot/dts/overlays/ads1115-overlay.dts
206 +++ b/arch/arm/boot/dts/overlays/ads1115-overlay.dts
208 <&frag100>, "target-path=i2c5";
209 i2c6 = <&frag100>, "target?=0",
210 <&frag100>, "target-path=i2c6";
211 + i2c-path = <&frag100>, "target?=0",
212 + <&frag100>, "target-path";
215 --- a/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts
216 +++ b/arch/arm/boot/dts/overlays/edt-ft5406-overlay.dts
218 i2c6 = <&ts_i2c_frag>, "target?=0",
219 <&ts_i2c_frag>, "target-path=i2c6",
221 + i2c-path = <&ts_i2c_frag>, "target?=0",
222 + <&ts_i2c_frag>, "target-path",
224 addr = <&ft5406>,"reg:0";
227 --- a/arch/arm/boot/dts/overlays/goodix-overlay.dts
228 +++ b/arch/arm/boot/dts/overlays/goodix-overlay.dts
234 + i2c_frag: fragment@1 {
237 #address-cells = <1>;
239 <>9271>,"irq-gpios:4";
240 reset = <&goodix_pins>,"brcm,pins:4",
241 <>9271>,"reset-gpios:4";
242 + i2c-path = <&i2c_frag>, "target?=0",
243 + <&i2c_frag>, "target-path";
246 --- a/arch/arm/boot/dts/overlays/hd44780-i2c-lcd-overlay.dts
247 +++ b/arch/arm/boot/dts/overlays/hd44780-i2c-lcd-overlay.dts
250 compatible = "brcm,bcm2835";
253 + i2c_frag: fragment@0 {
258 display_height = <&lcd_screen>,"display-height-chars:0";
259 display_width = <&lcd_screen>,"display-width-chars:0";
260 addr = <&pcf857x>,"reg:0";
261 + i2c-path = <&i2c_frag>, "target?=0",
262 + <&i2c_frag>, "target-path";
266 --- a/arch/arm/boot/dts/overlays/i2c-fan-overlay.dts
267 +++ b/arch/arm/boot/dts/overlays/i2c-fan-overlay.dts
269 <&frag100>, "target-path=i2c5";
270 i2c6 = <&frag100>, "target?=0",
271 <&frag100>, "target-path=i2c6";
272 + i2c-path = <&frag100>, "target?=0",
273 + <&frag100>, "target-path";
274 addr = <&emc2301>,"reg:0";
275 minpwm = <&emc2301>,"emc2305,pwm-min.0";
276 maxpwm = <&emc2301>,"emc2305,pwm-max.0";
277 --- a/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
278 +++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
280 <&frag100>, "target-path=i2c5";
281 i2c6 = <&frag100>, "target?=0",
282 <&frag100>, "target-path=i2c6";
283 + i2c-path = <&frag100>, "target?=0",
284 + <&frag100>, "target-path";
286 <&pca9542>,"idle-state:0=", <MUX_IDLE_DISCONNECT>,
287 <&pca9545>,"idle-state:0=", <MUX_IDLE_DISCONNECT>,
288 --- a/arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
289 +++ b/arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
291 <&frag100>, "target-path=i2c5";
292 i2c6 = <&frag100>, "target?=0",
293 <&frag100>, "target-path=i2c6";
294 + i2c-path = <&frag100>, "target?=0",
295 + <&frag100>, "target-path";
298 --- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
299 +++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
301 <&frag100>, "target-path=i2c5";
302 i2c6 = <&frag100>, "target?=0",
303 <&frag100>, "target-path=i2c6";
304 + i2c-path = <&frag100>, "target?=0",
305 + <&frag100>, "target-path";
308 --- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
309 +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts
311 <&frag100>, "target-path=i2c5";
312 i2c6 = <&frag100>, "target?=0",
313 <&frag100>, "target-path=i2c6";
314 + i2c-path = <&frag100>, "target?=0",
315 + <&frag100>, "target-path";
318 --- a/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
319 +++ b/arch/arm/boot/dts/overlays/ilitek251x-overlay.dts
325 + frag1: fragment@1 {
328 #address-cells = <1>;
330 <&ili251x>,"interrupts:0";
331 sizex = <&ili251x>,"touchscreen-size-x:0";
332 sizey = <&ili251x>,"touchscreen-size-y:0";
333 + i2c-path = <&frag1>, "target?=0",
334 + <&frag1>, "target-path";
337 --- a/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
338 +++ b/arch/arm/boot/dts/overlays/mcp23017-overlay.dts
340 <&frag100>, "target-path=i2c5";
341 i2c6 = <&frag100>, "target?=0",
342 <&frag100>, "target-path=i2c6";
343 + i2c-path = <&frag100>, "target?=0",
344 + <&frag100>, "target-path";
348 --- a/arch/arm/boot/dts/overlays/pca953x-overlay.dts
349 +++ b/arch/arm/boot/dts/overlays/pca953x-overlay.dts
352 compatible = "brcm,bcm2835";
355 + frag0: fragment@0 {
358 #address-cells = <1>;
364 + target = <&i2c0if>;
371 + target = <&i2c0mux>;
378 addr = <&pca>,"reg:0";
381 cat9554 = <0>, "+28";
382 pca9654 = <0>, "+29";
383 xra1202 = <0>, "+30";
384 + i2c0 = <&frag0>, "target:0=",<&i2c0>,
386 + i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
388 + i2c3 = <&frag0>, "target?=0",
389 + <&frag0>, "target-path=i2c3";
390 + i2c4 = <&frag0>, "target?=0",
391 + <&frag0>, "target-path=i2c4";
392 + i2c5 = <&frag0>, "target?=0",
393 + <&frag0>, "target-path=i2c5";
394 + i2c6 = <&frag0>, "target?=0",
395 + <&frag0>, "target-path=i2c6";
396 + i2c-path = <&frag0>, "target?=0",
397 + <&frag0>, "target-path";
400 --- a/arch/arm/boot/dts/overlays/pcf857x-overlay.dts
401 +++ b/arch/arm/boot/dts/overlays/pcf857x-overlay.dts
404 compatible = "brcm,bcm2835";
407 + frag0: fragment@0 {
410 #address-cells = <1>;
416 + target = <&i2c0if>;
423 + target = <&i2c0mux>;
430 pcf8574 = <&pcf857x>,"compatible=nxp,pcf8574", <&pcf857x>,"reg:0=0x20";
431 pcf8574a = <&pcf857x>,"compatible=nxp,pcf8574a", <&pcf857x>,"reg:0=0x38";
432 pcf8575 = <&pcf857x>,"compatible=nxp,pcf8575", <&pcf857x>,"reg:0=0x20";
433 pca8574 = <&pcf857x>,"compatible=nxp,pca8574", <&pcf857x>,"reg:0=0x20";
434 addr = <&pcf857x>,"reg:0";
435 + i2c0 = <&frag0>, "target:0=",<&i2c0>,
437 + i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
439 + i2c3 = <&frag0>, "target?=0",
440 + <&frag0>, "target-path=i2c3";
441 + i2c4 = <&frag0>, "target?=0",
442 + <&frag0>, "target-path=i2c4";
443 + i2c5 = <&frag0>, "target?=0",
444 + <&frag0>, "target-path=i2c5";
445 + i2c6 = <&frag0>, "target?=0",
446 + <&frag0>, "target-path=i2c6";
447 + i2c-path = <&frag0>, "target?=0",
448 + <&frag0>, "target-path";
451 --- a/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
452 +++ b/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
455 compatible = "brcm,bcm2835";
458 + frag0: fragment@0 {
461 #address-cells = <1>;
467 + target = <&i2c0if>;
474 + target = <&i2c0mux>;
481 int_pin = <&sc16is750>,"interrupts:0", <&int_pins>,"brcm,pins:0",
483 addr = <&sc16is750>,"reg:0", <&sc16is750_clk>,"name";
484 xtal = <&sc16is750_clk>,"clock-frequency:0";
485 + i2c0 = <&frag0>, "target:0=",<&i2c0>,
487 + i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
489 + i2c3 = <&frag0>, "target?=0",
490 + <&frag0>, "target-path=i2c3";
491 + i2c4 = <&frag0>, "target?=0",
492 + <&frag0>, "target-path=i2c4";
493 + i2c5 = <&frag0>, "target?=0",
494 + <&frag0>, "target-path=i2c5";
495 + i2c6 = <&frag0>, "target?=0",
496 + <&frag0>, "target-path=i2c6";
497 + i2c-path = <&frag0>, "target?=0",
498 + <&frag0>, "target-path";
501 --- a/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
502 +++ b/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
505 compatible = "brcm,bcm2835";
508 + frag0: fragment@0 {
511 #address-cells = <1>;
517 + target = <&i2c0if>;
524 + target = <&i2c0mux>;
531 int_pin = <&sc16is752>,"interrupts:0", <&int_pins>,"brcm,pins:0",
533 addr = <&sc16is752>,"reg:0",<&sc16is752_clk>,"name";
534 xtal = <&sc16is752_clk>,"clock-frequency:0";
535 + i2c0 = <&frag0>, "target:0=",<&i2c0>,
537 + i2c_csi_dsi = <&frag0>, "target:0=",<&i2c_csi_dsi>,
539 + i2c3 = <&frag0>, "target?=0",
540 + <&frag0>, "target-path=i2c3";
541 + i2c4 = <&frag0>, "target?=0",
542 + <&frag0>, "target-path=i2c4";
543 + i2c5 = <&frag0>, "target?=0",
544 + <&frag0>, "target-path=i2c5";
545 + i2c6 = <&frag0>, "target?=0",
546 + <&frag0>, "target-path=i2c6";
547 + i2c-path = <&frag0>, "target?=0",
548 + <&frag0>, "target-path";