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