All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
@ 2020-12-14 21:33 Sakari Ailus
  2021-01-07 19:31 ` Ezequiel Garcia
  0 siblings, 1 reply; 6+ messages in thread
From: Sakari Ailus @ 2020-12-14 21:33 UTC (permalink / raw)
  To: linux-media

Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
Its functionality has been replaced by other, better functions. Also add a
reference to an example if someone ends up wandering here.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/v4l2-fwnode.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index 4365430eea6f..d0a1293379ab 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -453,6 +453,10 @@ typedef int (*parse_endpoint_func)(struct device *dev,
  * @parse_endpoint: Driver's callback function called on each V4L2 fwnode
  *		    endpoint. Optional.
  *
+ * DEPRECATED! This function is deprecated. Don't use it in new drivers.
+ * Instead see an example in cio2_parse_firmware() function in
+ * drivers/media/pci/intel/ipu3/ipu3-cio2.c .
+ *
  * Parse the fwnode endpoints of the @dev device and populate the async sub-
  * devices list in the notifier. The @parse_endpoint callback function is
  * called for each endpoint with the corresponding async sub-device pointer to
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
  2020-12-14 21:33 [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated Sakari Ailus
@ 2021-01-07 19:31 ` Ezequiel Garcia
  2021-01-07 22:07   ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Ezequiel Garcia @ 2021-01-07 19:31 UTC (permalink / raw)
  To: Sakari Ailus, Maxime Ripard, Yong Deng; +Cc: linux-media

Hi Sakari,

On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> Its functionality has been replaced by other, better functions. Also add a
> reference to an example if someone ends up wandering here.
>

I'm working on a series to clean up the v4l2_async API a bit,
and came across this patch.

As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.

Adding Maxime and Yong Deng, it would be great to get rid of this,
so we can remove the API, which would also allow us to remove
some other internal functions and therefore make the API a bit cleaner.

Thanks,
Ezequiel

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  include/media/v4l2-fwnode.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
> index 4365430eea6f..d0a1293379ab 100644
> --- a/include/media/v4l2-fwnode.h
> +++ b/include/media/v4l2-fwnode.h
> @@ -453,6 +453,10 @@ typedef int (*parse_endpoint_func)(struct device *dev,
>   * @parse_endpoint: Driver's callback function called on each V4L2 fwnode
>   *                 endpoint. Optional.
>   *
> + * DEPRECATED! This function is deprecated. Don't use it in new drivers.
> + * Instead see an example in cio2_parse_firmware() function in
> + * drivers/media/pci/intel/ipu3/ipu3-cio2.c .
> + *
>   * Parse the fwnode endpoints of the @dev device and populate the async sub-
>   * devices list in the notifier. The @parse_endpoint callback function is
>   * called for each endpoint with the corresponding async sub-device pointer to
> --
> 2.29.2
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
  2021-01-07 19:31 ` Ezequiel Garcia
@ 2021-01-07 22:07   ` Sakari Ailus
  2021-01-08  9:57     ` Paul Kocialkowski
  2021-01-11  0:59     ` Ezequiel Garcia
  0 siblings, 2 replies; 6+ messages in thread
From: Sakari Ailus @ 2021-01-07 22:07 UTC (permalink / raw)
  To: Ezequiel Garcia; +Cc: Maxime Ripard, Yong Deng, linux-media

Hi Ezequiel,

On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> Hi Sakari,
> 
> On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >
> > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > Its functionality has been replaced by other, better functions. Also add a
> > reference to an example if someone ends up wandering here.
> >
> 
> I'm working on a series to clean up the v4l2_async API a bit,
> and came across this patch.
> 
> As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.

It may be that's the only one left. The intent was also to avoid anyone
proposing new ones.

> Adding Maxime and Yong Deng, it would be great to get rid of this,
> so we can remove the API, which would also allow us to remove
> some other internal functions and therefore make the API a bit cleaner.

Yes, that'd be very nice. Then we could remove it altogether.

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
  2021-01-07 22:07   ` Sakari Ailus
@ 2021-01-08  9:57     ` Paul Kocialkowski
  2021-01-08 10:09       ` Sakari Ailus
  2021-01-11  0:59     ` Ezequiel Garcia
  1 sibling, 1 reply; 6+ messages in thread
From: Paul Kocialkowski @ 2021-01-08  9:57 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Ezequiel Garcia, Maxime Ripard, Yong Deng, linux-media

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]

Hi,

On Fri 08 Jan 21, 00:07, Sakari Ailus wrote:
> Hi Ezequiel,
> 
> On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > Hi Sakari,
> > 
> > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > Its functionality has been replaced by other, better functions. Also add a
> > > reference to an example if someone ends up wandering here.
> > >
> > 
> > I'm working on a series to clean up the v4l2_async API a bit,
> > and came across this patch.
> > 
> > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
> 
> It may be that's the only one left. The intent was also to avoid anyone
> proposing new ones.
> 
> > Adding Maxime and Yong Deng, it would be great to get rid of this,
> > so we can remove the API, which would also allow us to remove
> > some other internal functions and therefore make the API a bit cleaner.
> 
> Yes, that'd be very nice. Then we could remove it altogether.

I've been touching that area a bit with my MIPI CSI-2 support series.
I'll try to get rid of it along the way if I need to respin the series,
or come up with a follow-up patch to remove the call to this function.

If I understand correctly, the preferred way now is to use:
- fwnode_graph_get_endpoint_by_id
- v4l2_fwnode_endpoint_parse
- v4l2_async_notifier_add_fwnode_remote_subdev

Is that correct? I think that's what I've been doing in the MIPI CSI-2
bridge drivers so far.

Cheers,

Paul

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
  2021-01-08  9:57     ` Paul Kocialkowski
@ 2021-01-08 10:09       ` Sakari Ailus
  0 siblings, 0 replies; 6+ messages in thread
From: Sakari Ailus @ 2021-01-08 10:09 UTC (permalink / raw)
  To: Paul Kocialkowski; +Cc: Ezequiel Garcia, Maxime Ripard, Yong Deng, linux-media

Hi Paul,

On Fri, Jan 08, 2021 at 10:57:57AM +0100, Paul Kocialkowski wrote:
> Hi,
> 
> On Fri 08 Jan 21, 00:07, Sakari Ailus wrote:
> > Hi Ezequiel,
> > 
> > On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > > Hi Sakari,
> > > 
> > > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > > >
> > > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > > Its functionality has been replaced by other, better functions. Also add a
> > > > reference to an example if someone ends up wandering here.
> > > >
> > > 
> > > I'm working on a series to clean up the v4l2_async API a bit,
> > > and came across this patch.
> > > 
> > > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
> > 
> > It may be that's the only one left. The intent was also to avoid anyone
> > proposing new ones.
> > 
> > > Adding Maxime and Yong Deng, it would be great to get rid of this,
> > > so we can remove the API, which would also allow us to remove
> > > some other internal functions and therefore make the API a bit cleaner.
> > 
> > Yes, that'd be very nice. Then we could remove it altogether.
> 
> I've been touching that area a bit with my MIPI CSI-2 support series.
> I'll try to get rid of it along the way if I need to respin the series,
> or come up with a follow-up patch to remove the call to this function.
> 
> If I understand correctly, the preferred way now is to use:
> - fwnode_graph_get_endpoint_by_id
> - v4l2_fwnode_endpoint_parse
> - v4l2_async_notifier_add_fwnode_remote_subdev
> 
> Is that correct? I think that's what I've been doing in the MIPI CSI-2
> bridge drivers so far.

Yes, that's the preferred way.

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated
  2021-01-07 22:07   ` Sakari Ailus
  2021-01-08  9:57     ` Paul Kocialkowski
@ 2021-01-11  0:59     ` Ezequiel Garcia
  1 sibling, 0 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2021-01-11  0:59 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Maxime Ripard, Yong Deng, linux-media

Hi Sakari,

On Thu, 7 Jan 2021 at 19:07, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hi Ezequiel,
>
> On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > Hi Sakari,
> >
> > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > Its functionality has been replaced by other, better functions. Also add a
> > > reference to an example if someone ends up wandering here.
> > >
> >
> > I'm working on a series to clean up the v4l2_async API a bit,
> > and came across this patch.
> >
> > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
>
> It may be that's the only one left. The intent was also to avoid anyone
> proposing new ones.
>

If we want to avoid any users, how about we make it clear the function
is maybe not a good idea by renaming it to:

__v4l2_async_notifier_parse_fwnode_endpoints ?

Thanks,
Ezequiel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-11  1:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 21:33 [PATCH 1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated Sakari Ailus
2021-01-07 19:31 ` Ezequiel Garcia
2021-01-07 22:07   ` Sakari Ailus
2021-01-08  9:57     ` Paul Kocialkowski
2021-01-08 10:09       ` Sakari Ailus
2021-01-11  0:59     ` Ezequiel Garcia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.