diff mbox series

[RESEND,v3,32/32] media: Documentation: v4l: Document sub-device notifiers

Message ID 20230525091615.2324824-33-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Separate links and async sub-devices | expand

Commit Message

Sakari Ailus May 25, 2023, 9:16 a.m. UTC
Document that sub-device notifiers are now registered using
v4l2_async_subdev_nf_init(). No documentation is changed as it seems that
sub-device notifiers were not documented apart from kernel-doc comments.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 Documentation/driver-api/media/v4l2-subdev.rst | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Laurent Pinchart May 30, 2023, 6:18 a.m. UTC | #1
Hi Sakari,

Thank you for the patch.

On Thu, May 25, 2023 at 12:16:15PM +0300, Sakari Ailus wrote:
> Document that sub-device notifiers are now registered using
> v4l2_async_subdev_nf_init(). No documentation is changed as it seems that
> sub-device notifiers were not documented apart from kernel-doc comments.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  Documentation/driver-api/media/v4l2-subdev.rst | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
> index 83d3d29608136..d62b341642c96 100644
> --- a/Documentation/driver-api/media/v4l2-subdev.rst
> +++ b/Documentation/driver-api/media/v4l2-subdev.rst
> @@ -193,9 +193,7 @@ picked up by bridge drivers.
>  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
> -:c:func:`v4l2_async_nf_unregister`. The former of the two functions
> -takes two arguments: a pointer to struct :c:type:`v4l2_device` and a
> -pointer to struct :c:type:`v4l2_async_notifier`.
> +:c:func:`v4l2_async_nf_unregister`.
>  
>  Before registering the notifier, bridge drivers must do two things: first, the
>  notifier must be initialized using the :c:func:`v4l2_async_nf_init`.
> @@ -204,6 +202,12 @@ that the bridge device needs for its operation. Several functions are available
>  to add subdevice descriptors to a notifier, depending on the type of device and
>  the needs of the driver.
>  
> +For a sub-device driver to register a notifier, the process is otherwise similar
> +to that of a bridge driver, apart from that the notifier is initialised using
> +:c:func:`v4l2_async_subdev_nf_init` instead. A sub-device notifier may complete
> +only after the V4L2 device becomes available, i.e. there's a path via async
> +sub-devices and notifiers to that root notifier.

This is correct, but I doubt anyone who doesn't have an in-depth
knowledge of the v4l2-async framework will be able to understand it. For
instance, the concept of "root notifier" isn't explained anywhere. And
the v4l2_async_subdev_nf_register() function isn't mentioned.

The v4l2-async documentation needs a rewrite.

> +
>  :c:func:`v4l2_async_nf_add_fwnode`, :c:func:`v4l2_async_nf_add_fwnode_remote`
>  :c:and func:`v4l2_async_nf_add_i2c` are for registering their async sub-devices
>  :c:with the notifier.
Aishwarya Kothari May 30, 2023, 12:13 p.m. UTC | #2
On 25.05.23 11:16, Sakari Ailus wrote:
> Document that sub-device notifiers are now registered using
> v4l2_async_subdev_nf_init(). No documentation is changed as it seems that
> sub-device notifiers were not documented apart from kernel-doc comments.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>   Documentation/driver-api/media/v4l2-subdev.rst | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
> index 83d3d29608136..d62b341642c96 100644
> --- a/Documentation/driver-api/media/v4l2-subdev.rst
> +++ b/Documentation/driver-api/media/v4l2-subdev.rst
> @@ -193,9 +193,7 @@ picked up by bridge drivers.
>   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
> -:c:func:`v4l2_async_nf_unregister`. The former of the two functions
> -takes two arguments: a pointer to struct :c:type:`v4l2_device` and a
> -pointer to struct :c:type:`v4l2_async_notifier`.
> +:c:func:`v4l2_async_nf_unregister`.
>   
>   Before registering the notifier, bridge drivers must do two things: first, the
>   notifier must be initialized using the :c:func:`v4l2_async_nf_init`.
> @@ -204,6 +202,12 @@ that the bridge device needs for its operation. Several functions are available
>   to add subdevice descriptors to a notifier, depending on the type of device and
>   the needs of the driver.
>   
> +For a sub-device driver to register a notifier, the process is otherwise similar
> +to that of a bridge driver, apart from that the notifier is initialised using
> +:c:func:`v4l2_async_subdev_nf_init` instead. A sub-device notifier may complete
> +only after the V4L2 device becomes available, i.e. there's a path via async
> +sub-devices and notifiers to that root notifier.
> +
>   :c:func:`v4l2_async_nf_add_fwnode`, :c:func:`v4l2_async_nf_add_fwnode_remote`
>   :c:and func:`v4l2_async_nf_add_i2c` are for registering their async sub-devices
>   :c:with the notifier.

Works on Apalis i.MX6Q with TC358743.

Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com>

regards,
Aishwarya
Sakari Ailus June 20, 2023, 10:14 a.m. UTC | #3
Hi Laurent,

On Tue, May 30, 2023 at 09:18:20AM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Thu, May 25, 2023 at 12:16:15PM +0300, Sakari Ailus wrote:
> > Document that sub-device notifiers are now registered using
> > v4l2_async_subdev_nf_init(). No documentation is changed as it seems that
> > sub-device notifiers were not documented apart from kernel-doc comments.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> >  Documentation/driver-api/media/v4l2-subdev.rst | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
> > index 83d3d29608136..d62b341642c96 100644
> > --- a/Documentation/driver-api/media/v4l2-subdev.rst
> > +++ b/Documentation/driver-api/media/v4l2-subdev.rst
> > @@ -193,9 +193,7 @@ picked up by bridge drivers.
> >  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
> > -:c:func:`v4l2_async_nf_unregister`. The former of the two functions
> > -takes two arguments: a pointer to struct :c:type:`v4l2_device` and a
> > -pointer to struct :c:type:`v4l2_async_notifier`.
> > +:c:func:`v4l2_async_nf_unregister`.
> >  
> >  Before registering the notifier, bridge drivers must do two things: first, the
> >  notifier must be initialized using the :c:func:`v4l2_async_nf_init`.
> > @@ -204,6 +202,12 @@ that the bridge device needs for its operation. Several functions are available
> >  to add subdevice descriptors to a notifier, depending on the type of device and
> >  the needs of the driver.
> >  
> > +For a sub-device driver to register a notifier, the process is otherwise similar
> > +to that of a bridge driver, apart from that the notifier is initialised using
> > +:c:func:`v4l2_async_subdev_nf_init` instead. A sub-device notifier may complete
> > +only after the V4L2 device becomes available, i.e. there's a path via async
> > +sub-devices and notifiers to that root notifier.
> 
> This is correct, but I doubt anyone who doesn't have an in-depth
> knowledge of the v4l2-async framework will be able to understand it. For
> instance, the concept of "root notifier" isn't explained anywhere. And
> the v4l2_async_subdev_nf_register() function isn't mentioned.

That's because the function no longer exists. :-)

> 
> The v4l2-async documentation needs a rewrite.

It would benefit from improvements, yes. I can add patches for this if you
prefer.

> 
> > +
> >  :c:func:`v4l2_async_nf_add_fwnode`, :c:func:`v4l2_async_nf_add_fwnode_remote`
> >  :c:and func:`v4l2_async_nf_add_i2c` are for registering their async sub-devices
> >  :c:with the notifier.
>
diff mbox series

Patch

diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
index 83d3d29608136..d62b341642c96 100644
--- a/Documentation/driver-api/media/v4l2-subdev.rst
+++ b/Documentation/driver-api/media/v4l2-subdev.rst
@@ -193,9 +193,7 @@  picked up by bridge drivers.
 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
-:c:func:`v4l2_async_nf_unregister`. The former of the two functions
-takes two arguments: a pointer to struct :c:type:`v4l2_device` and a
-pointer to struct :c:type:`v4l2_async_notifier`.
+:c:func:`v4l2_async_nf_unregister`.
 
 Before registering the notifier, bridge drivers must do two things: first, the
 notifier must be initialized using the :c:func:`v4l2_async_nf_init`.
@@ -204,6 +202,12 @@  that the bridge device needs for its operation. Several functions are available
 to add subdevice descriptors to a notifier, depending on the type of device and
 the needs of the driver.
 
+For a sub-device driver to register a notifier, the process is otherwise similar
+to that of a bridge driver, apart from that the notifier is initialised using
+:c:func:`v4l2_async_subdev_nf_init` instead. A sub-device notifier may complete
+only after the V4L2 device becomes available, i.e. there's a path via async
+sub-devices and notifiers to that root notifier.
+
 :c:func:`v4l2_async_nf_add_fwnode`, :c:func:`v4l2_async_nf_add_fwnode_remote`
 :c:and func:`v4l2_async_nf_add_i2c` are for registering their async sub-devices
 :c:with the notifier.