]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpu: drm: replace of_graph_get_next_endpoint()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 31 Oct 2024 22:42:07 +0000 (22:42 +0000)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 12 Nov 2024 12:05:35 +0000 (13:05 +0100)
From DT point of view, in general, drivers should be asking for a
specific port number because their function is fixed in the binding.

of_graph_get_next_endpoint() doesn't match to this concept.

Simply replace

- of_graph_get_next_endpoint(xxx, NULL);
+ of_graph_get_endpoint_by_regs(xxx, 0, -1);

Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/87frob3neo.wl-kuninori.morimoto.gx@renesas.com
drivers/gpu/drm/drm_of.c
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
drivers/gpu/drm/tiny/arcpgu.c

index 5c2abc9eca9c25e0a265399bb07ca8bed8209a2c..5530919e0ba05f7ce1806730b292319f36e905ed 100644 (file)
@@ -564,6 +564,8 @@ EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_ep);
  * Gets parent DSI bus for a DSI device controlled through a bus other
  * than MIPI-DCS (SPI, I2C, etc.) using the Device Tree.
  *
+ * This function assumes that the device's port@0 is the DSI input.
+ *
  * Returns pointer to mipi_dsi_host if successful, -EINVAL if the
  * request is unsupported, -EPROBE_DEFER if the DSI host is found but
  * not available, or -ENODEV otherwise.
@@ -576,7 +578,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
        /*
         * Get first endpoint child from device.
         */
-       endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+       endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
        if (!endpoint)
                return ERR_PTR(-ENODEV);
 
index 4618c892cdd652d513baf74fabaaef4b9672e215..e10e469aa7a6c5684c9240ea74c8d1184c7723a5 100644 (file)
@@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
        rpi_touchscreen_i2c_write(ts, REG_POWERON, 0);
 
        /* Look up the DSI host.  It needs to probe before we do. */
-       endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+       endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
        if (!endpoint)
                return -ENODEV;
 
index 81abedec435db804179dbf16ca2600413b506c4f..b2dc02df74f899f96112adbd751d4e3686c743ce 100644 (file)
@@ -289,7 +289,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
         * There is only one output port inside each device. It is linked with
         * encoder endpoint.
         */
-       endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
+       endpoint_node = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1);
        if (endpoint_node) {
                encoder_node = of_graph_get_remote_port_parent(endpoint_node);
                of_node_put(endpoint_node);