Skip to content

Commit 94bc7f5

Browse files
committed
Merge tag 'arcpgu-updates-2019.07.18' of github.com:abrodkin/linux into drm-next
This is a pretty simple improvement that allows to find encoder as the one and only (ARC PGU doesn't support more than one) endpoint instead of using non-standard "encoder-slave" property. Signed-off-by: Dave Airlie <[email protected]> From: Alexey Brodkin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CY4PR1201MB0120FDB10A777345F9C27720A1C90@CY4PR1201MB0120.namprd12.prod.outlook.com
2 parents 3447fd0 + cee17a7 commit 94bc7f5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/gpu/drm/arc/arcpgu_drv.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <drm/drm_fb_helper.h>
1515
#include <drm/drm_gem_cma_helper.h>
1616
#include <drm/drm_gem_framebuffer_helper.h>
17+
#include <drm/drm_of.h>
1718
#include <drm/drm_probe_helper.h>
1819
#include <linux/dma-mapping.h>
1920
#include <linux/module.h>
@@ -45,7 +46,7 @@ static int arcpgu_load(struct drm_device *drm)
4546
{
4647
struct platform_device *pdev = to_platform_device(drm->dev);
4748
struct arcpgu_drm_private *arcpgu;
48-
struct device_node *encoder_node;
49+
struct device_node *encoder_node = NULL, *endpoint_node = NULL;
4950
struct resource *res;
5051
int ret;
5152

@@ -80,14 +81,23 @@ static int arcpgu_load(struct drm_device *drm)
8081
if (arc_pgu_setup_crtc(drm) < 0)
8182
return -ENODEV;
8283

83-
/* find the encoder node and initialize it */
84-
encoder_node = of_parse_phandle(drm->dev->of_node, "encoder-slave", 0);
84+
/*
85+
* There is only one output port inside each device. It is linked with
86+
* encoder endpoint.
87+
*/
88+
endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
89+
if (endpoint_node) {
90+
encoder_node = of_graph_get_remote_port_parent(endpoint_node);
91+
of_node_put(endpoint_node);
92+
}
93+
8594
if (encoder_node) {
8695
ret = arcpgu_drm_hdmi_init(drm, encoder_node);
8796
of_node_put(encoder_node);
8897
if (ret < 0)
8998
return ret;
9099
} else {
100+
dev_info(drm->dev, "no encoder found. Assumed virtual LCD on simulation platform\n");
91101
ret = arcpgu_drm_sim_init(drm, NULL);
92102
if (ret < 0)
93103
return ret;

0 commit comments

Comments
 (0)