From patchwork Wed Apr 9 13:13:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 14044702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BE38C36002 for ; Wed, 9 Apr 2025 13:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VsMQ4/TVTcQ1d4uXNkzqyZmFUNhcdpV2WazNl3+5bU8=; b=1Ksu9vObJm9j41VtldzPiE4nWi PK1wpTNS0qmWu9WChH8oc5tsHA1ST6wwgc6L0q+WyXiNOsLEU99CkHjf0Mm19q35gJw3U42CL8P9z f7tMRhJNEzLN/sEE1K2Wr1aTHlLCYr9JPmsZQNLdJxK+dKJkoUl+d26WDvGZNFlRnO8JtFXnrFOdm nFcHDIhlffO1yjx6YgLDC+/Iz9VkEqcOLmXFjdW1wOXUdMlTbheL+k92wXphwMhsBRgz/gi8ceszW xd8LphE9STUy0JSSF3iRkgnl14UAm3qLOICKnd6A3oMkXCxeQSc7ldc8m2DOgEsSbi78qimyHKVPB udg//jWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2VtT-00000007MWm-0Nyo; Wed, 09 Apr 2025 13:55:07 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u2VFX-00000007FRO-3P4W; Wed, 09 Apr 2025 13:13:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1744204430; bh=BdpJ0nrTJfY1TTC+C83zga2VjPuvzqwXB5IYLWsIW/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4uyPLUyEqOihWx+6YANsk0P2cFHSk0pl1rTKZVDvktZV8MPW2poKH8LFP1OUAaJa YMYQwC2vzDCnOqvqHetneiSRZW38dodh7y1Zar/CFRXadcrxE7XyB365tfDF+L+vLs fMsLy0BruXGiiz+xLVQmW58W/vwBssXwVNiwE94cx7//MoV22kXIbfbJYzSkNGDFBr ogpjNr/ND4dYUzL7jeVgiek7WcGgQ0cmvS/stmfxBZF5w8Kq6IkMNKoCspeQ/1CTJm JjBXi+YiVJHkBOPcmraYKAZDmabK01QSRz8fr28n/GKJ8+BjCuN4aN1f6UG+FGlCMb 02S76bG/4oM3Q== Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id 0EF5F17E362C; Wed, 9 Apr 2025 15:13:49 +0200 (CEST) From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: p.zabel@pengutronix.de, airlied@gmail.com, simona@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, ck.hu@mediatek.com, jitao.shi@mediatek.com, jie.qiu@mediatek.com, junzhi.zhao@mediatek.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, dmitry.baryshkov@linaro.org, lewis.liao@mediatek.com, ives.chenjh@mediatek.com, tommyyl.chen@mediatek.com, jason-jh.lin@mediatek.com Subject: [PATCH v8 17/23] drm/mediatek: mtk_hdmi_common: Make CEC support optional Date: Wed, 9 Apr 2025 15:13:12 +0200 Message-ID: <20250409131318.108690-18-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250409131318.108690-1-angelogioacchino.delregno@collabora.com> References: <20250409131318.108690-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250409_061352_007107_74B042FD X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 -ENOTSUPP to be able to differentiate between error conditions in mtk_hdmi_dt_parse_pdata(). In that case, if -ENOTSUPP 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 Signed-off-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c index 3dfde63198e5..5ea45608921c 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c @@ -254,12 +254,11 @@ static int mtk_hdmi_get_cec_dev(struct mtk_hdmi *hdmi, struct device *dev, struc /* The CEC module handles HDMI hotplug detection */ cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec"); if (!cec_np) - return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n"); + return dev_err_probe(dev, -ENOTSUPP, "Failed to find CEC node\n"); cec_pdev = of_find_device_by_node(cec_np); if (!cec_pdev) { - dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", - cec_np); + dev_err(hdmi->dev, "Waiting for CEC device %pOF\n", cec_np); of_node_put(cec_np); return -EPROBE_DEFER; } @@ -323,7 +322,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct platform_device return dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n"); ret = mtk_hdmi_get_cec_dev(hdmi, dev, np); - if (ret) + if (ret == -ENOTSUPP) + dev_info(dev, "CEC support unavailable: node not found\n"); + else if (ret) return ret; return 0;