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    $ref: /schemas/graph.yaml#/properties/ports
57
58    properties:
59      port@0:
60        description: GMSL Input 0
61
62      port@1:
63        description: GMSL Input 1
64
65      port@2:
66        description: GMSL Input 2
67
68      port@3:
69        description: GMSL Input 3
70
71      port@4:
72        type: object
73        description: CSI-2 Output
74
75        properties:
76          reg:
77            const: 4
78
79          endpoint:
80            type: object
81
82            properties:
83              remote-endpoint:
84                description: phandle to the remote CSI-2 sink endpoint.
85
86              data-lanes:
87                description: array of physical CSI-2 data lane indexes.
88
89            required:
90              - remote-endpoint
91              - data-lanes
92
93        required:
94          - reg
95          - endpoint
96
97        additionalProperties: false
98
99    required:
100      - port@4
101
102    unevaluatedProperties: false
103
104  i2c-mux:
105    type: object
106    description: |
107      Each GMSL link is modelled as a child bus of an i2c bus
108      multiplexer/switch, in accordance with bindings described in
109      Documentation/devicetree/bindings/i2c/i2c-mux.txt.
110
111    properties:
112      '#address-cells':
113        const: 1
114
115      '#size-cells':
116        const: 0
117
118    patternProperties:
119      "^i2c@[0-3]$":
120        type: object
121        description: |
122          Child node of the i2c bus multiplexer which represents a GMSL link.
123          Each serializer device on the GMSL link remote end is represented with
124          an i2c-mux child node. The MAX9286 chip supports up to 4 GMSL
125          channels.
126
127        properties:
128          '#address-cells':
129            const: 1
130
131          '#size-cells':
132            const: 0
133
134          reg:
135            description: The index of the GMSL channel.
136            maxItems: 1
137
138        patternProperties:
139          "^camera@[a-f0-9]+$":
140            type: object
141            description: |
142              The remote camera device, composed by a GMSL serializer and a
143              connected video source.
144
145            properties:
146              compatible:
147                description: The remote device compatible string.
148
149              reg:
150                minItems: 2
151                maxItems: 3
152                description: |
153                  The I2C addresses to be assigned to the remote devices through
154                  address reprogramming. The number of entries depends on the
155                  requirements of the currently connected remote device.
156
157              port:
158                $ref: /schemas/graph.yaml#/properties/port
159                description: Connection to the MAX9286 sink.
160
161            required:
162              - compatible
163              - reg
164              - port
165
166            additionalProperties: false
167
168        additionalProperties: false
169
170    additionalProperties: false
171
172required:
173  - compatible
174  - reg
175  - ports
176  - i2c-mux
177  - gpio-controller
178
179additionalProperties: false
180
181examples:
182  - |
183    #include <dt-bindings/gpio/gpio.h>
184
185    i2c@e66d8000 {
186      #address-cells = <1>;
187      #size-cells = <0>;
188
189      reg = <0 0xe66d8000>;
190
191      gmsl-deserializer@2c {
192        compatible = "maxim,max9286";
193        reg = <0x2c>;
194        poc-supply = <&camera_poc_12v>;
195        enable-gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
196
197        gpio-controller;
198        #gpio-cells = <2>;
199
200        ports {
201          #address-cells = <1>;
202          #size-cells = <0>;
203
204          port@0 {
205            reg = <0>;
206
207            max9286_in0: endpoint {
208              remote-endpoint = <&rdacm20_out0>;
209            };
210          };
211
212          port@1 {
213            reg = <1>;
214
215            max9286_in1: endpoint {
216              remote-endpoint = <&rdacm20_out1>;
217            };
218          };
219
220          port@2 {
221            reg = <2>;
222
223            max9286_in2: endpoint {
224              remote-endpoint = <&rdacm20_out2>;
225            };
226          };
227
228          port@3 {
229            reg = <3>;
230
231            max9286_in3: endpoint {
232              remote-endpoint = <&rdacm20_out3>;
233            };
234          };
235
236          port@4 {
237            reg = <4>;
238
239            max9286_out: endpoint {
240              data-lanes = <1 2 3 4>;
241              remote-endpoint = <&csi40_in>;
242            };
243          };
244        };
245
246        i2c-mux {
247          #address-cells = <1>;
248          #size-cells = <0>;
249
250          i2c@0 {
251            #address-cells = <1>;
252            #size-cells = <0>;
253            reg = <0>;
254
255            camera@51 {
256              compatible = "imi,rdacm20";
257              reg = <0x51>, <0x61>;
258
259              port {
260                rdacm20_out0: endpoint {
261                  remote-endpoint = <&max9286_in0>;
262                };
263              };
264
265            };
266          };
267
268          i2c@1 {
269            #address-cells = <1>;
270            #size-cells = <0>;
271            reg = <1>;
272
273            camera@52 {
274              compatible = "imi,rdacm20";
275              reg = <0x52>, <0x62>;
276
277              port {
278                rdacm20_out1: endpoint {
279                  remote-endpoint = <&max9286_in1>;
280                };
281              };
282            };
283          };
284
285          i2c@2 {
286            #address-cells = <1>;
287            #size-cells = <0>;
288            reg = <2>;
289
290            camera@53 {
291              compatible = "imi,rdacm20";
292              reg = <0x53>, <0x63>;
293
294              port {
295                rdacm20_out2: endpoint {
296                  remote-endpoint = <&max9286_in2>;
297                };
298              };
299            };
300          };
301
302          i2c@3 {
303            #address-cells = <1>;
304            #size-cells = <0>;
305            reg = <3>;
306
307            camera@54 {
308              compatible = "imi,rdacm20";
309              reg = <0x54>, <0x64>;
310
311              port {
312                rdacm20_out3: endpoint {
313                  remote-endpoint = <&max9286_in3>;
314                };
315              };
316            };
317          };
318        };
319      };
320    };
321