aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2018-09-11 07:33:25 -0400
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-09-12 08:50:34 -0400
commit185e0bebb44fc1e8978fabac1267c27fbcd16ee2 (patch)
tree102e56110893f81434d1aa90efc06aca2d34de9c
parentbf8744e40cd6db20dfbd231ad44943f6bc8ac311 (diff)
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: cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") Fixes: 0305189afb32 ("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
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_tcon.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 4834c90b4912..c78cd35a1294 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
974 974
975 remote = of_graph_get_remote_node(node, 0, -1); 975 remote = of_graph_get_remote_node(node, 0, -1);
976 if (remote) { 976 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));
978 of_node_put(remote); 979 of_node_put(remote);
979 } 980 }
980 981
@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
1402 if (!pdev) 1403 if (!pdev)
1403 return -EINVAL; 1404 return -EINVAL;
1404 1405
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) {
1406 ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id); 1408 ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
1407 if (ret) 1409 if (ret)
1408 return ret; 1410 return ret;
1409 } 1411 }
1410 1412
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;
1412} 1420}
1413 1421
1414static const struct sun4i_tcon_quirks sun4i_a10_quirks = { 1422static const struct sun4i_tcon_quirks sun4i_a10_quirks = {