summaryrefslogtreecommitdiff
path: root/Documentation/driver-api/media/v4l2-subdev.rst
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2023-06-20 15:03:02 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-07-28 11:36:20 +0300
commit5202fb581e52962c978b7a9e8ca0f4f1fb75cd0b (patch)
tree9aad4c3d9c893a55a6f8a7e6a4d4d9272fcfebb4 /Documentation/driver-api/media/v4l2-subdev.rst
parentec295094673b7c8e2d60945dae6d02378fa9591a (diff)
downloadlinux-5202fb581e52962c978b7a9e8ca0f4f1fb75cd0b.tar.xz
media: Documentation: v4l: Add section titles for async
Add section titles for async documentation. While the documentation is mostly fine as-is, it has grown from its original state but remains without internal structure. Add it now. Also remove an extra newline. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'Documentation/driver-api/media/v4l2-subdev.rst')
-rw-r--r--Documentation/driver-api/media/v4l2-subdev.rst19
1 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
index c46511c9b6c8..3cc56ac8d221 100644
--- a/Documentation/driver-api/media/v4l2-subdev.rst
+++ b/Documentation/driver-api/media/v4l2-subdev.rst
@@ -157,6 +157,9 @@ below.
Using one or the other registration method only affects the probing process, the
run-time bridge-subdevice interaction is in both cases the same.
+Registering synchronous sub-devices
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
In the **synchronous** case a device (bridge) driver needs to register the
:c:type:`v4l2_subdev` with the v4l2_device:
@@ -175,10 +178,12 @@ You can unregister a sub-device using:
:c:func:`v4l2_device_unregister_subdev <v4l2_device_unregister_subdev>`
(:c:type:`sd <v4l2_subdev>`).
-
Afterwards the subdev module can be unloaded and
:c:type:`sd <v4l2_subdev>`->dev == ``NULL``.
+Registering asynchronous sub-devices
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
In the **asynchronous** case subdevice probing can be invoked independently of
the bridge driver availability. The subdevice driver then has to verify whether
all the requirements for a successful probing are satisfied. This can include a
@@ -190,6 +195,9 @@ performed using the :c:func:`v4l2_async_unregister_subdev` call. Subdevices
registered this way are stored in a global list of subdevices, ready to be
picked up by bridge drivers.
+Asynchronous sub-device notifiers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
Bridge drivers in turn have to register a notifier object. This is
performed using the :c:func:`v4l2_async_nf_register` call. To
unregister the notifier the driver has to call
@@ -208,12 +216,18 @@ the needs of the driver.
:c:func:`v4l2_async_nf_add_i2c` are for bridge and ISP drivers for
registering their async sub-devices with the notifier.
+Asynchronous sub-device registration helper for camera sensor drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
:c:func:`v4l2_async_register_subdev_sensor` is a helper function for
sensor drivers registering their own async sub-device, but it also registers a
notifier and further registers async sub-devices for lens and flash devices
found in firmware. The notifier for the sub-device is unregistered with the
async sub-device.
+Asynchronous sub-device notifier example
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
These functions allocate an async sub-device descriptor which is of type struct
:c:type:`v4l2_async_subdev` embedded in a driver-specific struct. The &struct
:c:type:`v4l2_async_subdev` shall be the first member of this struct:
@@ -237,6 +251,9 @@ These functions allocate an async sub-device descriptor which is of type struct
if (IS_ERR(my_asd))
return PTR_ERR(my_asd);
+Asynchronous sub-device notifier callbacks
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
The V4L2 core will then use these descriptors to match asynchronously
registered subdevices to them. If a match is detected the ``.bound()``
notifier callback is called. After all subdevices have been located the