drm: convert drivers to use of_graph_get_remote_node

Convert drivers to use the new of_graph_get_remote_node() helper
instead of parsing the endpoint node and then getting the remote device
node. Now drivers can just specify the device node and which
port/endpoint and get back the connected remote device node. The details
of the graph binding are nicely abstracted into the core OF graph code.

This changes some error messages to debug messages (in the graph core).
Graph connections are often "no connects" depending on the particular
board, so we want to avoid spurious messages. Plus the kernel is not a
DT validator.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Liviu Dudau <liviu.dudau@arm.com>
Tested-by: Eric Anholt <eric@anholt.net>
Tested-by: Jyri Sarha <jsarha@ti.com>
Tested by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
此提交包含在:
Rob Herring
2017-03-22 08:26:06 -05:00
提交者 Sean Paul
父節點 1f2db3034c
當前提交 86418f90a4
共有 17 個檔案被更改,包括 49 行新增311 行删除

查看文件

@@ -356,23 +356,14 @@ static const struct of_device_id vc4_dpi_dt_match[] = {
*/
static struct drm_panel *vc4_dpi_get_panel(struct device *dev)
{
struct device_node *endpoint, *panel_node;
struct device_node *panel_node;
struct device_node *np = dev->of_node;
struct drm_panel *panel;
endpoint = of_graph_get_next_endpoint(np, NULL);
if (!endpoint) {
dev_err(dev, "no endpoint to fetch DPI panel\n");
return NULL;
}
/* don't proceed if we have an endpoint but no panel_node tied to it */
panel_node = of_graph_get_remote_port_parent(endpoint);
of_node_put(endpoint);
if (!panel_node) {
dev_err(dev, "no valid panel node\n");
panel_node = of_graph_get_remote_node(np, 0, 0);
if (!panel_node)
return NULL;
}
panel = of_drm_find_panel(panel_node);
of_node_put(panel_node);