Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) Common bindings for video receiver and transmitter interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) General concept
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) ---------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) Video data pipelines usually consist of external devices, e.g. camera sensors,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) controlled over an I2C, SPI or UART bus, and SoC internal IP blocks, including
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) video DMA engines and video data processors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) SoC internal blocks are described by DT nodes, placed similarly to other SoC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) blocks.  External devices are represented as child nodes of their respective
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) bus controller nodes, e.g. I2C.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) Data interfaces on all video devices are described by their child 'port' nodes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) Configuration of a port depends on other devices participating in the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) transfer and is described by 'endpoint' subnodes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) device {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	ports {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 		#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 		#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 		port@0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 			...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 			endpoint@0 { ... };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 			endpoint@1 { ... };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		port@1 { ... };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) If a port can be configured to work with more than one remote device on the same
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) bus, an 'endpoint' child node must be provided for each of them.  If more than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) one port is present in a device node or there is more than one endpoint at a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) port, or port node needs to be associated with a selected hardware interface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) a common scheme using '#address-cells', '#size-cells' and 'reg' properties is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) All 'port' nodes can be grouped under optional 'ports' node, which allows to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) specify #address-cells, #size-cells properties independently for the 'port'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) and 'endpoint' nodes and any child device nodes a device might have.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) Two 'endpoint' nodes are linked with each other through their 'remote-endpoint'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) phandles.  An endpoint subnode of a device contains all properties needed for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) configuration of this device for data exchange with other device.  In most
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) cases properties at the peer 'endpoint' nodes will be identical, however they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) might need to be different when there is any signal modifications on the bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) between two devices, e.g. there are logic signal inverters on the lines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) It is allowed for multiple endpoints at a port to be active simultaneously,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) where supported by a device.  For example, in case where a data interface of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) a device is partitioned into multiple data busses, e.g. 16-bit input port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) divided into two separate ITU-R BT.656 8-bit busses.  In such case bus-width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) and data-shift properties can be used to assign physical data lines to each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) endpoint node (logical bus).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) Documenting bindings for devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) --------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) All required and optional bindings the device supports shall be explicitly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) documented in device DT binding documentation. This also includes port and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) endpoint nodes for the device, including unit-addresses and reg properties where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) relevant.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) Please also see Documentation/devicetree/bindings/graph.txt .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) Required properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) -------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) If there is more than one 'port' or more than one 'endpoint' node or 'reg'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) property is present in port and/or endpoint nodes the following properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) are required in a relevant parent node:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  - #address-cells : number of cells required to define port/endpoint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		    identifier, should be 1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  - #size-cells    : should be zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) Optional properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) -------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) - flash-leds: An array of phandles, each referring to a flash LED, a sub-node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)   of the LED driver device node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) - lens-focus: A phandle to the node of the focus lens controller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) - rotation: The camera rotation is expressed as the angular difference in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)   degrees between two reference systems, one relative to the camera module, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)   one defined on the external world scene to be captured when projected on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)   image sensor pixel array.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)   A camera sensor has a 2-dimensional reference system 'Rc' defined by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)   its pixel array read-out order. The origin is set to the first pixel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)   being read out, the X-axis points along the column read-out direction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)   towards the last columns, and the Y-axis along the row read-out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)   direction towards the last row.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)   A typical example for a sensor with a 2592x1944 pixel array matrix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)   observed from the front is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)               2591       X-axis          0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)                 <------------------------+ 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)                 .......... ... ..........!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)                 .......... ... ..........! Y-axis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)                            ...           !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)                 .......... ... ..........!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)                 .......... ... ..........! 1943
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)                                          V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)   The external world scene reference system 'Rs' is a 2-dimensional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)   reference system on the focal plane of the camera module. The origin is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)   placed on the top-left corner of the visible scene, the X-axis points
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)   towards the right, and the Y-axis points towards the bottom of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)   scene. The top, bottom, left and right directions are intentionally not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)   defined and depend on the environment in which the camera is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)   A typical example of a (very common) picture of a shark swimming from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)   left to right, as seen from the camera, is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)                0               X-axis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)                !           |\____)\___
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)                !           ) _____  __`<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)                !           |/     )/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)                V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)              Y-axis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)   with the reference system 'Rs' placed on the camera focal plane:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)                                   ¸.·˙!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)                               ¸.·˙    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)                   _       ¸.·˙        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)                +-/ \-+¸.·˙            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)                | (o) |                ! Camera focal plane
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)                +-----+˙·.¸            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)                           ˙·.¸        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)                               ˙·.¸    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)                                   ˙·.¸!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)   When projected on the sensor's pixel array, the image and the associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)   reference system 'Rs' are typically (but not always) inverted, due to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)   the camera module's lens optical inversion effect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)   Assuming the above represented scene of the swimming shark, the lens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)   inversion projects the scene and its reference system onto the sensor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)   pixel array, seen from the front of the camera sensor, as follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)             Y-axis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)                ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)                !            |\_____)\__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)                !            ) ____  ___.<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)                !            |/    )/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)                0               X-axis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)   Note the shark being upside-down.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)   The resulting projected reference system is named 'Rp'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)   The camera rotation property is then defined as the angular difference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)   in the counter-clockwise direction between the camera reference system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)   'Rc' and the projected scene reference system 'Rp'. It is expressed in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)   degrees as a number in the range [0, 360[.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)   Examples
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)   0 degrees camera rotation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)                     Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)                      ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)               Y-Rc   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)                ^     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)                !   0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)                !     0               X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)                0               X-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)                                 X-Rc                0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)                <------------------------------------+ 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)                            X-Rp                 0   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)            <------------------------------------+ 0 !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)                                                 !   !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)                                                 !   V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)                                                 !  Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)                                                 V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)                                                Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)   90 degrees camera rotation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)                0        Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)              0 +-------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)                !   Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)                !    ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)                !  0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)                !    0              X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)                V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)               X-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)   180 degrees camera rotation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)                                             0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)        <------------------------------------+ 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)                         X-Rc                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)               Y-Rp                          !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)                ^                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)                !                            V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)                !                           Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)                0              X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)   270 degrees camera rotation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)                0        Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)              0 +-------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)                !                                        0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)                !    <-----------------------------------+ 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)                !                    X-Rp                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)                !                                        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)                !                                        V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)                !                                       Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)                V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)               X-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)   Example one - Webcam
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285)   A camera module installed on the user facing part of a laptop screen
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)   casing used for video calls. The captured images are meant to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)   displayed in landscape mode (width > height) on the laptop screen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)   The camera is typically mounted upside-down to compensate the lens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)   optical inversion effect:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)                     Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)               Y-Rc   ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)                ^     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)                !     !       |\_____)\__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)                !     !       ) ____  ___.<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)                !     !       |/    )/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)                !     !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)                !   0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)                !     0           X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)                0            X-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)   The two reference systems are aligned, the resulting camera rotation is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)   0 degrees, no rotation correction needs to be applied to the resulting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)   image once captured to memory buffers to correctly display it to users:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)                !             |\____)\___              !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)                !             ) _____  __`<            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)                !             |/     )/                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)   If the camera sensor is not mounted upside-down to compensate for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)   lens optical inversion, the two reference systems will not be aligned,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)   with 'Rp' being rotated 180 degrees relatively to 'Rc':
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)                         X-Rc                0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)        <------------------------------------+ 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)                                             !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331)               Y-Rp                          !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)                ^                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)                !       |\_____)\__          !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)                !       ) ____  ___.<        !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)                !       |/    )/             !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)                !                            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)                !                            V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)                !                           Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)              0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)                0            X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)   The image once captured to memory will then be rotated by 180 degrees:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)                !              __/(_____/|             !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)                !            >.___  ____ (             !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)                !                 \(    \|             !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)   A software rotation correction of 180 degrees should be applied to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)   correctly display the image:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)                !             |\____)\___              !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)                !             ) _____  __`<            !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)                !             |/     )/                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)                !                                      !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)                +--------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)   Example two - Phone camera
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)   A camera installed on the back side of a mobile device facing away from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)   the user. The captured images are meant to be displayed in portrait mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)   (height > width) to match the device screen orientation and the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)   usage orientation used when taking the picture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)   The camera sensor is typically mounted with its pixel array longer side
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)   aligned to the device longer side, upside-down mounted to compensate for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)   the lens optical inversion effect:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)                0        Y-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385)              0 +-------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)                !   Y-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)                !    ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)                !    !            |\_____)\__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)                !    !            ) ____  ___.<
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)                !    !            |/    )/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)                !    !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)                !  0 +------------------------------------->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)                !    0                X-Rp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)                !
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403)                V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)               X-Rc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)   The two reference systems are not aligned and the 'Rp' reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)   system is rotated by 90 degrees in the counter-clockwise direction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)   relatively to the 'Rc' reference system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)   The image once captured to memory will be rotated:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)                +-------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)                |                 _ _                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)                |                \   /                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415)                |                 | |                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416)                |                 | |                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417)                |                 |  >                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)                |                <  |                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419)                |                 | |                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420)                |                   .                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)                |                  V                  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)                +-------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424)   A correction of 90 degrees in counter-clockwise direction has to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425)   applied to correctly display the image in portrait mode on the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)   screen:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)                         +--------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)                         |   |\____)\___      |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)                         |   ) _____  __`<    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)                         |   |/     )/        |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442)                         |                    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)                         +--------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) - orientation: The orientation of a device (typically an image sensor or a flash
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446)   LED) describing its mounting position relative to the usage orientation of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)   system where the device is installed on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448)   Possible values are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449)   0 - Front. The device is mounted on the front facing side of the system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)   For mobile devices such as smartphones, tablets and laptops the front side is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451)   the user facing side.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)   1 - Back. The device is mounted on the back side of the system, which is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453)   defined as the opposite side of the front facing one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)   2 - External. The device is not attached directly to the system but is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)   attached in a way that allows it to move freely.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) Optional endpoint properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) ----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) - remote-endpoint: phandle to an 'endpoint' subnode of a remote device node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) - slave-mode: a boolean property indicating that the link is run in slave mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)   The default when this property is not specified is master mode. In the slave
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463)   mode horizontal and vertical synchronization signals are provided to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464)   slave device (data source) by the master device (data sink). In the master
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)   mode the data source device is also the source of the synchronization signals.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) - bus-type: data bus type. Possible values are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467)   1 - MIPI CSI-2 C-PHY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468)   2 - MIPI CSI1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)   3 - CCP2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470)   4 - MIPI CSI-2 D-PHY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471)   5 - Parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472)   6 - Bt.656
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) - bus-width: number of data lines actively used, valid for the parallel busses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) - data-shift: on the parallel data busses, if bus-width is used to specify the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)   number of data lines, data-shift can be used to specify which data lines are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)   used, e.g. "bus-width=<8>; data-shift=<2>;" means, that lines 9:2 are used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) - hsync-active: active state of the HSYNC signal, 0/1 for LOW/HIGH respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) - vsync-active: active state of the VSYNC signal, 0/1 for LOW/HIGH respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479)   Note, that if HSYNC and VSYNC polarities are not specified, embedded
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480)   synchronization may be required, where supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) - data-active: similar to HSYNC and VSYNC, specifies data line polarity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) - data-enable-active: similar to HSYNC and VSYNC, specifies the data enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483)   signal polarity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) - field-even-active: field signal level during the even field data transmission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486)   signal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) - sync-on-green-active: active state of Sync-on-green (SoG) signal, 0/1 for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488)   LOW/HIGH respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) - data-lanes: an array of physical data lane indexes. Position of an entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490)   determines the logical lane number, while the value of an entry indicates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)   physical lane, e.g. for 2-lane MIPI CSI-2 bus we could have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492)   "data-lanes = <1 2>;", assuming the clock lane is on hardware lane 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493)   If the hardware does not support lane reordering, monotonically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494)   incremented values shall be used from 0 or 1 onwards, depending on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495)   whether or not there is also a clock lane. This property is valid for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496)   serial busses only (e.g. MIPI CSI-2).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) - clock-lanes: an array of physical clock lane indexes. Position of an entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)   determines the logical lane number, while the value of an entry indicates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499)   physical lane, e.g. for a MIPI CSI-2 bus we could have "clock-lanes = <0>;",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)   which places the clock lane on hardware lane 0. This property is valid for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501)   serial busses only (e.g. MIPI CSI-2). Note that for the MIPI CSI-2 bus this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502)   array contains only one entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) - clock-noncontinuous: a boolean property to allow MIPI CSI-2 non-continuous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504)   clock mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) - link-frequencies: Allowed data bus frequencies. For MIPI CSI-2, for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)   instance, this is the actual frequency of the bus, not bits per clock per
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507)   lane value. An array of 64-bit unsigned integers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) - lane-polarities: an array of polarities of the lanes starting from the clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509)   lane and followed by the data lanes in the same order as in data-lanes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510)   Valid values are 0 (normal) and 1 (inverted). The length of the array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511)   should be the combined length of data-lanes and clock-lanes properties.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512)   If the lane-polarities property is omitted, the value must be interpreted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)   as 0 (normal). This property is valid for serial busses only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) - strobe: Whether the clock signal is used as clock (0) or strobe (1). Used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515)   with CCP2, for instance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) Example
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) The example snippet below describes two data pipelines.  ov772x and imx074 are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) camera sensors with a parallel and serial (MIPI CSI-2) video bus respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) Both sensors are on the I2C control bus corresponding to the i2c0 controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) node.  ov772x sensor is linked directly to the ceu0 video host interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) imx074 is linked to ceu0 through the MIPI CSI-2 receiver (csi2). ceu0 has a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) (single) DMA engine writing captured data to memory.  ceu0 node has a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 'port' node which may indicate that at any time only one of the following data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) pipelines can be active: ov772x -> ceu0 or imx074 -> csi2 -> ceu0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) 	ceu0: ceu@fe910000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 		compatible = "renesas,sh-mobile-ceu";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) 		reg = <0xfe910000 0xa0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 		interrupts = <0x880>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) 		mclk: master_clock {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 			compatible = "renesas,ceu-clock";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) 			#clock-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) 			clock-frequency = <50000000>;	/* Max clock frequency */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 			clock-output-names = "mclk";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) 		port {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 			#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) 			#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) 			/* Parallel bus endpoint */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) 			ceu0_1: endpoint@1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 				reg = <1>;		/* Local endpoint # */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 				remote = <&ov772x_1_1>;	/* Remote phandle */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) 				bus-width = <8>;	/* Used data lines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 				data-shift = <2>;	/* Lines 9:2 are used */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) 				/* If hsync-active/vsync-active are missing,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) 				   embedded BT.656 sync is used */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 				hsync-active = <0>;	/* Active low */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) 				vsync-active = <0>;	/* Active low */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 				data-active = <1>;	/* Active high */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 				pclk-sample = <1>;	/* Rising */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 			/* MIPI CSI-2 bus endpoint */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 			ceu0_0: endpoint@0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 				reg = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 				remote = <&csi2_2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) 	i2c0: i2c@fff20000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 		...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 		ov772x_1: camera@21 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) 			compatible = "ovti,ov772x";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 			reg = <0x21>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 			vddio-supply = <&regulator1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 			vddcore-supply = <&regulator2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 			clock-frequency = <20000000>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) 			clocks = <&mclk 0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 			clock-names = "xclk";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) 			port {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 				/* With 1 endpoint per port no need for addresses. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 				ov772x_1_1: endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) 					bus-width = <8>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) 					remote-endpoint = <&ceu0_1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) 					hsync-active = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 					vsync-active = <0>; /* Who came up with an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) 							       inverter here ?... */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 					data-active = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 					pclk-sample = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 				};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) 		imx074: camera@1a {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) 			compatible = "sony,imx074";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) 			reg = <0x1a>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) 			vddio-supply = <&regulator1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) 			vddcore-supply = <&regulator2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 			clock-frequency = <30000000>;	/* Shared clock with ov772x_1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) 			clocks = <&mclk 0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) 			clock-names = "sysclk";		/* Assuming this is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) 							   name in the datasheet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 			port {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) 				imx074_1: endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) 					clock-lanes = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) 					data-lanes = <1 2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) 					remote-endpoint = <&csi2_1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) 				};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) 	csi2: csi2@ffc90000 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) 		compatible = "renesas,sh-mobile-csi2";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) 		reg = <0xffc90000 0x1000>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) 		interrupts = <0x17a0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) 		#address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) 		#size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) 		port@1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) 			compatible = "renesas,csi2c";	/* One of CSI2I and CSI2C. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) 			reg = <1>;			/* CSI-2 PHY #1 of 2: PHY_S,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) 							   PHY_M has port address 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) 							   is unused. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) 			csi2_1: endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) 				clock-lanes = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) 				data-lanes = <2 1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) 				remote-endpoint = <&imx074_1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) 		port@2 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) 			reg = <2>;			/* port 2: link to the CEU */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) 			csi2_2: endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) 				remote-endpoint = <&ceu0_0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) 			};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) 		};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) 	};