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>
This commit is contained in:
Sakari Ailus
2023-06-20 14:03:02 +02:00
committed by Mauro Carvalho Chehab
parent ec29509467
commit 5202fb581e

View File

@ -157,6 +157,9 @@ below.
Using one or the other registration method only affects the probing process, the Using one or the other registration method only affects the probing process, the
run-time bridge-subdevice interaction is in both cases the same. 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 In the **synchronous** case a device (bridge) driver needs to register the
:c:type:`v4l2_subdev` with the v4l2_device: :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:func:`v4l2_device_unregister_subdev <v4l2_device_unregister_subdev>`
(:c:type:`sd <v4l2_subdev>`). (:c:type:`sd <v4l2_subdev>`).
Afterwards the subdev module can be unloaded and Afterwards the subdev module can be unloaded and
:c:type:`sd <v4l2_subdev>`->dev == ``NULL``. :c:type:`sd <v4l2_subdev>`->dev == ``NULL``.
Registering asynchronous sub-devices
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In the **asynchronous** case subdevice probing can be invoked independently of In the **asynchronous** case subdevice probing can be invoked independently of
the bridge driver availability. The subdevice driver then has to verify whether 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 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 registered this way are stored in a global list of subdevices, ready to be
picked up by bridge drivers. picked up by bridge drivers.
Asynchronous sub-device notifiers
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bridge drivers in turn have to register a notifier object. This is Bridge drivers in turn have to register a notifier object. This is
performed using the :c:func:`v4l2_async_nf_register` call. To performed using the :c:func:`v4l2_async_nf_register` call. To
unregister the notifier the driver has to call 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 :c:func:`v4l2_async_nf_add_i2c` are for bridge and ISP drivers for
registering their async sub-devices with the notifier. 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 :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 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 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 found in firmware. The notifier for the sub-device is unregistered with the
async sub-device. async sub-device.
Asynchronous sub-device notifier example
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These functions allocate an async sub-device descriptor which is of type struct 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` embedded in a driver-specific struct. The &struct
:c:type:`v4l2_async_subdev` shall be the first member of this 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)) if (IS_ERR(my_asd))
return PTR_ERR(my_asd); return PTR_ERR(my_asd);
Asynchronous sub-device notifier callbacks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The V4L2 core will then use these descriptors to match asynchronously The V4L2 core will then use these descriptors to match asynchronously
registered subdevices to them. If a match is detected the ``.bound()`` registered subdevices to them. If a match is detected the ``.bound()``
notifier callback is called. After all subdevices have been located the notifier callback is called. After all subdevices have been located the