181440c8dbfbd2b485e401438dec39e95e30922f
[openwrt/openwrt.git] /
1 From 5a7c48622a4f7665039211414c9fe4a1914ae3eb Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 17 Aug 2020 18:11:47 +0100
4 Subject: [PATCH] dtoverlays: Add overlay for the PCA953x family of
5 GPIO expanders
6
7 Adds an overlay for configuring all the GPIO expanders supported
8 by the driver under GPIO_PCA953X.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 36 +++
14 .../arm/boot/dts/overlays/pca953x-overlay.dts | 240 ++++++++++++++++++
15 3 files changed, 277 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/pca953x-overlay.dts
17
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -119,6 +119,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
21 ov7251.dtbo \
22 ov9281.dtbo \
23 papirus.dtbo \
24 + pca953x.dtbo \
25 pibell.dtbo \
26 piglow.dtbo \
27 piscreen.dtbo \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -1873,6 +1873,42 @@ Params: panel Display
31 speed Display SPI bus speed
32
33
34 +Name: pca953x
35 +Info: TI PCA953x family of I2C GPIO expanders. Default is for NXP PCA9534.
36 +Load: dtoverlay=pca953x,<param>=<val>
37 +Params: addr I2C address of expander. Default 0x20.
38 + pca6416 Select the NXP PCA6416 (16 bit)
39 + pca9505 Select the NXP PCA9505 (40 bit)
40 + pca9535 Select the NXP PCA9535 (16 bit)
41 + pca9536 Select the NXP PCA9536 or TI PCA9536 (4 bit)
42 + pca9537 Select the NXP PCA9537 (4 bit)
43 + pca9538 Select the NXP PCA9538 (8 bit)
44 + pca9539 Select the NXP PCA9539 (16 bit)
45 + pca9554 Select the NXP PCA9554 (8 bit)
46 + pca9555 Select the NXP PCA9555 (16 bit)
47 + pca9556 Select the NXP PCA9556 (8 bit)
48 + pca9557 Select the NXP PCA9557 (8 bit)
49 + pca9574 Select the NXP PCA9574 (8 bit)
50 + pca9575 Select the NXP PCA9575 (16 bit)
51 + pca9698 Select the NXP PCA9698 (40 bit)
52 + pca16416 Select the NXP PCA16416 (16 bit)
53 + pca16524 Select the NXP PCA16524 (24 bit)
54 + pca19555a Select the NXP PCA19555A (16 bit)
55 + max7310 Select the Maxim MAX7310 (8 bit)
56 + max7312 Select the Maxim MAX7312 (16 bit)
57 + max7313 Select the Maxim MAX7313 (16 bit)
58 + max7315 Select the Maxim MAX7315 (8 bit)
59 + pca6107 Select the TI PCA6107 (8 bit)
60 + tca6408 Select the TI TCA6408 (8 bit)
61 + tca6416 Select the TI TCA6416 (16 bit)
62 + tca6424 Select the TI TCA6424 (24 bit)
63 + tca9539 Select the TI TCA9539 (16 bit)
64 + tca9554 Select the TI TCA9554 (8 bit)
65 + cat9554 Select the Onnn CAT9554 (8 bit)
66 + pca9654 Select the Onnn PCA9654 (8 bit)
67 + xra1202 Select the Exar XRA1202 (8 bit)
68 +
69 +
70 [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
71
72
73 --- /dev/null
74 +++ b/arch/arm/boot/dts/overlays/pca953x-overlay.dts
75 @@ -0,0 +1,240 @@
76 +// Definitions for NXP PCA953x family of I2C GPIO controllers on ARM I2C bus.
77 +/dts-v1/;
78 +/plugin/;
79 +
80 +/{
81 + compatible = "brcm,bcm2835";
82 +
83 + fragment@0 {
84 + target = <&i2c_arm>;
85 + __overlay__ {
86 + #address-cells = <1>;
87 + #size-cells = <0>;
88 + status = "okay";
89 +
90 + pca: pca@20 {
91 + compatible = "nxp,pca9534";
92 + reg = <0x20>;
93 + gpio-controller;
94 + #gpio-cells = <2>;
95 +
96 + status = "okay";
97 + };
98 + };
99 + };
100 +
101 + fragment@1 {
102 + target = <&pca>;
103 + __dormant__ {
104 + compatible = "nxp,pca6416";
105 + };
106 + };
107 + fragment@2 {
108 + target = <&pca>;
109 + __dormant__ {
110 + compatible = "nxp,pca9505";
111 + };
112 + };
113 + fragment@3 {
114 + target = <&pca>;
115 + __dormant__ {
116 + compatible = "nxp,pca9535";
117 + };
118 + };
119 + fragment@4 {
120 + target = <&pca>;
121 + __dormant__ {
122 + compatible = "nxp,pca9536";
123 + };
124 + };
125 + fragment@5 {
126 + target = <&pca>;
127 + __dormant__ {
128 + compatible = "nxp,pca9537";
129 + };
130 + };
131 + fragment@6 {
132 + target = <&pca>;
133 + __dormant__ {
134 + compatible = "nxp,pca9538";
135 + };
136 + };
137 + fragment@7 {
138 + target = <&pca>;
139 + __dormant__ {
140 + compatible = "nxp,pca9539";
141 + };
142 + };
143 + fragment@8 {
144 + target = <&pca>;
145 + __dormant__ {
146 + compatible = "nxp,pca9554";
147 + };
148 + };
149 + fragment@9 {
150 + target = <&pca>;
151 + __dormant__ {
152 + compatible = "nxp,pca9555";
153 + };
154 + };
155 + fragment@10 {
156 + target = <&pca>;
157 + __dormant__ {
158 + compatible = "nxp,pca9556";
159 + };
160 + };
161 + fragment@11 {
162 + target = <&pca>;
163 + __dormant__ {
164 + compatible = "nxp,pca9557";
165 + };
166 + };
167 + fragment@12 {
168 + target = <&pca>;
169 + __dormant__ {
170 + compatible = "nxp,pca9574";
171 + };
172 + };
173 + fragment@13 {
174 + target = <&pca>;
175 + __dormant__ {
176 + compatible = "nxp,pca9575";
177 + };
178 + };
179 + fragment@14 {
180 + target = <&pca>;
181 + __dormant__ {
182 + compatible = "nxp,pca9698";
183 + };
184 + };
185 + fragment@15 {
186 + target = <&pca>;
187 + __dormant__ {
188 + compatible = "nxp,pca16416";
189 + };
190 + };
191 + fragment@16 {
192 + target = <&pca>;
193 + __dormant__ {
194 + compatible = "nxp,pca16524";
195 + };
196 + };
197 + fragment@17 {
198 + target = <&pca>;
199 + __dormant__ {
200 + compatible = "nxp,pca19555a";
201 + };
202 + };
203 + fragment@18 {
204 + target = <&pca>;
205 + __dormant__ {
206 + compatible = "maxim,max7310";
207 + };
208 + };
209 + fragment@19 {
210 + target = <&pca>;
211 + __dormant__ {
212 + compatible = "maxim,max7312";
213 + };
214 + };
215 + fragment@20 {
216 + target = <&pca>;
217 + __dormant__ {
218 + compatible = "maxim,max7313";
219 + };
220 + };
221 + fragment@21 {
222 + target = <&pca>;
223 + __dormant__ {
224 + compatible = "maxim,max7315";
225 + };
226 + };
227 + fragment@22 {
228 + target = <&pca>;
229 + __dormant__ {
230 + compatible = "ti,pca6107";
231 + };
232 + };
233 + fragment@23 {
234 + target = <&pca>;
235 + __dormant__ {
236 + compatible = "ti,tca6408";
237 + };
238 + };
239 + fragment@24 {
240 + target = <&pca>;
241 + __dormant__ {
242 + compatible = "ti,tca6416";
243 + };
244 + };
245 + fragment@25 {
246 + target = <&pca>;
247 + __dormant__ {
248 + compatible = "ti,tca6424";
249 + };
250 + };
251 + fragment@26 {
252 + target = <&pca>;
253 + __dormant__ {
254 + compatible = "ti,tca9539";
255 + };
256 + };
257 + fragment@27 {
258 + target = <&pca>;
259 + __dormant__ {
260 + compatible = "ti,tca9554";
261 + };
262 + };
263 + fragment@28 {
264 + target = <&pca>;
265 + __dormant__ {
266 + compatible = "onnn,cat9554";
267 + };
268 + };
269 + fragment@29 {
270 + target = <&pca>;
271 + __dormant__ {
272 + compatible = "onnn,pca9654";
273 + };
274 + };
275 + fragment@30 {
276 + target = <&pca>;
277 + __dormant__ {
278 + compatible = "exar,xra1202";
279 + };
280 + };
281 +
282 + __overrides__ {
283 + addr = <&pca>,"reg:0";
284 + pca6416 = <0>, "+1";
285 + pca9505 = <0>, "+2";
286 + pca9535 = <0>, "+3";
287 + pca9536 = <0>, "+4";
288 + pca9537 = <0>, "+5";
289 + pca9538 = <0>, "+6";
290 + pca9539 = <0>, "+7";
291 + pca9554 = <0>, "+8";
292 + pca9555 = <0>, "+9";
293 + pca9556 = <0>, "+10";
294 + pca9557 = <0>, "+11";
295 + pca9574 = <0>, "+12";
296 + pca9575 = <0>, "+13";
297 + pca9698 = <0>, "+14";
298 + pca16416 = <0>, "+15";
299 + pca16524 = <0>, "+16";
300 + pca19555a = <0>, "+17";
301 + max7310 = <0>, "+18";
302 + max7312 = <0>, "+19";
303 + max7313 = <0>, "+20";
304 + max7315 = <0>, "+21";
305 + pca6107 = <0>, "+22";
306 + tca6408 = <0>, "+23";
307 + tca6416 = <0>, "+24";
308 + tca6424 = <0>, "+25";
309 + tca9539 = <0>, "+26";
310 + tca9554 = <0>, "+27";
311 + cat9554 = <0>, "+28";
312 + pca9654 = <0>, "+29";
313 + xra1202 = <0>, "+30";
314 + };
315 +};