18bab661aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
28bab661aSEmmanuel Vadot%YAML 1.2
38bab661aSEmmanuel Vadot---
48bab661aSEmmanuel Vadot$id: http://devicetree.org/schemas/media/i2c/toshiba,tc358746.yaml#
58bab661aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
68bab661aSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: Toshiba TC358746 Parallel to MIPI CSI2 Bridge
88bab661aSEmmanuel Vadot
98bab661aSEmmanuel Vadotmaintainers:
108bab661aSEmmanuel Vadot  - Marco Felsch <kernel@pengutronix.de>
118bab661aSEmmanuel Vadot
128bab661aSEmmanuel Vadotdescription: |-
138bab661aSEmmanuel Vadot  The Toshiba TC358746 converts a parallel video stream into a MIPI CSI-2
148bab661aSEmmanuel Vadot  stream. The direction can be either parallel-in -> csi-out or csi-in ->
15*aa1a8ff2SEmmanuel Vadot  parallel-out The chip is programmable through I2C and SPI but the SPI
168bab661aSEmmanuel Vadot  interface is only supported in parallel-in -> csi-out mode.
178bab661aSEmmanuel Vadot
188bab661aSEmmanuel Vadot  Note that the current device tree bindings only support the
198bab661aSEmmanuel Vadot  parallel-in -> csi-out path.
208bab661aSEmmanuel Vadot
218bab661aSEmmanuel Vadotproperties:
228bab661aSEmmanuel Vadot  compatible:
238bab661aSEmmanuel Vadot    const: toshiba,tc358746
248bab661aSEmmanuel Vadot
258bab661aSEmmanuel Vadot  reg:
268bab661aSEmmanuel Vadot    maxItems: 1
278bab661aSEmmanuel Vadot
288bab661aSEmmanuel Vadot  clocks:
298bab661aSEmmanuel Vadot    description:
308bab661aSEmmanuel Vadot      The phandle to the reference clock source. This corresponds to the
318bab661aSEmmanuel Vadot      hardware pin REFCLK.
328bab661aSEmmanuel Vadot    maxItems: 1
338bab661aSEmmanuel Vadot
348bab661aSEmmanuel Vadot  clock-names:
358bab661aSEmmanuel Vadot    const: refclk
368bab661aSEmmanuel Vadot
378bab661aSEmmanuel Vadot  "#clock-cells":
388bab661aSEmmanuel Vadot    description: |
398bab661aSEmmanuel Vadot      The bridge can act as clock provider for the sensor. To enable this
408bab661aSEmmanuel Vadot      support #clock-cells must be specified. Attention if this feature is used
418bab661aSEmmanuel Vadot      then the mclk rate must be at least: (2 * link-frequency) / 8
428bab661aSEmmanuel Vadot                                           `------------------´   ^
438bab661aSEmmanuel Vadot                                           internal PLL rate   smallest possible
448bab661aSEmmanuel Vadot                                                                   mclk-div
458bab661aSEmmanuel Vadot    const: 0
468bab661aSEmmanuel Vadot
478bab661aSEmmanuel Vadot  clock-output-names:
488bab661aSEmmanuel Vadot    description:
498bab661aSEmmanuel Vadot      The clock name of the MCLK output, the default name is tc358746-mclk.
508bab661aSEmmanuel Vadot    maxItems: 1
518bab661aSEmmanuel Vadot
528bab661aSEmmanuel Vadot  vddc-supply:
538bab661aSEmmanuel Vadot    description: Digital core voltage supply, 1.2 volts
548bab661aSEmmanuel Vadot
558bab661aSEmmanuel Vadot  vddio-supply:
568bab661aSEmmanuel Vadot    description: Digital I/O voltage supply, 1.8 volts
578bab661aSEmmanuel Vadot
588bab661aSEmmanuel Vadot  vddmipi-supply:
598bab661aSEmmanuel Vadot    description: MIPI CSI phy voltage supply, 1.2 volts
608bab661aSEmmanuel Vadot
618bab661aSEmmanuel Vadot  reset-gpios:
628bab661aSEmmanuel Vadot    description:
638bab661aSEmmanuel Vadot      The phandle and specifier for the GPIO that controls the chip reset.
648bab661aSEmmanuel Vadot      This corresponds to the hardware pin RESX which is physically active low.
658bab661aSEmmanuel Vadot    maxItems: 1
668bab661aSEmmanuel Vadot
678bab661aSEmmanuel Vadot  ports:
688bab661aSEmmanuel Vadot    $ref: /schemas/graph.yaml#/properties/ports
698bab661aSEmmanuel Vadot    properties:
708bab661aSEmmanuel Vadot      port@0:
718bab661aSEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
72*aa1a8ff2SEmmanuel Vadot        unevaluatedProperties: false
738bab661aSEmmanuel Vadot        description: Input port
748bab661aSEmmanuel Vadot
758bab661aSEmmanuel Vadot        properties:
768bab661aSEmmanuel Vadot          endpoint:
778bab661aSEmmanuel Vadot            $ref: /schemas/media/video-interfaces.yaml#
788bab661aSEmmanuel Vadot            unevaluatedProperties: false
798bab661aSEmmanuel Vadot
808bab661aSEmmanuel Vadot            properties:
818bab661aSEmmanuel Vadot              hsync-active: true
828bab661aSEmmanuel Vadot              vsync-active: true
838bab661aSEmmanuel Vadot              bus-type:
848bab661aSEmmanuel Vadot                enum: [ 5, 6 ]
858bab661aSEmmanuel Vadot
868bab661aSEmmanuel Vadot            required:
878bab661aSEmmanuel Vadot              - hsync-active
888bab661aSEmmanuel Vadot              - vsync-active
898bab661aSEmmanuel Vadot              - bus-type
908bab661aSEmmanuel Vadot
918bab661aSEmmanuel Vadot      port@1:
928bab661aSEmmanuel Vadot        $ref: /schemas/graph.yaml#/$defs/port-base
93*aa1a8ff2SEmmanuel Vadot        unevaluatedProperties: false
948bab661aSEmmanuel Vadot        description: Output port
958bab661aSEmmanuel Vadot
968bab661aSEmmanuel Vadot        properties:
978bab661aSEmmanuel Vadot          endpoint:
988bab661aSEmmanuel Vadot            $ref: /schemas/media/video-interfaces.yaml#
998bab661aSEmmanuel Vadot            unevaluatedProperties: false
1008bab661aSEmmanuel Vadot
1018bab661aSEmmanuel Vadot            properties:
1028bab661aSEmmanuel Vadot              data-lanes:
1038bab661aSEmmanuel Vadot                minItems: 1
1048bab661aSEmmanuel Vadot                maxItems: 4
1058bab661aSEmmanuel Vadot
1068bab661aSEmmanuel Vadot              clock-noncontinuous: true
1078bab661aSEmmanuel Vadot              link-frequencies: true
1088bab661aSEmmanuel Vadot
1098bab661aSEmmanuel Vadot            required:
1108bab661aSEmmanuel Vadot              - data-lanes
1118bab661aSEmmanuel Vadot              - link-frequencies
1128bab661aSEmmanuel Vadot
1138bab661aSEmmanuel Vadot    required:
1148bab661aSEmmanuel Vadot      - port@0
1158bab661aSEmmanuel Vadot      - port@1
1168bab661aSEmmanuel Vadot
1178bab661aSEmmanuel Vadotrequired:
1188bab661aSEmmanuel Vadot  - compatible
1198bab661aSEmmanuel Vadot  - reg
1208bab661aSEmmanuel Vadot  - clocks
1218bab661aSEmmanuel Vadot  - clock-names
1228bab661aSEmmanuel Vadot  - vddc-supply
1238bab661aSEmmanuel Vadot  - vddio-supply
1248bab661aSEmmanuel Vadot  - vddmipi-supply
1258bab661aSEmmanuel Vadot  - ports
1268bab661aSEmmanuel Vadot
1278bab661aSEmmanuel VadotadditionalProperties: false
1288bab661aSEmmanuel Vadot
1298bab661aSEmmanuel Vadotexamples:
1308bab661aSEmmanuel Vadot  - |
1318bab661aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
1328bab661aSEmmanuel Vadot
1338bab661aSEmmanuel Vadot    i2c {
1348bab661aSEmmanuel Vadot      #address-cells = <1>;
1358bab661aSEmmanuel Vadot      #size-cells = <0>;
1368bab661aSEmmanuel Vadot
1378bab661aSEmmanuel Vadot      csi-bridge@e {
1388bab661aSEmmanuel Vadot        compatible = "toshiba,tc358746";
1398bab661aSEmmanuel Vadot        reg = <0xe>;
1408bab661aSEmmanuel Vadot
1418bab661aSEmmanuel Vadot        clocks = <&refclk>;
1428bab661aSEmmanuel Vadot        clock-names = "refclk";
1438bab661aSEmmanuel Vadot
1448bab661aSEmmanuel Vadot        reset-gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
1458bab661aSEmmanuel Vadot
1468bab661aSEmmanuel Vadot        vddc-supply = <&v1_2d>;
1478bab661aSEmmanuel Vadot        vddio-supply = <&v1_8d>;
1488bab661aSEmmanuel Vadot        vddmipi-supply = <&v1_2d>;
1498bab661aSEmmanuel Vadot
1508bab661aSEmmanuel Vadot        /* sensor mclk provider */
1518bab661aSEmmanuel Vadot        #clock-cells = <0>;
1528bab661aSEmmanuel Vadot
1538bab661aSEmmanuel Vadot        ports {
1548bab661aSEmmanuel Vadot          #address-cells = <1>;
1558bab661aSEmmanuel Vadot          #size-cells = <0>;
1568bab661aSEmmanuel Vadot
1578bab661aSEmmanuel Vadot          /* Input */
1588bab661aSEmmanuel Vadot          port@0 {
1598bab661aSEmmanuel Vadot            reg = <0>;
1608bab661aSEmmanuel Vadot            tc358746_in: endpoint {
1618bab661aSEmmanuel Vadot              remote-endpoint = <&sensor_out>;
1628bab661aSEmmanuel Vadot              hsync-active = <0>;
1638bab661aSEmmanuel Vadot              vsync-active = <0>;
1648bab661aSEmmanuel Vadot              bus-type = <5>;
1658bab661aSEmmanuel Vadot            };
1668bab661aSEmmanuel Vadot          };
1678bab661aSEmmanuel Vadot
1688bab661aSEmmanuel Vadot          /* Output */
1698bab661aSEmmanuel Vadot          port@1 {
1708bab661aSEmmanuel Vadot            reg = <1>;
1718bab661aSEmmanuel Vadot            tc358746_out: endpoint {
1728bab661aSEmmanuel Vadot              remote-endpoint = <&mipi_csi2_in>;
1738bab661aSEmmanuel Vadot              data-lanes = <1 2>;
1748bab661aSEmmanuel Vadot              clock-noncontinuous;
1758bab661aSEmmanuel Vadot              link-frequencies = /bits/ 64 <216000000>;
1768bab661aSEmmanuel Vadot            };
1778bab661aSEmmanuel Vadot          };
1788bab661aSEmmanuel Vadot        };
1798bab661aSEmmanuel Vadot      };
1808bab661aSEmmanuel Vadot    };
181