095e115fc7dc79bdeea8b7cb0f782a6cd61d3992
[openwrt/staging/ldir.git] /
1 From 911dedf3f51adf8cfd6554af1c89c922c4453889 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 24 Apr 2023 16:27:57 +0100
4 Subject: [PATCH] dtoverlays: Add overrides for alternate i2c buses to
5 i2c-mux
6
7 The i2c-mux overlay was fixed to i2c-1. Add overrides to allow
8 it to be assigned to alternate buses.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 arch/arm/boot/dts/overlays/README | 16 ++++++++
13 .../arm/boot/dts/overlays/i2c-mux-overlay.dts | 40 +++++++++++++++++--
14 2 files changed, 53 insertions(+), 3 deletions(-)
15
16 --- a/arch/arm/boot/dts/overlays/README
17 +++ b/arch/arm/boot/dts/overlays/README
18 @@ -1833,6 +1833,22 @@ Params: pca9542 Select t
19
20 addr Change I2C address of the device (default 0x70)
21
22 + i2c0 Choose the I2C0 bus on GPIOs 0&1
23 +
24 + i2c_csi_dsi Choose the I2C0 bus on GPIOs 44&45
25 +
26 + i2c3 Choose the I2C3 bus (configure with the i2c3
27 + overlay - BCM2711 only)
28 +
29 + i2c4 Choose the I2C3 bus (configure with the i2c3
30 + overlay - BCM2711 only)
31 +
32 + i2c5 Choose the I2C5 bus (configure with the i2c4
33 + overlay - BCM2711 only)
34 +
35 + i2c6 Choose the I2C6 bus (configure with the i2c6
36 + overlay - BCM2711 only)
37 +
38
39 [ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ]
40
41 --- a/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
42 +++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
43 @@ -7,7 +7,7 @@
44 compatible = "brcm,bcm2835";
45
46 fragment@0 {
47 - target = <&i2c_arm>;
48 + target = <&i2cbus>;
49 __dormant__ {
50 #address-cells = <1>;
51 #size-cells = <0>;
52 @@ -34,7 +34,7 @@
53 };
54
55 fragment@1 {
56 - target = <&i2c_arm>;
57 + target = <&i2cbus>;
58 __dormant__ {
59 #address-cells = <1>;
60 #size-cells = <0>;
61 @@ -71,7 +71,7 @@
62 };
63
64 fragment@2 {
65 - target = <&i2c_arm>;
66 + target = <&i2cbus>;
67 __dormant__ {
68 #address-cells = <1>;
69 #size-cells = <0>;
70 @@ -127,6 +127,27 @@
71 };
72 };
73
74 + frag100: fragment@100 {
75 + target = <&i2c_arm>;
76 + i2cbus: __overlay__ {
77 + status = "okay";
78 + };
79 + };
80 +
81 + fragment@101 {
82 + target = <&i2c0if>;
83 + __dormant__ {
84 + status = "okay";
85 + };
86 + };
87 +
88 + fragment@102 {
89 + target = <&i2c0mux>;
90 + __dormant__ {
91 + status = "okay";
92 + };
93 + };
94 +
95 __overrides__ {
96 pca9542 = <0>, "+0";
97 pca9545 = <0>, "+1";
98 @@ -135,5 +156,18 @@
99 addr = <&pca9542>,"reg:0",
100 <&pca9545>,"reg:0",
101 <&pca9548>,"reg:0";
102 +
103 + i2c0 = <&frag100>, "target:0=",<&i2c0>,
104 + <0>,"+101+102";
105 + i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
106 + <0>,"+101+102";
107 + i2c3 = <&frag100>, "target?=0",
108 + <&frag100>, "target-path=i2c3";
109 + i2c4 = <&frag100>, "target?=0",
110 + <&frag100>, "target-path=i2c4";
111 + i2c5 = <&frag100>, "target?=0",
112 + <&frag100>, "target-path=i2c5";
113 + i2c6 = <&frag100>, "target?=0",
114 + <&frag100>, "target-path=i2c6";
115 };
116 };