diff mbox series

[1/3] media: cadence: csi2rx: use match fwnode for media link

Message ID 20231208152255.472467-2-julien.massot@collabora.com (mailing list archive)
State New, archived
Headers show
Series misc improvment for j721e csi2rx | expand

Commit Message

Julien Massot Dec. 8, 2023, 3:22 p.m. UTC
On some subdev the fwnode is the device node and not the endpoint node.
Using the subdev fwnode doesn't allow to fetch the subdev
pad we are connected to when the remote subdev has multiple
output pads.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jai Luthra Dec. 12, 2023, 7:54 a.m. UTC | #1
Hi Julien,

Thanks for the patch.

Please make sure to add the media maintainers in To/Cc, you can use 
get_maintainers.pl script for the full list.

On Dec 08, 2023 at 16:22:53 +0100, Julien Massot wrote:
> On some subdev the fwnode is the device node and not the endpoint node.
> Using the subdev fwnode doesn't allow to fetch the subdev
> pad we are connected to when the remote subdev has multiple
> output pads.
> 
> Signed-off-by: Julien Massot <julien.massot@collabora.com>
> ---
>  drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
> index b751227fc8a0..b9356cc7a192 100644
> --- a/drivers/media/platform/cadence/cdns-csi2rx.c
> +++ b/drivers/media/platform/cadence/cdns-csi2rx.c
> @@ -464,7 +464,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
>  	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
>  
>  	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
> -							 s_subdev->fwnode,
> +							 asd->match.fwnode,
>  							 MEDIA_PAD_FL_SOURCE);

LGTM, this also fixes a similar issue I was seeing with getting fwnode 
pad ds90ub960 source which has multiple output pads.

Reviewed-by: Jai Luthra <j-luthra@ti.com>

>  	if (csi2rx->source_pad < 0) {
>  		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",
> -- 
> 2.43.0
>
Jai Luthra Dec. 12, 2023, 7:57 a.m. UTC | #2
On Dec 12, 2023 at 13:24:42 +0530, Jai Luthra wrote:
> Hi Julien,
> 
> Thanks for the patch.
> 
> Please make sure to add the media maintainers in To/Cc, you can use 
> get_maintainers.pl script for the full list.
> 
> On Dec 08, 2023 at 16:22:53 +0100, Julien Massot wrote:
> > On some subdev the fwnode is the device node and not the endpoint node.
> > Using the subdev fwnode doesn't allow to fetch the subdev
> > pad we are connected to when the remote subdev has multiple
> > output pads.
> > 
> > Signed-off-by: Julien Massot <julien.massot@collabora.com>
> > ---
> >  drivers/media/platform/cadence/cdns-csi2rx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
> > index b751227fc8a0..b9356cc7a192 100644
> > --- a/drivers/media/platform/cadence/cdns-csi2rx.c
> > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c
> > @@ -464,7 +464,7 @@ static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
> >  	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
> >  
> >  	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
> > -							 s_subdev->fwnode,
> > +							 asd->match.fwnode,
> >  							 MEDIA_PAD_FL_SOURCE);
> 
> LGTM, this also fixes a similar issue I was seeing with getting fwnode 
> pad ds90ub960 source which has multiple output pads.
> 
> Reviewed-by: Jai Luthra <j-luthra@ti.com>

This should probably carry a fixes tag as well:

Fixes: 1fc3b37f34f69 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver")

> 
> >  	if (csi2rx->source_pad < 0) {
> >  		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",
> > -- 
> > 2.43.0
> > 
> 
> -- 
> Thanks,
> Jai
> 
> GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
diff mbox series

Patch

diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
index b751227fc8a0..b9356cc7a192 100644
--- a/drivers/media/platform/cadence/cdns-csi2rx.c
+++ b/drivers/media/platform/cadence/cdns-csi2rx.c
@@ -464,7 +464,7 @@  static int csi2rx_async_bound(struct v4l2_async_notifier *notifier,
 	struct csi2rx_priv *csi2rx = v4l2_subdev_to_csi2rx(subdev);
 
 	csi2rx->source_pad = media_entity_get_fwnode_pad(&s_subdev->entity,
-							 s_subdev->fwnode,
+							 asd->match.fwnode,
 							 MEDIA_PAD_FL_SOURCE);
 	if (csi2rx->source_pad < 0) {
 		dev_err(csi2rx->dev, "Couldn't find output pad for subdev %s\n",