All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benoit Parrot <bparrot@ti.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: <linux-media@vger.kernel.org>, <akinobu.mita@gmail.com>,
	<robert.jarzmik@free.fr>, <hverkuil@xs4all.nl>
Subject: Re: [PATCH v1.1 4/4] ti-vpe: Parse local endpoint for properties, not the remote one
Date: Tue, 5 Mar 2019 08:34:09 -0600	[thread overview]
Message-ID: <20190305143409.yzmusyvuaab5ap4w@ti.com> (raw)
In-Reply-To: <20190305140224.25889-1-sakari.ailus@linux.intel.com>

Sakari,

Thank you for the patch.

Sakari Ailus <sakari.ailus@linux.intel.com> wrote on Tue [2019-Mar-05 16:02:24 +0200]:
> ti-vpe driver parsed the remote endpoints for properties but ignored the
> local ones. Fix this by parsing the local endpoint properties instead.

I am not sure I understand the logic here.  For CSI2 sensor as far as I
understand the lane mapping (clock and data) is driven from the sensor
side. The bridge driver (in this case CAL) needs to setup the receiver side
based on what the sensor (aka remote endpoint) can provide.

I failed to see how this fixes things here.

Are you suggesting that sensor relevant properties be set (and effectively
duplicated) on the bridge/receiver side?

Some sensor can and do handle multiple data lanes configuration so the
sensor driver also needs to use those properties at probe time, duplicating
the lane data is just asking for a mismatch to happen, no?

Benoit

> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> since v1:
> 
> - Remove of_node_put(remote_ep) as well, the only remaining reference to it.
> 
>  drivers/media/platform/ti-vpe/cal.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
> index fc3c212b96e1..8d075683e448 100644
> --- a/drivers/media/platform/ti-vpe/cal.c
> +++ b/drivers/media/platform/ti-vpe/cal.c
> @@ -1643,8 +1643,7 @@ of_get_next_endpoint(const struct device_node *parent,
>  static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
>  {
>  	struct platform_device *pdev = ctx->dev->pdev;
> -	struct device_node *ep_node, *port, *remote_ep,
> -			*sensor_node, *parent;
> +	struct device_node *ep_node, *port, *sensor_node, *parent;
>  	struct v4l2_fwnode_endpoint *endpoint;
>  	struct v4l2_async_subdev *asd;
>  	u32 regval = 0;
> @@ -1657,7 +1656,6 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
>  
>  	ep_node = NULL;
>  	port = NULL;
> -	remote_ep = NULL;
>  	sensor_node = NULL;
>  	ret = -EINVAL;
>  
> @@ -1703,12 +1701,7 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
>  	asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
>  	asd->match.fwnode = of_fwnode_handle(sensor_node);
>  
> -	remote_ep = of_graph_get_remote_endpoint(ep_node);
> -	if (!remote_ep) {
> -		ctx_dbg(3, ctx, "can't get remote-endpoint\n");
> -		goto cleanup_exit;
> -	}
> -	v4l2_fwnode_endpoint_parse(of_fwnode_handle(remote_ep), endpoint);
> +	v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep_node), endpoint);
>  
>  	if (endpoint->bus_type != V4L2_MBUS_CSI2_DPHY) {
>  		ctx_err(ctx, "Port:%d sub-device %pOFn is not a CSI2 device\n",
> @@ -1759,7 +1752,6 @@ static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
>  	sensor_node = NULL;
>  
>  cleanup_exit:
> -	of_node_put(remote_ep);
>  	of_node_put(sensor_node);
>  	of_node_put(ep_node);
>  	of_node_put(port);
> -- 
> 2.11.0
> 

  reply	other threads:[~2019-03-05 14:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 13:55 [PATCH 0/4] V4L2 fwnode framework and driver fixes Sakari Ailus
2019-03-05 13:55 ` [PATCH 1/4] v4l2-fwnode: Defaults may not override endpoint configuration in firmware Sakari Ailus
2019-03-05 13:56 ` [PATCH 2/4] v4l2-fwnode: The first default data lane is 0 on C-PHY Sakari Ailus
2019-03-05 13:56 ` [PATCH 3/4] pxa-camera: Match with device node, not the port node Sakari Ailus
2019-08-21  7:26   ` Robert Jarzmik
2019-08-21  8:24     ` Sakari Ailus
2019-03-05 13:56 ` [PATCH 4/4] ti-vpe: Parse local endpoint for properties, not the remote one Sakari Ailus
2019-03-05 14:02   ` [PATCH v1.1 " Sakari Ailus
2019-03-05 14:34     ` Benoit Parrot [this message]
2019-03-05 16:32       ` Sakari Ailus
2019-03-05 17:38         ` Benoit Parrot
2019-03-05 20:48           ` Sakari Ailus
2019-03-07 15:34             ` Benoit Parrot
2019-03-07 15:55               ` Sakari Ailus
2019-03-07 21:25   ` [PATCH " kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190305143409.yzmusyvuaab5ap4w@ti.com \
    --to=bparrot@ti.com \
    --cc=akinobu.mita@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=robert.jarzmik@free.fr \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.