aboutsummaryrefslogtreecommitdiff
path: root/target/linux/bcm27xx/patches-6.1/950-0692-dtoverlays-Add-overrides-for-alternate-i2c-buses-to-.patch
blob: 095e115fc7dc79bdeea8b7cb0f782a6cd61d3992 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
From 911dedf3f51adf8cfd6554af1c89c922c4453889 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Mon, 24 Apr 2023 16:27:57 +0100
Subject: [PATCH] dtoverlays: Add overrides for alternate i2c buses to
 i2c-mux

The i2c-mux overlay was fixed to i2c-1. Add overrides to allow
it to be assigned to alternate buses.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
 arch/arm/boot/dts/overlays/README             | 16 ++++++++
 .../arm/boot/dts/overlays/i2c-mux-overlay.dts | 40 +++++++++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -1833,6 +1833,22 @@ Params: pca9542                 Select t
 
         addr                    Change I2C address of the device (default 0x70)
 
+        i2c0                    Choose the I2C0 bus on GPIOs 0&1
+
+        i2c_csi_dsi             Choose the I2C0 bus on GPIOs 44&45
+
+        i2c3                    Choose the I2C3 bus (configure with the i2c3
+                                overlay - BCM2711 only)
+
+        i2c4                    Choose the I2C3 bus (configure with the i2c3
+                                overlay - BCM2711 only)
+
+        i2c5                    Choose the I2C5 bus (configure with the i2c4
+                                overlay - BCM2711 only)
+
+        i2c6                    Choose the I2C6 bus (configure with the i2c6
+                                overlay - BCM2711 only)
+
 
 [ The i2c-mux-pca9548a overlay has been deleted. See i2c-mux. ]
 
--- a/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
+++ b/arch/arm/boot/dts/overlays/i2c-mux-overlay.dts
@@ -7,7 +7,7 @@
 	compatible = "brcm,bcm2835";
 
 	fragment@0 {
-		target = <&i2c_arm>;
+		target = <&i2cbus>;
 		__dormant__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -34,7 +34,7 @@
 	};
 
 	fragment@1 {
-		target = <&i2c_arm>;
+		target = <&i2cbus>;
 		__dormant__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -71,7 +71,7 @@
 	};
 
 	fragment@2 {
-		target = <&i2c_arm>;
+		target = <&i2cbus>;
 		__dormant__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -127,6 +127,27 @@
 		};
 	};
 
+	frag100: fragment@100 {
+		target = <&i2c_arm>;
+		i2cbus: __overlay__ {
+			status = "okay";
+		};
+	};
+
+	fragment@101 {
+		target = <&i2c0if>;
+		__dormant__ {
+			status = "okay";
+		};
+	};
+
+	fragment@102 {
+		target = <&i2c0mux>;
+		__dormant__ {
+			status = "okay";
+		};
+	};
+
 	__overrides__ {
 		pca9542 = <0>, "+0";
 		pca9545 = <0>, "+1";
@@ -135,5 +156,18 @@
 		addr =  <&pca9542>,"reg:0",
 			<&pca9545>,"reg:0",
 			<&pca9548>,"reg:0";
+
+		i2c0 = <&frag100>, "target:0=",<&i2c0>,
+			      <0>,"+101+102";
+		i2c_csi_dsi = <&frag100>, "target:0=",<&i2c_csi_dsi>,
+			      <0>,"+101+102";
+		i2c3 = <&frag100>, "target?=0",
+		       <&frag100>, "target-path=i2c3";
+		i2c4 = <&frag100>, "target?=0",
+		       <&frag100>, "target-path=i2c4";
+		i2c5 = <&frag100>, "target?=0",
+		       <&frag100>, "target-path=i2c5";
+		i2c6 = <&frag100>, "target?=0",
+		       <&frag100>, "target-path=i2c6";
 	};
 };