dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Yannick FERTRE <yannick.fertre@st.com>
To: Adrian Ratiu <adrian.ratiu@collabora.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-rockchip@lists.infradead.org"
	<linux-rockchip@lists.infradead.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>,
	Jonas Karlman <jonas@kwiboo.se>,
	Philippe CORNU <philippe.cornu@st.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrzej Hajda <a.hajda@samsung.com>,
	"linux-imx@nxp.com" <linux-imx@nxp.com>,
	"kernel@collabora.com" <kernel@collabora.com>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH v9 04/11] drm: bridge: dw_mipi_dsi: remove bind/unbind API
Date: Wed, 10 Jun 2020 12:21:32 +0000	[thread overview]
Message-ID: <9c291445-ae15-2ff5-4d24-489a2128b9ba@st.com> (raw)
In-Reply-To: <20200609174959.955926-5-adrian.ratiu@collabora.com>

Hi Adrian,

thanks for the pach: tested on stm32mp1.

Tested-by: Yannick Fertré <yannick.fertre@st.com>

On 6/9/20 7:49 PM, Adrian Ratiu wrote:
> The DW mipi-dsi bind/unbind API was only used to attach the bridge to
> the encoder in the Rockchip driver, but with the addition of i.MX6 it
> gets more complicated because the i.MX6 part of the bridge is another
> bridge in itself which needs to daisy chain to the dw-mipi-dsi core.
>
> So, instead of extending this API to allow daisy-chaining bridges and
> risk having trouble with multiple connectors added by various bridges
> just delete it and let the DW core bridge be accesed by SoC-specific
> parts via the of_drm_find_bridge() API.
>
> This just fixes the Rockchip driver for the bind() deprecation, it
> doesn't convert it to a proper bridge daisy-chain with simple encoder
> and bridge .attach call-backs, that refactoring work should be done
> separately (and the i.MX6 driver can be used as reference).
>
> Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> ---
> New in v9.
> ---
>   drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 22 -------------------
>   .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |  7 +++---
>   2 files changed, 3 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index 16fd87055e7b7..70df0578cbe7b 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -1453,28 +1453,6 @@ void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi)
>   }
>   EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
>   
> -/*
> - * Bind/unbind API, used from platforms based on the component framework.
> - */
> -int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder)
> -{
> -	int ret;
> -
> -	ret = drm_bridge_attach(encoder, &dsi->bridge, NULL, 0);
> -	if (ret) {
> -		DRM_ERROR("Failed to initialize bridge with drm\n");
> -		return ret;
> -	}
> -
> -	return ret;
> -}
> -EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);
> -
> -void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
> -{
> -}
> -EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);
> -
>   MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
>   MODULE_AUTHOR("Philippe Cornu <philippe.cornu@st.com>");
>   MODULE_DESCRIPTION("DW MIPI DSI host controller driver");
> diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> index 3feff0c45b3f7..86f87c7ea03cf 100644
> --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
> @@ -876,6 +876,7 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev,
>   {
>   	struct dw_mipi_dsi_rockchip *dsi = dev_get_drvdata(dev);
>   	struct drm_device *drm_dev = data;
> +	struct drm_bridge *dw_bridge = of_drm_find_bridge(dev->of_node);
>   	struct device *second;
>   	bool master1, master2;
>   	int ret;
> @@ -929,9 +930,9 @@ static int dw_mipi_dsi_rockchip_bind(struct device *dev,
>   		return ret;
>   	}
>   
> -	ret = dw_mipi_dsi_bind(dsi->dmd, &dsi->encoder);
> +	ret = drm_bridge_attach(&dsi->encoder, dw_bridge, NULL, 0);
>   	if (ret) {
> -		DRM_DEV_ERROR(dev, "Failed to bind: %d\n", ret);
> +		DRM_DEV_ERROR(dev, "Failed to attach DW DSI bridge: %d\n", ret);
>   		return ret;
>   	}
>   
> @@ -947,8 +948,6 @@ static void dw_mipi_dsi_rockchip_unbind(struct device *dev,
>   	if (dsi->is_slave)
>   		return;
>   
> -	dw_mipi_dsi_unbind(dsi->dmd);
> -
>   	clk_disable_unprepare(dsi->pllref_clk);
>   }
>   
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-06-10 12:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 17:49 [PATCH v9 00/11] Genericize DW MIPI DSI bridge and add i.MX 6 driver Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 01/11] drm: bridge: dw_mipi_dsi: add initial regmap infrastructure Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 02/11] drm: bridge: dw_mipi_dsi: abstract register access using reg_fields Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 03/11] drm: bridge: dw_mipi_dsi: add dsi v1.01 support Adrian Ratiu
2020-06-10 12:20   ` Yannick FERTRE
2020-06-09 17:49 ` [PATCH v9 04/11] drm: bridge: dw_mipi_dsi: remove bind/unbind API Adrian Ratiu
2020-06-10 12:21   ` Yannick FERTRE [this message]
2020-06-09 17:49 ` [PATCH v9 05/11] dt-bindings: display: add i.MX6 MIPI DSI host controller doc Adrian Ratiu
2020-06-12 21:11   ` Rob Herring
2020-06-09 17:49 ` [PATCH v9 06/11] ARM: dts: imx6qdl: add missing mipi dsi properties Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 07/11] drm: imx: Add i.MX 6 MIPI DSI host platform driver Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 08/11] drm: stm: dw-mipi-dsi: let the bridge handle the HW version check Adrian Ratiu
2020-06-09 17:49 ` [PATCH v9 09/11] drm: bridge: dw-mipi-dsi: split low power cfg register into fields Adrian Ratiu
2020-06-10 12:21   ` Yannick FERTRE
2020-06-09 17:49 ` [PATCH v9 10/11] drm: bridge: dw-mipi-dsi: fix bad register field offsets Adrian Ratiu
2020-06-10 12:22   ` Yannick FERTRE
2020-06-09 17:49 ` [PATCH v9 11/11] Documentation: gpu: todo: Add dw-mipi-dsi consolidation plan Adrian Ratiu
2020-06-29  8:47 ` [PATCH v9 00/11] Genericize DW MIPI DSI bridge and add i.MX 6 driver Neil Armstrong
2020-07-01  6:35   ` Adrian Ratiu
2020-07-01  7:50     ` Neil Armstrong
2020-08-15 13:05     ` Ezequiel Garcia
2020-08-24  9:47       ` Neil Armstrong
2020-09-15 13:05         ` Neil Armstrong
2020-10-23 15:32           ` Adrian Ratiu
2020-07-01 12:50 ` Heiko Stübner
2020-07-01 20:32   ` Adrian Ratiu

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=9c291445-ae15-2ff5-4d24-489a2128b9ba@st.com \
    --to=yannick.fertre@st.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=adrian.ratiu@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=philippe.cornu@st.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;
as well as URLs for NNTP newsgroup(s).