提交 78428d67 编写于 作者: C Chen-Yu Tsai 提交者: Maxime Ripard

drm/sun4i: tv: Switch to drm_of_find_possible_crtcs

Now that the crtcs have their .port field set properly, we can use
drm_of_find_possible_crtcs to find the connected crtcs, instead of
hardcoding the first crtc as usable. The new code also defers binding
when the upstream crtc hasn't been registered yet.

This makes it easier to support multiple tcons/crtcs.
Signed-off-by: NChen-Yu Tsai <wens@csie.org>
Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
上级 a5154a4d
......@@ -19,6 +19,7 @@
#include <drm/drmP.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include "sun4i_backend.h"
......@@ -623,7 +624,12 @@ static int sun4i_tv_bind(struct device *dev, struct device *master,
goto err_disable_clk;
}
tv->encoder.possible_crtcs = BIT(0);
tv->encoder.possible_crtcs = drm_of_find_possible_crtcs(drm,
dev->of_node);
if (!tv->encoder.possible_crtcs) {
ret = -EPROBE_DEFER;
goto err_disable_clk;
}
drm_connector_helper_add(&tv->connector,
&sun4i_tv_comp_connector_helper_funcs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册