diff mbox series

[v5,09/17] drm/meson: only use components with dw-hdmi

Message ID 20230512-amlogic-v6-4-upstream-dsi-ccf-vim3-v5-9-56eb7a4d5b8e@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/meson: add support for MIPI DSI Display | expand

Commit Message

Neil Armstrong May 30, 2023, 7:38 a.m. UTC
Only DW-HDMI currently needs components since it reuses
the drm-meson driver context to access HHI registers (sic).

Once this is solved, we can get rid on components.

Until now, limit the components matching to the dw-hdmi compatibles
we know to require this hack, for other bridges simply use probe defer
instead and get over this components sitation.

The back story is that we simply cannot attach DSI adapters bridges
if we use components, only DSI panels, this is because we bind/unbind
the DSI controller at each drm-meson driver master bind tentative.
With this the I2C DSI bridge is unable to find the DSI controller
host and everything fails to probe.

This will simplify a lot adding new or older HDMI bridges.

Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/gpu/drm/meson/meson_drv.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

Comments

Nicolas Belin May 31, 2023, 9:21 a.m. UTC | #1
Le mar. 30 mai 2023 à 09:38, Neil Armstrong
<neil.armstrong@linaro.org> a écrit :
>
> Only DW-HDMI currently needs components since it reuses
> the drm-meson driver context to access HHI registers (sic).
>
> Once this is solved, we can get rid on components.
>
> Until now, limit the components matching to the dw-hdmi compatibles
> we know to require this hack, for other bridges simply use probe defer
> instead and get over this components sitation.
>
> The back story is that we simply cannot attach DSI adapters bridges
> if we use components, only DSI panels, this is because we bind/unbind
> the DSI controller at each drm-meson driver master bind tentative.
> With this the I2C DSI bridge is unable to find the DSI controller
> host and everything fails to probe.
>
> This will simplify a lot adding new or older HDMI bridges.
>
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  drivers/gpu/drm/meson/meson_drv.c | 30 ++++++++++++++++--------------
>  1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index e060279dc80a..e935c0286a20 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -451,10 +451,17 @@ static void meson_drv_shutdown(struct platform_device *pdev)
>         drm_atomic_helper_shutdown(priv->drm);
>  }
>
> -/* Possible connectors nodes to ignore */
> -static const struct of_device_id connectors_match[] = {
> -       { .compatible = "composite-video-connector" },
> -       { .compatible = "svideo-connector" },
> +/*
> + * Only devices to use as components
> + * TOFIX: get rid of components when we can finally
> + * get meson_dx_hdmi to stop using the meson_drm
> + * private structure for HHI registers.
> + */
> +static const struct of_device_id components_dev_match[] = {
> +       { .compatible = "amlogic,meson-gxbb-dw-hdmi" },
> +       { .compatible = "amlogic,meson-gxl-dw-hdmi" },
> +       { .compatible = "amlogic,meson-gxm-dw-hdmi" },
> +       { .compatible = "amlogic,meson-g12a-dw-hdmi" },
>         {}
>  };
>
> @@ -472,17 +479,12 @@ static int meson_drv_probe(struct platform_device *pdev)
>                         continue;
>                 }
>
> -               /* If an analog connector is detected, count it as an output */
> -               if (of_match_node(connectors_match, remote)) {
> -                       ++count;
> -                       of_node_put(remote);
> -                       continue;
> -               }
> -
> -               dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n",
> -                       np, remote, dev_name(&pdev->dev));
> +               if (of_match_node(components_dev_match, remote)) {
> +                       component_match_add(&pdev->dev, &match, component_compare_of, remote);
>
> -               component_match_add(&pdev->dev, &match, component_compare_of, remote);
> +                       dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n",
> +                               np, remote, dev_name(&pdev->dev));
> +               }
>
>                 of_node_put(remote);
>
>
> --
> 2.34.1
>
Reviewed-by: Nicolas Belin <nbelin@baylibre.com>
Tested-by: Nicolas Belin <nbelin@baylibre.com> # on Khadas VIM3 + TS050 Panel

Thanks,
Nicolas
diff mbox series

Patch

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index e060279dc80a..e935c0286a20 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -451,10 +451,17 @@  static void meson_drv_shutdown(struct platform_device *pdev)
 	drm_atomic_helper_shutdown(priv->drm);
 }
 
-/* Possible connectors nodes to ignore */
-static const struct of_device_id connectors_match[] = {
-	{ .compatible = "composite-video-connector" },
-	{ .compatible = "svideo-connector" },
+/*
+ * Only devices to use as components
+ * TOFIX: get rid of components when we can finally
+ * get meson_dx_hdmi to stop using the meson_drm
+ * private structure for HHI registers.
+ */
+static const struct of_device_id components_dev_match[] = {
+	{ .compatible = "amlogic,meson-gxbb-dw-hdmi" },
+	{ .compatible = "amlogic,meson-gxl-dw-hdmi" },
+	{ .compatible = "amlogic,meson-gxm-dw-hdmi" },
+	{ .compatible = "amlogic,meson-g12a-dw-hdmi" },
 	{}
 };
 
@@ -472,17 +479,12 @@  static int meson_drv_probe(struct platform_device *pdev)
 			continue;
 		}
 
-		/* If an analog connector is detected, count it as an output */
-		if (of_match_node(connectors_match, remote)) {
-			++count;
-			of_node_put(remote);
-			continue;
-		}
-
-		dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n",
-			np, remote, dev_name(&pdev->dev));
+		if (of_match_node(components_dev_match, remote)) {
+			component_match_add(&pdev->dev, &match, component_compare_of, remote);
 
-		component_match_add(&pdev->dev, &match, component_compare_of, remote);
+			dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n",
+				np, remote, dev_name(&pdev->dev));
+		}
 
 		of_node_put(remote);