devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <mwalle@kernel.org>
To: tony@atomide.com
Cc: Laurent.pinchart@ideasonboard.com, airlied@gmail.com,
	andrzej.hajda@intel.com, daniel@ffwll.ch,
	devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org,
	ivo.g.dimitrov.75@gmail.com, jernej.skrabec@gmail.com,
	jonas@kwiboo.se, maarten.lankhorst@linux.intel.com,
	merlijn@wizzup.org, mripard@kernel.org,
	neil.armstrong@linaro.org, pavel@ucw.cz, philipp@uvos.xyz,
	rfoss@kernel.org, sam@ravnborg.org, simhavcs@gmail.com,
	sre@kernel.org, tzimmermann@suse.de,
	Michael Walle <mwalle@kernel.org>
Subject: Re: [PATCH 2/6] drm/bridge: tc358775: Fix getting dsi host data lanes
Date: Mon, 27 Nov 2023 14:09:41 +0100	[thread overview]
Message-ID: <20231127130941.2154871-1-mwalle@kernel.org> (raw)
In-Reply-To: <20231126163247.10131-2-tony@atomide.com>

> The current code assume hardcoded dsi host endpoint 1, which may not
> be the case. Let's fix that and simplify the code by getting the dsi
> endpoint with of_graph_get_remote_endpoint() that does not assume any
> endpoint numbering.
> 
> Fixes: b26975593b17 ("display/drm/bridge: TC358775 DSI/LVDS driver")
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/gpu/drm/bridge/tc358775.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c
> --- a/drivers/gpu/drm/bridge/tc358775.c
> +++ b/drivers/gpu/drm/bridge/tc358775.c
> @@ -528,25 +528,17 @@ tc_mode_valid(struct drm_bridge *bridge,
>  static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc)
>  {
>  	struct device_node *endpoint;
> -	struct device_node *parent;
>  	struct device_node *remote;
>  	int dsi_lanes = -1;
>  
> -	/*
> -	 * To get the data-lanes of dsi, we need to access the dsi0_out of port1
> -	 *  of dsi0 endpoint from bridge port0 of d2l_in
> -	 */
>  	endpoint = of_graph_get_endpoint_by_regs(tc->dev->of_node,
>  						 TC358775_DSI_IN, -1);
>  	if (endpoint) {
> -		/* dsi0_out node */
> -		parent = of_graph_get_remote_port_parent(endpoint);
> +		/* Get the configured data lanes on the dsi host side */
> +		remote = of_graph_get_remote_endpoint(endpoint);
>  		of_node_put(endpoint);
> -		if (parent) {
> -			/* dsi0 port 1 */
> -			dsi_lanes = drm_of_get_data_lanes_count_ep(parent, 1, -1, 1, 4);
> -			of_node_put(parent);
> -		}
> +		dsi_lanes = drm_of_get_data_lanes_count(remote, 1, 4);

I actually have the same fix, but with one additional detail, which I'm
unsure about though: This looks at the data-lanes property of the *remote*
endpoint whereas other bridge drivers (see tc358767, ti-sn65dsi83, lt8912b,
anx7625) look at the local endpoint and I'm not sure what is correct.

-michael

  parent reply	other threads:[~2023-11-27 13:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-26 16:32 [PATCH 1/6] dt-bindings: tc358775: Add support for tc358765 Tony Lindgren
2023-11-26 16:32 ` [PATCH 2/6] drm/bridge: tc358775: Fix getting dsi host data lanes Tony Lindgren
2023-11-26 17:18   ` [PATCH 3/6] drm/bridge: tc358775: Add jeida-24 support Tony Lindgren
2023-11-26 18:17     ` [PATCH 4/6] drm/bridge: tc358775: Add burst and low-power modes Tony Lindgren
2023-11-26 18:56       ` [PATCH 5/6] drm/bridge: tc358775: Add support for tc358765 Tony Lindgren
2023-11-26 19:15         ` [PATCH 6/6] drm/bridge: tc358775: Configure hs_rate and lp_rate Tony Lindgren
2023-11-27 13:25     ` [PATCH 3/6] drm/bridge: tc358775: Add jeida-24 support Michael Walle
2023-11-27 13:40       ` Tony Lindgren
2023-11-27 13:09   ` Michael Walle [this message]
2023-11-27 13:19     ` [PATCH 2/6] drm/bridge: tc358775: Fix getting dsi host data lanes Tony Lindgren
2023-11-27 14:31       ` Michael Walle
2023-11-27 15:06         ` Tony Lindgren
2023-11-27  7:18 ` [PATCH 1/6] dt-bindings: tc358775: Add support for tc358765 Krzysztof Kozlowski
2023-11-27 12:44 ` Michael Walle
2023-11-27 13:07   ` Tony Lindgren
2023-11-27 13:21   ` Alexander Stein

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=20231127130941.2154871-1-mwalle@kernel.org \
    --to=mwalle@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=merlijn@wizzup.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=pavel@ucw.cz \
    --cc=philipp@uvos.xyz \
    --cc=rfoss@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=simhavcs@gmail.com \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).