1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (C) 2019 Renesas Electronics Corp.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/media/i2c/maxim,max9286.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Maxim Integrated Quad GMSL Deserializer
9
10maintainers:
11  - Jacopo Mondi <jacopo+renesas@jmondi.org>
12  - Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
13  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
14  - Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
15
16description: |
17  The MAX9286 deserializer receives video data on up to 4 Gigabit Multimedia
18  Serial Links (GMSL) and outputs them on a CSI-2 D-PHY port using up to 4 data
19  lanes.
20
21  In addition to video data, the GMSL links carry a bidirectional control
22  channel that encapsulates I2C messages. The MAX9286 forwards all I2C traffic
23  not addressed to itself to the other side of the links, where a GMSL
24  serializer will output it on a local I2C bus. In the other direction all I2C
25  traffic received over GMSL by the MAX9286 is output on the local I2C bus.
26
27properties:
28  '#address-cells':
29    const: 1
30
31  '#size-cells':
32    const: 0
33
34  compatible:
35    const: maxim,max9286
36
37  reg:
38    description: I2C device address
39    maxItems: 1
40
41  poc-supply:
42    description: Regulator providing Power over Coax to the cameras
43    maxItems: 1
44
45  enable-gpios:
46    description: GPIO connected to the \#PWDN pin with inverted polarity
47    maxItems: 1
48
49  gpio-controller: true
50
51  '#gpio-cells':
52      const: 2
53
54  ports:
55    type: object
56    description: |
57      The connections to the MAX9286 GMSL and its endpoint nodes are modelled
58      using the OF graph bindings in accordance with the video interface
59      bindings defined in
60      Documentation/devicetree/bindings/media/video-interfaces.txt.
61
62      The following table lists the port number corresponding to each device
63      port.
64
65        Port            Description
66        ----------------------------------------
67        Port 0          GMSL Input 0
68        Port 1          GMSL Input 1
69        Port 2          GMSL Input 2
70        Port 3          GMSL Input 3
71        Port 4          CSI-2 Output
72
73    properties:
74      '#address-cells':
75        const: 1
76
77      '#size-cells':
78        const: 0
79
80      port@[0-3]:
81        type: object
82        properties:
83          reg:
84            enum: [ 0, 1, 2, 3 ]
85
86          endpoint:
87            type: object
88
89            properties:
90              remote-endpoint:
91                description: |
92                 phandle to the remote GMSL source endpoint subnode in the
93                 remote node port.
94
95            required:
96              - remote-endpoint
97
98        required:
99          - reg
100          - endpoint
101
102        additionalProperties: false
103
104      port@4:
105        type: object
106        properties:
107          reg:
108            const: 4
109
110          endpoint:
111            type: object
112
113            properties:
114              remote-endpoint:
115                description: phandle to the remote CSI-2 sink endpoint.
116
117              data-lanes:
118                description: array of physical CSI-2 data lane indexes.
119
120            required:
121              - remote-endpoint
122              - data-lanes
123
124        required:
125          - reg
126          - endpoint
127
128        additionalProperties: false
129
130    required:
131      - port@4
132
133  i2c-mux:
134    type: object
135    description: |
136      Each GMSL link is modelled as a child bus of an i2c bus
137      multiplexer/switch, in accordance with bindings described in
138      Documentation/devicetree/bindings/i2c/i2c-mux.txt.
139
140    properties:
141      '#address-cells':
142        const: 1
143
144      '#size-cells':
145        const: 0
146
147    patternProperties:
148      "^i2c@[0-3]$":
149        type: object
150        description: |
151          Child node of the i2c bus multiplexer which represents a GMSL link.
152          Each serializer device on the GMSL link remote end is represented with
153          an i2c-mux child node. The MAX9286 chip supports up to 4 GMSL
154          channels.
155
156        properties:
157          '#address-cells':
158            const: 1
159
160          '#size-cells':
161            const: 0
162
163          reg:
164            description: The index of the GMSL channel.
165            maxItems: 1
166
167        patternProperties:
168          "^camera@[a-f0-9]+$":
169            type: object
170            description: |
171              The remote camera device, composed by a GMSL serializer and a
172              connected video source.
173
174            properties:
175              compatible:
176                description: The remote device compatible string.
177
178              reg:
179                minItems: 2
180                maxItems: 3
181                description: |
182                  The I2C addresses to be assigned to the remote devices through
183                  address reprogramming. The number of entries depends on the
184                  requirements of the currently connected remote device.
185
186              port:
187                type: object
188
189                properties:
190                  endpoint:
191                    type: object
192
193                    properties:
194                      remote-endpoint:
195                        description: phandle to the MAX9286 sink endpoint.
196
197                    required:
198                      - remote-endpoint
199
200                    additionalProperties: false
201
202                required:
203                  - endpoint
204
205                additionalProperties: false
206
207            required:
208              - compatible
209              - reg
210              - port
211
212            additionalProperties: false
213
214        additionalProperties: false
215
216    additionalProperties: false
217
218required:
219  - compatible
220  - reg
221  - ports
222  - i2c-mux
223  - gpio-controller
224
225additionalProperties: false
226
227examples:
228  - |
229    #include <dt-bindings/gpio/gpio.h>
230
231    i2c@e66d8000 {
232      #address-cells = <1>;
233      #size-cells = <0>;
234
235      reg = <0 0xe66d8000>;
236
237      gmsl-deserializer@2c {
238        compatible = "maxim,max9286";
239        reg = <0x2c>;
240        poc-supply = <&camera_poc_12v>;
241        enable-gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
242
243        gpio-controller;
244        #gpio-cells = <2>;
245
246        ports {
247          #address-cells = <1>;
248          #size-cells = <0>;
249
250          port@0 {
251            reg = <0>;
252
253            max9286_in0: endpoint {
254              remote-endpoint = <&rdacm20_out0>;
255            };
256          };
257
258          port@1 {
259            reg = <1>;
260
261            max9286_in1: endpoint {
262              remote-endpoint = <&rdacm20_out1>;
263            };
264          };
265
266          port@2 {
267            reg = <2>;
268
269            max9286_in2: endpoint {
270              remote-endpoint = <&rdacm20_out2>;
271            };
272          };
273
274          port@3 {
275            reg = <3>;
276
277            max9286_in3: endpoint {
278              remote-endpoint = <&rdacm20_out3>;
279            };
280          };
281
282          port@4 {
283            reg = <4>;
284
285            max9286_out: endpoint {
286              data-lanes = <1 2 3 4>;
287              remote-endpoint = <&csi40_in>;
288            };
289          };
290        };
291
292        i2c-mux {
293          #address-cells = <1>;
294          #size-cells = <0>;
295
296          i2c@0 {
297            #address-cells = <1>;
298            #size-cells = <0>;
299            reg = <0>;
300
301            camera@51 {
302              compatible = "imi,rdacm20";
303              reg = <0x51>, <0x61>;
304
305              port {
306                rdacm20_out0: endpoint {
307                  remote-endpoint = <&max9286_in0>;
308                };
309              };
310
311            };
312          };
313
314          i2c@1 {
315            #address-cells = <1>;
316            #size-cells = <0>;
317            reg = <1>;
318
319            camera@52 {
320              compatible = "imi,rdacm20";
321              reg = <0x52>, <0x62>;
322
323              port {
324                rdacm20_out1: endpoint {
325                  remote-endpoint = <&max9286_in1>;
326                };
327              };
328            };
329          };
330
331          i2c@2 {
332            #address-cells = <1>;
333            #size-cells = <0>;
334            reg = <2>;
335
336            camera@53 {
337              compatible = "imi,rdacm20";
338              reg = <0x53>, <0x63>;
339
340              port {
341                rdacm20_out2: endpoint {
342                  remote-endpoint = <&max9286_in2>;
343                };
344              };
345            };
346          };
347
348          i2c@3 {
349            #address-cells = <1>;
350            #size-cells = <0>;
351            reg = <3>;
352
353            camera@54 {
354              compatible = "imi,rdacm20";
355              reg = <0x54>, <0x64>;
356
357              port {
358                rdacm20_out3: endpoint {
359                  remote-endpoint = <&max9286_in3>;
360                };
361              };
362            };
363          };
364        };
365      };
366    };
367