From nobody Fri Dec 19 09:47:53 2025 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680A73064BB for ; Thu, 23 Oct 2025 10:32:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761215569; cv=none; b=Nk3Xz0nJJG9CcbtzNc7NtYdEn8sCiGLQtgaUfyk3jzlqgLbcEyLqkK5nIebf/JTSOyZpc7/js71jRofZZ8RDYHvf5DAfHpY4pXBTobxu7uGhFiXzYhQ0qyGLS1IJuKSQsADMAYg6K3TG8e30dTRAzy7OODCUwsWrj1EjZ27ta6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761215569; c=relaxed/simple; bh=Xu31R2pSa9GuM1qdI6iPO4EmI5Yt7WRGU5wBn2Vj36E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nmstCt7ZRDGsmq4XkF+9T7zO37RMJlg+p3i8f5mQDBXG3ANPM2Gly8rQsDJd4wO/vNjMpKhnkIx4gnSB1Th+wzr9xKVPveoYV76mYoN7fYDP7v47rMhLeIASPedCN0ETcvsFG7Hxb6j8+xIphGykQ5xUQ0LOrtnHPqi35QPvPak= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=cYk07iLX; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cYk07iLX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1761215562; bh=Xu31R2pSa9GuM1qdI6iPO4EmI5Yt7WRGU5wBn2Vj36E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cYk07iLXMYkldiZ3idRzrsD25om87JWouZC2tCOKlNbWbRozLizbjeT1UzLPQxXl8 OsEvN+5H8HHu0EXVODyZsxYKtNFfC3Q2hI+1OUql0Lpv/t55aTlNl9Zfz83qIUzd2F UP4SMOTu+CTq1g4jPnMlltEFr+etIFV2ywfLMCuy7Gvegtq4QADj78tHfV7gnxr0nY I+8BCtNYhPoXwYG4N5nOJZqOdqTp5z7Kv0TGWaHkcIsV5ybb41oVwcakS8931PhrKd aum/YQ8KvCqSYSiYJ3WGNmlGXkT011JH72V5elqRgxUiviMw2GalO+2getDdzFWy1D 9ud6tXb44n2Cw== Received: from yukiji.home (amontpellier-657-1-116-247.w83-113.abo.wanadoo.fr [83.113.51.247]) (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: laeyraud) by bali.collaboradmins.com (Postfix) with ESMTPSA id CEF2B17E1413; Thu, 23 Oct 2025 12:32:41 +0200 (CEST) From: Louis-Alexis Eyraud Date: Thu, 23 Oct 2025 12:32:31 +0200 Subject: [PATCH v11 05/11] drm/mediatek: mtk_hdmi_common: Make CEC support optional Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251023-mediatek-drm-hdmi-v2-v11-5-7873ec4a1edf@collabora.com> References: <20251023-mediatek-drm-hdmi-v2-v11-0-7873ec4a1edf@collabora.com> In-Reply-To: <20251023-mediatek-drm-hdmi-v2-v11-0-7873ec4a1edf@collabora.com> To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , CK Hu Cc: kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Louis-Alexis Eyraud X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1761215558; l=2372; i=louisalexis.eyraud@collabora.com; s=20250113; h=from:subject:message-id; bh=rRJNljGlCzvkTbiBSXYA2z00/RdbAoNV849z4+rEAUA=; b=VU7vOg/yuNTQbe5KtBVgoL/kbpGpqyxcWZweOHQ1PIlVBfseLvGEExavyhtNlIHIP1sJavvQ+ oJlHOB9dfiVC5Aybk8UrICGrZDOfx8600AmXO2QgNRiGG+2pcExSi80 X-Developer-Key: i=louisalexis.eyraud@collabora.com; a=ed25519; pk=CHFBDB2Kqh4EHc6JIqFn69GhxJJAzc0Zr4e8QxtumuM= From: AngeloGioacchino Del Regno 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 Signed-off-by: Louis-Alexis Eyraud --- 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/m= ediatek/mtk_hdmi_common.c index f28e63716d7c2e2c6bdf5b28d24789bc926d2beb..989479fdfe40952762a1b63797b= f602b520dcac5 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c @@ -253,12 +253,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 =3D 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"); =20 cec_pdev =3D 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; } @@ -319,7 +318,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdm= i, struct platform_device return dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by nod= e\n"); =20 ret =3D mtk_hdmi_get_cec_dev(hdmi, dev, np); - if (ret) + if (ret =3D=3D -ENOTSUPP) + dev_info(dev, "CEC support unavailable: node not found\n"); + else if (ret) return ret; =20 return 0; --=20 2.51.0