From: Sakari Ailus Date: Tue, 20 Jun 2023 12:03:02 +0000 (+0200) Subject: media: Documentation: v4l: Add section titles for async X-Git-Tag: v6.6.17~4033^2~213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5202fb581e52962c978b7a9e8ca0f4f1fb75cd0b;p=platform%2Fkernel%2Flinux-rpi.git 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 Tested-by: Lad Prabhakar # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab --- diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst index c46511c..3cc56ac 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 ` (:c:type:`sd `). - Afterwards the subdev module can be unloaded and :c:type:`sd `->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