aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0928-overlays-Fix-sc16is75x-overlays-w.r.t.-serdev.patch
blob: ed9f1e1492f59fbb2cbfdfab6666f9d182212466 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
From a934bc7776953d7ce8e27c2d8720de58d5ceeeef Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 30 Jul 2020 15:13:09 +0100
Subject: [PATCH] overlays: Fix sc16is75x overlays w.r.t. serdev

Enabling serdev support in rpi-5.4.y had the unintended consequence of
making any UART device node with a subnode look like a "serdev" node,
which prevents it from having the usual /dev/ttyXXX character device.
Solve the problem by moving the subnode (a static clock declaration)
into the root node.

At the same time, regularise (and sometimes correct) the overlays.

See: https://github.com/raspberrypi/linux/issues/3765

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 .../dts/overlays/sc16is750-i2c-overlay.dts    | 23 +++++++++-------
 .../dts/overlays/sc16is752-i2c-overlay.dts    | 27 ++++++++++---------
 .../dts/overlays/sc16is752-spi0-overlay.dts   | 21 +++++++++------
 .../dts/overlays/sc16is752-spi1-overlay.dts   |  6 ++---
 4 files changed, 45 insertions(+), 32 deletions(-)

--- a/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts
@@ -13,26 +13,31 @@
 
 			sc16is750: sc16is750@48 {
 				compatible = "nxp,sc16is750";
-				reg = <0x48>; /* address */
+				reg = <0x48>; /* i2c address */
 				clocks = <&sc16is750_clk>;
 				interrupt-parent = <&gpio>;
 				interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
+				gpio-controller;
 				#gpio-cells = <2>;
-
-				sc16is750_clk: sc16is750_clk {
-					compatible = "fixed-clock";
-					#clock-cells = <0>;
-					clock-frequency = <14745600>;
-				};
+				i2c-max-frequency = <400000>;
 			};
 		};
 	};
 
+	fragment@1 {
+		target-path = "/";
+		__overlay__ {
+			sc16is750_clk: sc16is750_i2c_clk@48 {
+				compatible = "fixed-clock";
+				#clock-cells = <0>;
+				clock-frequency = <14745600>;
+			};
+		};
+	};
 
 	__overrides__ {
 		int_pin = <&sc16is750>,"interrupts:0";
-		addr = <&sc16is750>,"reg:0",<&sc16is750_clk>,"name";
+		addr = <&sc16is750>,"reg:0", <&sc16is750_clk>,"name";
 		xtal = <&sc16is750_clk>,"clock-frequency:0";
 	};
-
 };
--- a/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sc16is752-i2c-overlay.dts
@@ -5,29 +5,32 @@
 	compatible = "brcm,bcm2835";
 
 	fragment@0 {
-		target = <&i2c1>;
-
-		frag1: __overlay__ {
+		target = <&i2c_arm>;
+		__overlay__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "okay";
 
 			sc16is752: sc16is752@48 {
 				compatible = "nxp,sc16is752";
-				reg = <0x48>; // i2c address
+				reg = <0x48>; /* i2c address */
 				clocks = <&sc16is752_clk>;
 				interrupt-parent = <&gpio>;
-				interrupts = <24 0x2>; /* IRQ_TYPE_EDGE_FALLING */
+				interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
 				gpio-controller;
-				#gpio-cells = <0>;
+				#gpio-cells = <2>;
 				i2c-max-frequency = <400000>;
-				status = "okay";
+			};
+		};
+	};
 
-				sc16is752_clk: sc16is752_clk {
-					compatible = "fixed-clock";
-					#clock-cells = <0>;
-					clock-frequency = <14745600>;
-				};
+	fragment@1 {
+		target-path = "/";
+		__overlay__ {
+			sc16is752_clk: sc16is752_i2c_clk@48 {
+				compatible = "fixed-clock";
+				#clock-cells = <0>;
+				clock-frequency = <14745600>;
 			};
 		};
 	};
--- a/arch/arm/boot/dts/overlays/sc16is752-spi0-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sc16is752-spi0-overlay.dts
@@ -17,15 +17,9 @@
 				clocks = <&sc16is752_clk>;
 				interrupt-parent = <&gpio>;
 				interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
-				#gpio-controller;
+				gpio-controller;
 				#gpio-cells = <2>;
 				spi-max-frequency = <4000000>;
-
-				sc16is752_clk: sc16is752_clk {
-					compatible = "fixed-clock";
-					#clock-cells = <0>;
-					clock-frequency = <14745600>;
-				};
 			};
 		};
 	};
@@ -37,8 +31,19 @@
 		};
 	};
 
+	fragment@2 {
+		target-path = "/";
+		__overlay__ {
+			sc16is752_clk: sc16is752_spi0_0_clk {
+				compatible = "fixed-clock";
+				#clock-cells = <0>;
+				clock-frequency = <14745600>;
+			};
+		};
+	};
+
 	__overrides__ {
 		int_pin = <&sc16is752>,"interrupts:0";
-		xtal = <&sc16is752_clk>, "clock-frequency:0";
+		xtal = <&sc16is752_clk>,"clock-frequency:0";
 	};
 };
--- a/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts
@@ -21,7 +21,7 @@
 
 	fragment@1 {
 		target = <&spi1>;
-		frag1: __overlay__ {
+		__overlay__ {
 			#address-cells = <1>;
 			#size-cells = <0>;
 			pinctrl-names = "default";
@@ -35,7 +35,7 @@
 				clocks = <&sc16is752_clk>;
 				interrupt-parent = <&gpio>;
 				interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
-				#gpio-controller;
+				gpio-controller;
 				#gpio-cells = <2>;
 				spi-max-frequency = <4000000>;
 			};
@@ -52,7 +52,7 @@
 	fragment@3 {
 		target-path = "/";
 		__overlay__ {
-			sc16is752_clk: sc16is752_spi1_clk {
+			sc16is752_clk: sc16is752_spi1_0_clk {
 				compatible = "fixed-clock";
 				#clock-cells = <0>;
 				clock-frequency = <14745600>;