1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Ideas on Board <kieran.bingham@ideasonboard.com>
4 * Copyright (C) 2021 Jacopo Mondi <jacopo+renesas@jmondi.org>
6 * Device Tree Source (overlay) that describes GMSL camera connected to
7 * Fakra connectors for the Eagle V3M and Condor V3H (and compatible) boards.
9 * The following cameras are currently supported: RDACM20 and RDACM21.
11 * The board .dts file that include this has to select which cameras are in use
12 * by specifying the camera model with:
14 * #define GMSL_CAMERA_RDACM20
16 * #define GMSL_CAMERA_RDACM21
18 * And which cameras are connected to the board by defining:
20 * #define GMSL_CAMERA_0
21 * #define GMSL_CAMERA_1
22 * #define GMSL_CAMERA_2
23 * #define GMSL_CAMERA_3
26 * #define GMSL_CAMERA_4
27 * #define GMSL_CAMERA_5
28 * #define GMSL_CAMERA_6
29 * #define GMSL_CAMERA_7
32 #include <dt-bindings/gpio/gpio.h>
34 /* Validate the board file settings. */
35 #if !defined(GMSL_CAMERA_RDACM20) && !defined(GMSL_CAMERA_RDACM21)
36 #error "Camera model should be defined by the board file"
39 #if defined(GMSL_CAMERA_RDACM20) && defined(GMSL_CAMERA_RDACM21)
40 #error "A single camera model should be selected"
43 #if !defined(GMSL_CAMERA_0) && !defined(GMSL_CAMERA_1) && \
44 !defined(GMSL_CAMERA_2) && !defined(GMSL_CAMERA_3) && \
45 !defined(GMSL_CAMERA_4) && !defined(GMSL_CAMERA_5) && \
46 !defined(GMSL_CAMERA_6) && !defined(GMSL_CAMERA_7)
47 #error "At least one camera should be selected"
50 /* Deduce from the enabled cameras which GMSL channels are active. */
51 #if defined(GMSL_CAMERA_0) || defined(GMSL_CAMERA_1) || \
52 defined(GMSL_CAMERA_2) || defined(GMSL_CAMERA_3)
56 #if defined(GMSL_CAMERA_4) || defined(GMSL_CAMERA_5) || \
57 defined(GMSL_CAMERA_6) || defined(GMSL_CAMERA_7)
61 /* Deduce the camera model compatible string. */
62 #if defined(GMSL_CAMERA_RDACM20)
63 #define GMSL_CAMERA_MODEL "imi,rdacm20"
64 #elif defined(GMSL_CAMERA_RDACM21)
65 #define GMSL_CAMERA_MODEL "imi,rdacm21"
88 #if defined(GMSL_CAMERA_RDACM21)
89 maxim,reverse-channel-microvolt = <100000>;
95 max9286_in0: endpoint {
96 remote-endpoint = <&fakra_con0>;
103 max9286_in1: endpoint{
104 remote-endpoint = <&fakra_con1>;
112 max9286_in2: endpoint {
113 remote-endpoint = <&fakra_con2>;
121 max9286_in3: endpoint {
122 remote-endpoint = <&fakra_con3>;
135 compatible = GMSL_CAMERA_MODEL;
136 reg = <0x51>, <0x61>;
139 fakra_con0: endpoint {
140 remote-endpoint = <&max9286_in0>;
152 compatible = GMSL_CAMERA_MODEL;
153 reg = <0x52>, <0x62>;
156 fakra_con1: endpoint {
157 remote-endpoint = <&max9286_in1>;
169 compatible = GMSL_CAMERA_MODEL;
170 reg = <0x53>, <0x63>;
173 fakra_con2: endpoint {
174 remote-endpoint = <&max9286_in2>;
186 compatible = GMSL_CAMERA_MODEL;
187 reg = <0x54>, <0x64>;
190 fakra_con3: endpoint {
191 remote-endpoint = <&max9286_in3>;
199 #endif /* ifdef GMSL_0 */
221 #if defined(GMSL_CAMERA_RDACM21)
222 maxim,reverse-channel-microvolt = <100000>;
228 max9286_in4: endpoint {
229 remote-endpoint = <&fakra_con4>;
236 max9286_in5: endpoint{
237 remote-endpoint = <&fakra_con5>;
245 max9286_in6: endpoint {
246 remote-endpoint = <&fakra_con6>;
254 max9286_in7: endpoint {
255 remote-endpoint = <&fakra_con7>;
268 compatible = GMSL_CAMERA_MODEL;
269 reg = <0x55>, <0x65>;
272 fakra_con4: endpoint {
273 remote-endpoint = <&max9286_in4>;
285 compatible = GMSL_CAMERA_MODEL;
286 reg = <0x56>, <0x66>;
289 fakra_con5: endpoint {
290 remote-endpoint = <&max9286_in5>;
302 compatible = GMSL_CAMERA_MODEL;
303 reg = <0x57>, <0x67>;
306 fakra_con6: endpoint {
307 remote-endpoint = <&max9286_in6>;
319 compatible = GMSL_CAMERA_MODEL;
320 reg = <0x58>, <0x68>;
323 fakra_con7: endpoint {
324 remote-endpoint = <&max9286_in7>;
332 #endif /* ifdef GMSL_1 */