Skip to content

Commit a71afdc

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi_common: Make CEC support optional
In preparation for adding a new driver for HDMIv2, for which CEC is not strictly required, change the of_get_compatible_child() failure error to -EOPNOTSUPP to be able to differentiate between error conditions in mtk_hdmi_dt_parse_pdata(). In that case, if -EOPNOTSUPP is returned, this driver will print an informative message saying that CEC support is unavailable, as the devicetree node for that was not found, but after that, function mtk_hdmi_dt_parse_pdata() will not return error to the caller. This will not change functionality of the mtk_hdmi (v1) driver as that is still checking whether CEC is present and, if not, will fail probing with an error saying that CEC is required by HDMIv1. Reviewed-by: CK Hu <ck.hu@mediatek.com> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20251023-mediatek-drm-hdmi-v2-v11-5-7873ec4a1edf@collabora.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent 86b1e68 commit a71afdc

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/gpu/drm/mediatek/mtk_hdmi_common.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,11 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc
261261
/* The CEC module handles HDMI hotplug detection */
262262
cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
263263
if (!cec_np)
264-
return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n");
264+
return dev_err_probe(dev, -EOPNOTSUPP, "Failed to find CEC node\n");
265265

266266
cec_pdev = of_find_device_by_node(cec_np);
267267
if (!cec_pdev) {
268-
dev_err(hdmi->dev, "Waiting for CEC device %pOF\n",
269-
cec_np);
268+
dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", cec_np);
270269
of_node_put(cec_np);
271270
return -EPROBE_DEFER;
272271
}
@@ -335,7 +334,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device
335334
return ret;
336335

337336
ret = mtk_hdmi_get_cec_dev(hdmi, dev, np);
338-
if (ret)
337+
if (ret == -EOPNOTSUPP)
338+
dev_info(dev, "CEC support unavailable: node not found\n");
339+
else if (ret)
339340
return ret;
340341

341342
return 0;

0 commit comments

Comments
 (0)