mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: CK Hu <ck.hu@mediatek.com>
To: <xinlei.lee@mediatek.com>, <chunkuang.hu@kernel.org>,
	<p.zabel@pengutronix.de>, <airlied@linux.ie>, <daniel@ffwll.ch>,
	<matthias.bgg@gmail.com>
Cc: <dri-devel@lists.freedesktop.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<srv_heupstream@mediatek.com>, <linux-kernel@vger.kernel.org>,
	<jitao.shi@mediatek.com>
Subject: Re: [v1, 3/3] drm/mediatek: Move the getting bridge node function to mtk_dsi_bind
Date: Fri, 28 Jan 2022 13:03:55 +0800	[thread overview]
Message-ID: <092258211c47eca805c4dea6c4bf4ecc4c246cea.camel@mediatek.com> (raw)
In-Reply-To: <1643283773-7081-4-git-send-email-xinlei.lee@mediatek.com>

Hi, Xinlei:

On Thu, 2022-01-27 at 19:42 +0800, xinlei.lee@mediatek.com wrote:
> From: xinlei lee <xinlei.lee@mediatek.com>
> 
> The order of probe function for bridge drivers and dsi drivers is
> uncertain.
> To avoid the dsi probe cannot be executed, we place getting bridge
> node function in
> mtk_dsi_bind.

It seems this patch want to fix the same problem as [1]. Does [1] fix
your problem? If so, let's ignore this patch.

[1] 
https://patchwork.kernel.org/project/linux-mediatek/patch/20220127143623.123025-1-angelogioacchino.delregno@collabora.com/

Regards,
CK

> 
> Signed-off-by:Xinlei Lee <xinlei.lee@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 29 +++++++++++++++-------------
> -
>  1 file changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 62af60d..a390f26 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -991,6 +991,21 @@ static int mtk_dsi_bind(struct device *dev,
> struct device *master, void *data)
>  	int ret;
>  	struct drm_device *drm = data;
>  	struct mtk_dsi *dsi = dev_get_drvdata(dev);
> +	struct drm_panel *panel;
> +
> +	ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
> +					  &panel, &dsi->next_bridge);
> +	if (ret)
> +		return ret;
> +
> +	if (panel) {
> +		dsi->next_bridge = devm_drm_panel_bridge_add(dev,
> panel);
> +		if (IS_ERR(dsi->next_bridge)) {
> +			ret = PTR_ERR(dsi->next_bridge);
> +			dev_err(dev, "failed to add bridge: %d\n",
> ret);
> +			return ret;
> +		}
> +	}
>  
>  	ret = mtk_dsi_encoder_init(drm, dsi);
>  	if (ret)
> @@ -1016,7 +1031,6 @@ static int mtk_dsi_probe(struct platform_device
> *pdev)
>  {
>  	struct mtk_dsi *dsi;
>  	struct device *dev = &pdev->dev;
> -	struct drm_panel *panel;
>  	struct resource *regs;
>  	int irq_num;
>  	int ret;
> @@ -1033,19 +1047,6 @@ static int mtk_dsi_probe(struct
> platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
> -					  &panel, &dsi->next_bridge);
> -	if (ret)
> -		goto err_unregister_host;
> -
> -	if (panel) {
> -		dsi->next_bridge = devm_drm_panel_bridge_add(dev,
> panel);
> -		if (IS_ERR(dsi->next_bridge)) {
> -			ret = PTR_ERR(dsi->next_bridge);
> -			goto err_unregister_host;
> -		}
> -	}
> -
>  	dsi->driver_data = of_device_get_match_data(dev);
>  
>  	dsi->engine_clk = devm_clk_get(dev, "engine");


  reply	other threads:[~2022-01-28  5:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 11:42 [v1,0/3] Add mt8186 dsi compatoble & Move the getting bridge node function xinlei.lee
2022-01-27 11:42 ` [v1,1/3] dt-bindings: display: mediatek: dsi: add documentation for MT8186 SoC xinlei.lee
2022-01-28  5:08   ` [v1, 1/3] " CK Hu
2022-01-27 11:42 ` [v1,2/3] drm/mediatek: Add mt8186 dsi compatible to mtk_dsi.c xinlei.lee
2022-01-28  5:10   ` CK Hu
2022-01-27 11:42 ` [v1,3/3] drm/mediatek: Move the getting bridge node function to mtk_dsi_bind xinlei.lee
2022-01-28  5:03   ` CK Hu [this message]
2022-01-28  5:37     ` 答复: [v1, 3/3] " Xinlei Lee (李昕磊)

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=092258211c47eca805c4dea6c4bf4ecc4c246cea.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=airlied@linux.ie \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jitao.shi@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=srv_heupstream@mediatek.com \
    --cc=xinlei.lee@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®