summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip/rockchip_rgb.c
diff options
context:
space:
mode:
authorMichael Riesch <michael.riesch@wolfvision.net>2023-01-24 06:47:03 +0100
committerHeiko Stuebner <heiko@sntech.de>2023-02-05 15:21:36 +0100
commit03db8f25cf16c579fe75fd2230bbe64c221bfe25 (patch)
tree90f8d84b1d7af58d5e140ed87aa4652df804a66d /drivers/gpu/drm/rockchip/rockchip_rgb.c
parentf8a852f1f86391127ab57b1c41fe0e62bc14f27c (diff)
downloadlinux-03db8f25cf16c579fe75fd2230bbe64c221bfe25.tar.gz
linux-03db8f25cf16c579fe75fd2230bbe64c221bfe25.tar.bz2
linux-03db8f25cf16c579fe75fd2230bbe64c221bfe25.zip
drm/rockchip: rgb: add video_port parameter to init function
The VOP2 driver has more than one video port, hence the hard-coded port id will not work anymore. Add an extra parameter for the video port id to the rockchip_rgb_init function. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230124054706.3921383-4-michael.riesch@wolfvision.net
Diffstat (limited to 'drivers/gpu/drm/rockchip/rockchip_rgb.c')
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_rgb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_rgb.c b/drivers/gpu/drm/rockchip/rockchip_rgb.c
index 5971df4302f2..c677b71ae516 100644
--- a/drivers/gpu/drm/rockchip/rockchip_rgb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_rgb.c
@@ -72,7 +72,8 @@ struct drm_encoder_helper_funcs rockchip_rgb_encoder_helper_funcs = {
struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
struct drm_crtc *crtc,
- struct drm_device *drm_dev)
+ struct drm_device *drm_dev,
+ int video_port)
{
struct rockchip_rgb *rgb;
struct drm_encoder *encoder;
@@ -90,7 +91,7 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
rgb->dev = dev;
rgb->drm_dev = drm_dev;
- port = of_graph_get_port_by_id(dev->of_node, 0);
+ port = of_graph_get_port_by_id(dev->of_node, video_port);
if (!port)
return ERR_PTR(-EINVAL);
@@ -103,8 +104,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
continue;
child_count++;
- ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id,
- &panel, &bridge);
+ ret = drm_of_find_panel_or_bridge(dev->of_node, video_port,
+ endpoint_id, &panel, &bridge);
if (!ret) {
of_node_put(endpoint);
break;