123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- // SPDX-License-Identifier: GPL-2.0+
- /*
- * Copyright (C) 2017 Ideas on Board <[email protected]>
- * Copyright (C) 2021 Jacopo Mondi <[email protected]>
- *
- * Device Tree Source (overlay) that describes GMSL camera connected to
- * Fakra connectors for the Eagle V3M and Condor V3H (and compatible) boards.
- *
- * The following cameras are currently supported: RDACM20 and RDACM21.
- *
- * The board .dts file that include this has to select which cameras are in use
- * by specifying the camera model with:
- *
- * #define GMSL_CAMERA_RDACM20
- * or
- * #define GMSL_CAMERA_RDACM21
- *
- * And which cameras are connected to the board by defining:
- * for GMSL channel 0:
- * #define GMSL_CAMERA_0
- * #define GMSL_CAMERA_1
- * #define GMSL_CAMERA_2
- * #define GMSL_CAMERA_3
- *
- * for GMSL channel 1:
- * #define GMSL_CAMERA_4
- * #define GMSL_CAMERA_5
- * #define GMSL_CAMERA_6
- * #define GMSL_CAMERA_7
- */
- #include <dt-bindings/gpio/gpio.h>
- /* Validate the board file settings. */
- #if !defined(GMSL_CAMERA_RDACM20) && !defined(GMSL_CAMERA_RDACM21)
- #error "Camera model should be defined by the board file"
- #endif
- #if defined(GMSL_CAMERA_RDACM20) && defined(GMSL_CAMERA_RDACM21)
- #error "A single camera model should be selected"
- #endif
- #if !defined(GMSL_CAMERA_0) && !defined(GMSL_CAMERA_1) && \
- !defined(GMSL_CAMERA_2) && !defined(GMSL_CAMERA_3) && \
- !defined(GMSL_CAMERA_4) && !defined(GMSL_CAMERA_5) && \
- !defined(GMSL_CAMERA_6) && !defined(GMSL_CAMERA_7)
- #error "At least one camera should be selected"
- #endif
- /* Deduce from the enabled cameras which GMSL channels are active. */
- #if defined(GMSL_CAMERA_0) || defined(GMSL_CAMERA_1) || \
- defined(GMSL_CAMERA_2) || defined(GMSL_CAMERA_3)
- #define GMSL_0
- #endif
- #if defined(GMSL_CAMERA_4) || defined(GMSL_CAMERA_5) || \
- defined(GMSL_CAMERA_6) || defined(GMSL_CAMERA_7)
- #define GMSL_1
- #endif
- /* Deduce the camera model compatible string. */
- #if defined(GMSL_CAMERA_RDACM20)
- #define GMSL_CAMERA_MODEL "imi,rdacm20"
- #elif defined(GMSL_CAMERA_RDACM21)
- #define GMSL_CAMERA_MODEL "imi,rdacm21"
- #endif
- #ifdef GMSL_0
- &vin0 {
- status = "okay";
- };
- &vin1 {
- status = "okay";
- };
- &vin2 {
- status = "okay";
- };
- &vin3 {
- status = "okay";
- };
- &gmsl0 {
- status = "okay";
- #if defined(GMSL_CAMERA_RDACM21)
- maxim,reverse-channel-microvolt = <100000>;
- #endif
- ports {
- #ifdef GMSL_CAMERA_0
- port@0 {
- max9286_in0: endpoint {
- remote-endpoint = <&fakra_con0>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_1
- port@1 {
- max9286_in1: endpoint{
- remote-endpoint = <&fakra_con1>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_2
- port@2 {
- max9286_in2: endpoint {
- remote-endpoint = <&fakra_con2>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_3
- port@3 {
- max9286_in3: endpoint {
- remote-endpoint = <&fakra_con3>;
- };
- };
- #endif
- };
- i2c-mux {
- #ifdef GMSL_CAMERA_0
- i2c@0 {
- status = "okay";
- camera@51 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x51>, <0x61>;
- port {
- fakra_con0: endpoint {
- remote-endpoint = <&max9286_in0>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_1
- i2c@1 {
- status = "okay";
- camera@52 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x52>, <0x62>;
- port {
- fakra_con1: endpoint {
- remote-endpoint = <&max9286_in1>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_2
- i2c@2 {
- status = "okay";
- camera@53 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x53>, <0x63>;
- port {
- fakra_con2: endpoint {
- remote-endpoint = <&max9286_in2>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_3
- i2c@3 {
- status = "okay";
- camera@54 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x54>, <0x64>;
- port {
- fakra_con3: endpoint {
- remote-endpoint = <&max9286_in3>;
- };
- };
- };
- };
- #endif
- };
- };
- #endif /* ifdef GMSL_0 */
- #ifdef GMSL_1
- &vin4 {
- status = "okay";
- };
- &vin5 {
- status = "okay";
- };
- &vin6 {
- status = "okay";
- };
- &vin7 {
- status = "okay";
- };
- &gmsl1 {
- status = "okay";
- #if defined(GMSL_CAMERA_RDACM21)
- maxim,reverse-channel-microvolt = <100000>;
- #endif
- ports {
- #ifdef GMSL_CAMERA_4
- port@0 {
- max9286_in4: endpoint {
- remote-endpoint = <&fakra_con4>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_5
- port@1 {
- max9286_in5: endpoint{
- remote-endpoint = <&fakra_con5>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_6
- port@2 {
- max9286_in6: endpoint {
- remote-endpoint = <&fakra_con6>;
- };
- };
- #endif
- #ifdef GMSL_CAMERA_7
- port@3 {
- max9286_in7: endpoint {
- remote-endpoint = <&fakra_con7>;
- };
- };
- #endif
- };
- i2c-mux {
- #ifdef GMSL_CAMERA_4
- i2c@0 {
- status = "okay";
- camera@55 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x55>, <0x65>;
- port {
- fakra_con4: endpoint {
- remote-endpoint = <&max9286_in4>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_5
- i2c@1 {
- status = "okay";
- camera@56 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x56>, <0x66>;
- port {
- fakra_con5: endpoint {
- remote-endpoint = <&max9286_in5>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_6
- i2c@2 {
- status = "okay";
- camera@57 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x57>, <0x67>;
- port {
- fakra_con6: endpoint {
- remote-endpoint = <&max9286_in6>;
- };
- };
- };
- };
- #endif
- #ifdef GMSL_CAMERA_7
- i2c@3 {
- status = "okay";
- camera@58 {
- compatible = GMSL_CAMERA_MODEL;
- reg = <0x58>, <0x68>;
- port {
- fakra_con7: endpoint {
- remote-endpoint = <&max9286_in7>;
- };
- };
- };
- };
- #endif
- };
- };
- #endif /* ifdef GMSL_1 */
|