Thread (30 messages) 30 messages, 9 authors, 2021-12-15

Re: [PATCH v6 7/7] drm/mediatek: Add mt8195 DisplayPort driver

From: Guillaume Ranquet <hidden>
Date: 2021-12-15 13:59:39
Also in: dri-devel, linux-arm-kernel, lkml

Hi Hsin-Yi,

Quoting Hsin-Yi Wang (2021-12-09 07:29:30)
On Wed, Nov 10, 2021 at 9:08 PM Guillaume Ranquet [off-list ref] wrote:
quoted
From: Markus Schneider-Pargmann <msp@baylibre.com>

This patch adds a DisplayPort driver for the Mediatek mt8195 SoC and a
according phy driver mediatek-dp-phy.

It supports both functional units on the mt8195, the embedded
DisplayPort as well as the external DisplayPort units. It offers
hot-plug-detection, audio up to 8 channels, and DisplayPort 1.4 with up
to 4 lanes.

The driver creates a child device for the phy. The child device will
never exist without the parent being active. As they are sharing a
register range, the parent passes a regmap pointer to the child so that
both can work with the same register range. The phy driver sets device
data that is read by the parent to get the phy device that can be used
to control the phy properties.

This driver is based on an initial version by
Jason-JH.Lin [off-list ref].

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Guillaume Ranquet <redacted>
Reported-by: kernel test robot <redacted>
---

<snip>
quoted
+static int mtk_dp_probe(struct platform_device *pdev)
+{
+       struct mtk_dp *mtk_dp;
+       struct device *dev = &pdev->dev;
+       int ret;
+       int irq_num = 0;
+       struct drm_panel *panel = NULL;
+
+       mtk_dp = devm_kzalloc(dev, sizeof(*mtk_dp), GFP_KERNEL);
+       if (!mtk_dp)
+               return -ENOMEM;
+
+       mtk_dp->dev = dev;
+
+       irq_num = platform_get_irq(pdev, 0);
+       if (irq_num < 0) {
+               dev_err(dev, "failed to request dp irq resource\n");
+               return -EPROBE_DEFER;
+       }
+
+       ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel,
+                                         &mtk_dp->next_bridge);
+       if (ret == -ENODEV) {
+               dev_info(
+                       dev,
+                       "No panel connected in devicetree, continuing as external DP\n");
+               mtk_dp->next_bridge = NULL;
+       } else if (ret) {
+               dev_err(dev, "Failed to find panel or bridge: %d\n", ret);
Hi,

We're seeing
[    0.424599] mediatek-drm-dp 1c500000.edp_tx: Failed to find panel
or bridge: -517

It's probably better to use dev_err_probe here.

Thanks
Good suggestion, it will be in v7.

Thanks for your review,
Guillaume.
quoted
+               return ret;
+       }
+
+       if (panel) {
+               mtk_dp->next_bridge = devm_drm_panel_bridge_add(dev, panel);
+               if (IS_ERR(mtk_dp->next_bridge)) {
+                       ret = PTR_ERR(mtk_dp->next_bridge);
+                       dev_err(dev, "Failed to create bridge: %d\n", ret);
+                       return -EPROBE_DEFER;
+               }
+       }

<snip>
quoted
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help