xref: /linux/Documentation/devicetree/bindings/media/i2c/thine,thp7312.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (c) 2023 Ideas on Board
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/media/i2c/thine,thp7312.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: THine THP7312
9
10maintainers:
11  - Paul Elder <paul.elder@@ideasonboard.com>
12
13description:
14  The THP7312 is a standalone ISP controlled over i2c, and is capable of
15  various image processing and correction functions, including 3A control. It
16  can be connected to CMOS image sensors from various vendors, supporting both
17  MIPI CSI-2 and parallel interfaces. It can also output on either MIPI CSI-2
18  or parallel. The hardware is capable of transmitting and receiving MIPI
19  interleaved data streams with data types or multiple virtual channel
20  identifiers.
21
22allOf:
23  - $ref: /schemas/media/video-interface-devices.yaml#
24
25properties:
26  compatible:
27    const: thine,thp7312
28
29  reg:
30    maxItems: 1
31
32  clocks:
33    maxItems: 1
34    description: CLKI clock input
35
36  thine,boot-mode:
37    $ref: /schemas/types.yaml#/definitions/uint32
38    minimum: 0
39    maximum: 1
40    default: 1
41    description:
42      Boot mode of the THP7312, reflecting the value of the BOOT[0] pin strap.
43      0 is for the SPI/2-wire slave boot, 1 is for the SPI master boot (from
44      external flash ROM).
45
46  reset-gpios:
47    maxItems: 1
48    description:
49      Reference to the GPIO connected to the RESET_N pin, if any.
50      Must be released (set high) after all supplies are applied.
51
52  vddcore-supply:
53    description:
54      1.2V supply for core, PLL, MIPI rx and MIPI tx.
55
56  vhtermrx-supply:
57    description:
58      Supply for input (RX). 1.8V for MIPI, or 1.8/2.8/3.3V for parallel.
59
60  vddtx-supply:
61    description:
62      Supply for output (TX). 1.8V for MIPI, or 1.8/2.8/3.3V for parallel.
63
64  vddhost-supply:
65    description:
66      Supply for host interface. 1.8V, 2.8V, or 3.3V.
67
68  vddcmos-supply:
69    description:
70      Supply for sensor interface. 1.8V, 2.8V, or 3.3V.
71
72  vddgpio-0-supply:
73    description:
74      Supply for GPIO_0. 1.8V, 2.8V, or 3.3V.
75
76  vddgpio-1-supply:
77    description:
78      Supply for GPIO_1. 1.8V, 2.8V, or 3.3V.
79
80  orientation: true
81  rotation: true
82
83  port:
84    $ref: /schemas/graph.yaml#/$defs/port-base
85    additionalProperties: false
86
87    properties:
88      endpoint:
89        $ref: /schemas/media/video-interfaces.yaml#
90        unevaluatedProperties: false
91
92        properties:
93          bus-type:
94            const: 4 # CSI-2 D-PHY
95
96          data-lanes:
97            description:
98              This property is for lane reordering between the THP7312 and the
99              SoC. The sensor supports either two-lane, or four-lane operation.
100              If this property is omitted four-lane operation is assumed. For
101              two-lane operation the property must be set to <1 2>.
102            minItems: 2
103            maxItems: 4
104            items:
105              maximum: 4
106
107  sensors:
108    type: object
109    description: List of connected sensors
110
111    properties:
112      "#address-cells":
113        const: 1
114
115      "#size-cells":
116        const: 0
117
118    patternProperties:
119      "^sensor@[01]$":
120        type: object
121        description:
122          Sensors connected to the first and second input, with one node per
123          sensor.
124
125        properties:
126          thine,model:
127            $ref: /schemas/types.yaml#/definitions/string
128            description:
129              Model of the connected sensors. Must be a valid compatible string.
130
131          reg:
132            description: THP7312 input port number
133            items:
134              - maximum: 1
135
136          data-lanes:
137            $ref: /schemas/media/video-interfaces.yaml#/properties/data-lanes
138            maxItems: 4
139            description:
140              This property is for lane reordering between the THP7312 and the imaging
141              sensor that it is connected to.
142
143        required:
144          - reg
145          - data-lanes
146
147        additionalProperties: false
148
149    required:
150      - "#address-cells"
151      - "#size-cells"
152
153    additionalProperties: false
154
155required:
156  - compatible
157  - reg
158  - reset-gpios
159  - clocks
160  - vddcore-supply
161  - vhtermrx-supply
162  - vddtx-supply
163  - vddhost-supply
164  - vddcmos-supply
165  - vddgpio-0-supply
166  - vddgpio-1-supply
167  - sensors
168  - port
169
170additionalProperties: false
171
172examples:
173  - |
174    #include <dt-bindings/gpio/gpio.h>
175    #include <dt-bindings/media/video-interfaces.h>
176
177    i2c {
178        #address-cells = <1>;
179        #size-cells = <0>;
180
181        camera@61 {
182            compatible = "thine,thp7312";
183            reg = <0x61>;
184
185            pinctrl-names = "default";
186            pinctrl-0 = <&cam1_pins_default>;
187
188            reset-gpios = <&pio 119 GPIO_ACTIVE_LOW>;
189            clocks = <&camera61_clk>;
190
191            vddcore-supply = <&vsys_v4p2>;
192            vhtermrx-supply = <&vsys_v4p2>;
193            vddtx-supply = <&vsys_v4p2>;
194            vddhost-supply = <&vsys_v4p2>;
195            vddcmos-supply = <&vsys_v4p2>;
196            vddgpio-0-supply = <&vsys_v4p2>;
197            vddgpio-1-supply = <&vsys_v4p2>;
198
199            orientation = <0>;
200            rotation = <0>;
201
202            sensors {
203                #address-cells = <1>;
204                #size-cells = <0>;
205
206                sensor@0 {
207                    thine,model = "sony,imx258";
208                    reg = <0>;
209
210                    data-lanes = <4 1 3 2>;
211                };
212            };
213
214            port {
215                thp7312_2_endpoint: endpoint {
216                    remote-endpoint = <&mipi_thp7312_2>;
217                    bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
218                    data-lanes = <4 2 1 3>;
219                };
220            };
221        };
222    };
223...
224