Skip to contentSkip to conversation

Documentation: v4l: Document rotation and orientation for sensor drivers

PATCH Superseded Sakari Ailus 1 participant 1 message Mar 28, 2023

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 Documentation: v4l: Document rotation and orientation for sensor drivers

Document how rotation and orientation should be taken into account in writing camera sensor drivers.

---
 Documentation/driver-api/media/camera-sensor.rst      | 11 +++++++++++
 .../userspace-api/media/v4l/ext-ctrls-camera.rst      |  1 +
 2 files changed, 12 insertions(+)
Documentation/driver-api/media/camera-sensor.rst +11 -0
index c7d4891bd24e..8ad1e3fcceb4 100644
@@ -151,3 +151,14 @@ used to obtain device's power state after the power state transition:
 The function returns a non-zero value if it succeeded getting the power count or
 runtime PM was disabled, in either of which cases the driver may proceed to
 access the device.
+
+Rotation and orientation
+------------------------
+
+Some systems have been implemented so that the camera sensor has been mounted
+upside down compared to its natural mounting rotation. In such a case, the
+:ref:`V4L2_CID_CAMERA_SENSOR_ROTATION <v4l2-camera-sensor-rotation>` control
+shall indicate the mounting rotation.
+
+Use v4l2_fwnode_device_parse() to obtain this information and
+v4l2_ctrl_new_fwnode_properties() to generate the appropriate controls.
Documentation/userspace-api/media/v4l/ext-ctrls-camera.rst +1 -0
index daa4f40869f8..29fe22da52a2 100644
@@ -536,6 +536,7 @@ enum v4l2_scene_mode -
       - The camera is not directly attached to the device and is freely movable.
 
 
+.. _v4l2-camera-sensor-rotation:
 
 ``V4L2_CID_CAMERA_SENSOR_ROTATION (integer)``
     This read-only control describes the rotation correction in degrees in the
Signature · 1 line
2.30.2