Skip to content

Commit 185e0be

Browse files
committed
drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module: ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined! This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules. Fixes: cf77d79 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") Fixes: 0305189 ("drm/sun4i: tcon: Add support for R40 TCON") Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Matt Hart <matthew.hart@linaro.org> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180911113325.11024-1-maxime.ripard@bootlin.com
1 parent bf8744e commit 185e0be

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
974974

975975
remote = of_graph_get_remote_node(node, 0, -1);
976976
if (remote) {
977-
ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
977+
ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
978+
of_match_node(sun8i_tcon_top_of_table, remote));
978979
of_node_put(remote);
979980
}
980981

@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
14021403
if (!pdev)
14031404
return -EINVAL;
14041405

1405-
if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
1406+
if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
1407+
encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
14061408
ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
14071409
if (ret)
14081410
return ret;
14091411
}
14101412

1411-
return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
1413+
if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {
1414+
ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
1415+
if (ret)
1416+
return ret;
1417+
}
1418+
1419+
return 0;
14121420
}
14131421

14141422
static const struct sun4i_tcon_quirks sun4i_a10_quirks = {

0 commit comments

Comments
 (0)