18d13bc63SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 28d13bc63SEmmanuel Vadot# Copyright (c) 2023 Ideas on Board 38d13bc63SEmmanuel Vadot%YAML 1.2 48d13bc63SEmmanuel Vadot--- 58d13bc63SEmmanuel Vadot$id: http://devicetree.org/schemas/media/i2c/thine,thp7312.yaml# 68d13bc63SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 78d13bc63SEmmanuel Vadot 88d13bc63SEmmanuel Vadottitle: THine THP7312 98d13bc63SEmmanuel Vadot 108d13bc63SEmmanuel Vadotmaintainers: 118d13bc63SEmmanuel Vadot - Paul Elder <paul.elder@@ideasonboard.com> 128d13bc63SEmmanuel Vadot 138d13bc63SEmmanuel Vadotdescription: 148d13bc63SEmmanuel Vadot The THP7312 is a standalone ISP controlled over i2c, and is capable of 158d13bc63SEmmanuel Vadot various image processing and correction functions, including 3A control. It 168d13bc63SEmmanuel Vadot can be connected to CMOS image sensors from various vendors, supporting both 178d13bc63SEmmanuel Vadot MIPI CSI-2 and parallel interfaces. It can also output on either MIPI CSI-2 188d13bc63SEmmanuel Vadot or parallel. The hardware is capable of transmitting and receiving MIPI 19*b2d2a78aSEmmanuel Vadot interleaved data streams with data types or multiple virtual channel 208d13bc63SEmmanuel Vadot identifiers. 218d13bc63SEmmanuel Vadot 228d13bc63SEmmanuel VadotallOf: 238d13bc63SEmmanuel Vadot - $ref: /schemas/media/video-interface-devices.yaml# 248d13bc63SEmmanuel Vadot 258d13bc63SEmmanuel Vadotproperties: 268d13bc63SEmmanuel Vadot compatible: 278d13bc63SEmmanuel Vadot const: thine,thp7312 288d13bc63SEmmanuel Vadot 298d13bc63SEmmanuel Vadot reg: 308d13bc63SEmmanuel Vadot maxItems: 1 318d13bc63SEmmanuel Vadot 328d13bc63SEmmanuel Vadot clocks: 338d13bc63SEmmanuel Vadot maxItems: 1 348d13bc63SEmmanuel Vadot description: CLKI clock input 358d13bc63SEmmanuel Vadot 368d13bc63SEmmanuel Vadot thine,boot-mode: 378d13bc63SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 388d13bc63SEmmanuel Vadot minimum: 0 398d13bc63SEmmanuel Vadot maximum: 1 408d13bc63SEmmanuel Vadot default: 1 418d13bc63SEmmanuel Vadot description: 428d13bc63SEmmanuel Vadot Boot mode of the THP7312, reflecting the value of the BOOT[0] pin strap. 438d13bc63SEmmanuel Vadot 0 is for the SPI/2-wire slave boot, 1 is for the SPI master boot (from 448d13bc63SEmmanuel Vadot external flash ROM). 458d13bc63SEmmanuel Vadot 468d13bc63SEmmanuel Vadot reset-gpios: 478d13bc63SEmmanuel Vadot maxItems: 1 488d13bc63SEmmanuel Vadot description: 498d13bc63SEmmanuel Vadot Reference to the GPIO connected to the RESET_N pin, if any. 508d13bc63SEmmanuel Vadot Must be released (set high) after all supplies are applied. 518d13bc63SEmmanuel Vadot 528d13bc63SEmmanuel Vadot vddcore-supply: 538d13bc63SEmmanuel Vadot description: 548d13bc63SEmmanuel Vadot 1.2V supply for core, PLL, MIPI rx and MIPI tx. 558d13bc63SEmmanuel Vadot 568d13bc63SEmmanuel Vadot vhtermrx-supply: 578d13bc63SEmmanuel Vadot description: 588d13bc63SEmmanuel Vadot Supply for input (RX). 1.8V for MIPI, or 1.8/2.8/3.3V for parallel. 598d13bc63SEmmanuel Vadot 608d13bc63SEmmanuel Vadot vddtx-supply: 618d13bc63SEmmanuel Vadot description: 628d13bc63SEmmanuel Vadot Supply for output (TX). 1.8V for MIPI, or 1.8/2.8/3.3V for parallel. 638d13bc63SEmmanuel Vadot 648d13bc63SEmmanuel Vadot vddhost-supply: 658d13bc63SEmmanuel Vadot description: 668d13bc63SEmmanuel Vadot Supply for host interface. 1.8V, 2.8V, or 3.3V. 678d13bc63SEmmanuel Vadot 688d13bc63SEmmanuel Vadot vddcmos-supply: 698d13bc63SEmmanuel Vadot description: 708d13bc63SEmmanuel Vadot Supply for sensor interface. 1.8V, 2.8V, or 3.3V. 718d13bc63SEmmanuel Vadot 728d13bc63SEmmanuel Vadot vddgpio-0-supply: 738d13bc63SEmmanuel Vadot description: 748d13bc63SEmmanuel Vadot Supply for GPIO_0. 1.8V, 2.8V, or 3.3V. 758d13bc63SEmmanuel Vadot 768d13bc63SEmmanuel Vadot vddgpio-1-supply: 778d13bc63SEmmanuel Vadot description: 788d13bc63SEmmanuel Vadot Supply for GPIO_1. 1.8V, 2.8V, or 3.3V. 798d13bc63SEmmanuel Vadot 808d13bc63SEmmanuel Vadot orientation: true 818d13bc63SEmmanuel Vadot rotation: true 828d13bc63SEmmanuel Vadot 838d13bc63SEmmanuel Vadot port: 848d13bc63SEmmanuel Vadot $ref: /schemas/graph.yaml#/$defs/port-base 858d13bc63SEmmanuel Vadot additionalProperties: false 868d13bc63SEmmanuel Vadot 878d13bc63SEmmanuel Vadot properties: 888d13bc63SEmmanuel Vadot endpoint: 898d13bc63SEmmanuel Vadot $ref: /schemas/media/video-interfaces.yaml# 908d13bc63SEmmanuel Vadot unevaluatedProperties: false 918d13bc63SEmmanuel Vadot 928d13bc63SEmmanuel Vadot properties: 938d13bc63SEmmanuel Vadot bus-type: 948d13bc63SEmmanuel Vadot const: 4 # CSI-2 D-PHY 958d13bc63SEmmanuel Vadot 968d13bc63SEmmanuel Vadot data-lanes: 978d13bc63SEmmanuel Vadot description: 988d13bc63SEmmanuel Vadot This property is for lane reordering between the THP7312 and the 998d13bc63SEmmanuel Vadot SoC. The sensor supports either two-lane, or four-lane operation. 1008d13bc63SEmmanuel Vadot If this property is omitted four-lane operation is assumed. For 1018d13bc63SEmmanuel Vadot two-lane operation the property must be set to <1 2>. 1028d13bc63SEmmanuel Vadot minItems: 2 1038d13bc63SEmmanuel Vadot maxItems: 4 1048d13bc63SEmmanuel Vadot items: 1058d13bc63SEmmanuel Vadot maximum: 4 1068d13bc63SEmmanuel Vadot 1078d13bc63SEmmanuel Vadot sensors: 1088d13bc63SEmmanuel Vadot type: object 1098d13bc63SEmmanuel Vadot description: List of connected sensors 1108d13bc63SEmmanuel Vadot 1118d13bc63SEmmanuel Vadot properties: 1128d13bc63SEmmanuel Vadot "#address-cells": 1138d13bc63SEmmanuel Vadot const: 1 1148d13bc63SEmmanuel Vadot 1158d13bc63SEmmanuel Vadot "#size-cells": 1168d13bc63SEmmanuel Vadot const: 0 1178d13bc63SEmmanuel Vadot 1188d13bc63SEmmanuel Vadot patternProperties: 1198d13bc63SEmmanuel Vadot "^sensor@[01]$": 1208d13bc63SEmmanuel Vadot type: object 1218d13bc63SEmmanuel Vadot description: 1228d13bc63SEmmanuel Vadot Sensors connected to the first and second input, with one node per 1238d13bc63SEmmanuel Vadot sensor. 1248d13bc63SEmmanuel Vadot 1258d13bc63SEmmanuel Vadot properties: 1268d13bc63SEmmanuel Vadot thine,model: 1278d13bc63SEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string 1288d13bc63SEmmanuel Vadot description: 1298d13bc63SEmmanuel Vadot Model of the connected sensors. Must be a valid compatible string. 1308d13bc63SEmmanuel Vadot 1318d13bc63SEmmanuel Vadot reg: 1328d13bc63SEmmanuel Vadot description: THP7312 input port number 1338d13bc63SEmmanuel Vadot items: 1348d13bc63SEmmanuel Vadot - maximum: 1 1358d13bc63SEmmanuel Vadot 1368d13bc63SEmmanuel Vadot data-lanes: 1378d13bc63SEmmanuel Vadot $ref: /schemas/media/video-interfaces.yaml#/properties/data-lanes 1388d13bc63SEmmanuel Vadot items: 1398d13bc63SEmmanuel Vadot maxItems: 4 1408d13bc63SEmmanuel Vadot description: 1418d13bc63SEmmanuel Vadot This property is for lane reordering between the THP7312 and the imaging 1428d13bc63SEmmanuel Vadot sensor that it is connected to. 1438d13bc63SEmmanuel Vadot 1448d13bc63SEmmanuel Vadot required: 1458d13bc63SEmmanuel Vadot - reg 1468d13bc63SEmmanuel Vadot - data-lanes 1478d13bc63SEmmanuel Vadot 1488d13bc63SEmmanuel Vadot additionalProperties: false 1498d13bc63SEmmanuel Vadot 1508d13bc63SEmmanuel Vadot required: 1518d13bc63SEmmanuel Vadot - "#address-cells" 1528d13bc63SEmmanuel Vadot - "#size-cells" 1538d13bc63SEmmanuel Vadot 1548d13bc63SEmmanuel Vadot additionalProperties: false 1558d13bc63SEmmanuel Vadot 1568d13bc63SEmmanuel Vadotrequired: 1578d13bc63SEmmanuel Vadot - compatible 1588d13bc63SEmmanuel Vadot - reg 1598d13bc63SEmmanuel Vadot - reset-gpios 1608d13bc63SEmmanuel Vadot - clocks 1618d13bc63SEmmanuel Vadot - vddcore-supply 1628d13bc63SEmmanuel Vadot - vhtermrx-supply 1638d13bc63SEmmanuel Vadot - vddtx-supply 1648d13bc63SEmmanuel Vadot - vddhost-supply 1658d13bc63SEmmanuel Vadot - vddcmos-supply 1668d13bc63SEmmanuel Vadot - vddgpio-0-supply 1678d13bc63SEmmanuel Vadot - vddgpio-1-supply 1688d13bc63SEmmanuel Vadot - sensors 1698d13bc63SEmmanuel Vadot - port 1708d13bc63SEmmanuel Vadot 1718d13bc63SEmmanuel VadotadditionalProperties: false 1728d13bc63SEmmanuel Vadot 1738d13bc63SEmmanuel Vadotexamples: 1748d13bc63SEmmanuel Vadot - | 1758d13bc63SEmmanuel Vadot #include <dt-bindings/gpio/gpio.h> 1768d13bc63SEmmanuel Vadot #include <dt-bindings/media/video-interfaces.h> 1778d13bc63SEmmanuel Vadot 1788d13bc63SEmmanuel Vadot i2c { 1798d13bc63SEmmanuel Vadot #address-cells = <1>; 1808d13bc63SEmmanuel Vadot #size-cells = <0>; 1818d13bc63SEmmanuel Vadot 1828d13bc63SEmmanuel Vadot camera@61 { 1838d13bc63SEmmanuel Vadot compatible = "thine,thp7312"; 1848d13bc63SEmmanuel Vadot reg = <0x61>; 1858d13bc63SEmmanuel Vadot 1868d13bc63SEmmanuel Vadot pinctrl-names = "default"; 1878d13bc63SEmmanuel Vadot pinctrl-0 = <&cam1_pins_default>; 1888d13bc63SEmmanuel Vadot 1898d13bc63SEmmanuel Vadot reset-gpios = <&pio 119 GPIO_ACTIVE_LOW>; 1908d13bc63SEmmanuel Vadot clocks = <&camera61_clk>; 1918d13bc63SEmmanuel Vadot 1928d13bc63SEmmanuel Vadot vddcore-supply = <&vsys_v4p2>; 1938d13bc63SEmmanuel Vadot vhtermrx-supply = <&vsys_v4p2>; 1948d13bc63SEmmanuel Vadot vddtx-supply = <&vsys_v4p2>; 1958d13bc63SEmmanuel Vadot vddhost-supply = <&vsys_v4p2>; 1968d13bc63SEmmanuel Vadot vddcmos-supply = <&vsys_v4p2>; 1978d13bc63SEmmanuel Vadot vddgpio-0-supply = <&vsys_v4p2>; 1988d13bc63SEmmanuel Vadot vddgpio-1-supply = <&vsys_v4p2>; 1998d13bc63SEmmanuel Vadot 2008d13bc63SEmmanuel Vadot orientation = <0>; 2018d13bc63SEmmanuel Vadot rotation = <0>; 2028d13bc63SEmmanuel Vadot 2038d13bc63SEmmanuel Vadot sensors { 2048d13bc63SEmmanuel Vadot #address-cells = <1>; 2058d13bc63SEmmanuel Vadot #size-cells = <0>; 2068d13bc63SEmmanuel Vadot 2078d13bc63SEmmanuel Vadot sensor@0 { 2088d13bc63SEmmanuel Vadot thine,model = "sony,imx258"; 2098d13bc63SEmmanuel Vadot reg = <0>; 2108d13bc63SEmmanuel Vadot 2118d13bc63SEmmanuel Vadot data-lanes = <4 1 3 2>; 2128d13bc63SEmmanuel Vadot }; 2138d13bc63SEmmanuel Vadot }; 2148d13bc63SEmmanuel Vadot 2158d13bc63SEmmanuel Vadot port { 2168d13bc63SEmmanuel Vadot thp7312_2_endpoint: endpoint { 2178d13bc63SEmmanuel Vadot remote-endpoint = <&mipi_thp7312_2>; 2188d13bc63SEmmanuel Vadot bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>; 2198d13bc63SEmmanuel Vadot data-lanes = <4 2 1 3>; 2208d13bc63SEmmanuel Vadot }; 2218d13bc63SEmmanuel Vadot }; 2228d13bc63SEmmanuel Vadot }; 2238d13bc63SEmmanuel Vadot }; 2248d13bc63SEmmanuel Vadot... 225