[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e94e5f788baf00cde94c8c3fd9065804de6d4d1e.camel@mediatek.com>
Date: Thu, 13 Feb 2025 09:01:44 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "robh@...nel.org" <robh@...nel.org>, "jie.qiu@...iatek.com"
<jie.qiu@...iatek.com>, "tzimmermann@...e.de" <tzimmermann@...e.de>,
"simona@...ll.ch" <simona@...ll.ch>, "mripard@...nel.org"
<mripard@...nel.org>, Jitao Shi (石记涛)
<jitao.shi@...iatek.com>, "linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>, "dri-devel@...ts.freedesktop.org"
<dri-devel@...ts.freedesktop.org>, "maarten.lankhorst@...ux.intel.com"
<maarten.lankhorst@...ux.intel.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "kernel@...labora.com" <kernel@...labora.com>,
"dmitry.baryshkov@...aro.org" <dmitry.baryshkov@...aro.org>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>,
Lewis Liao (廖柏鈞) <Lewis.Liao@...iatek.com>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>, "conor+dt@...nel.org"
<conor+dt@...nel.org>, TommyYL Chen (陳彥良)
<TommyYL.Chen@...iatek.com>, Ives Chenjh (陳俊弘)
<Ives.Chenjh@...iatek.com>, "airlied@...il.com" <airlied@...il.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
<matthias.bgg@...il.com>, Jason-JH Lin (林睿祥)
<Jason-JH.Lin@...iatek.com>, "junzhi.zhao@...iatek.com"
<junzhi.zhao@...iatek.com>
Subject: Re: [PATCH v6 36/42] drm/mediatek: mtk_hdmi_common: Make CEC support
optional
On Tue, 2025-02-11 at 12:34 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> 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.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
> 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");
You change v1 behavior here.
When there is no CEC in device tree, original v1 would return -EINVAL.
But now, v1 return 0.
In mtk_hdmi_probe() of previous patch, you add checking of hdmi->cec_dev.
I think that checking is related to this, so I would like that checking to be in this patch because that checking is strongly related to this patch.
After this modification,
Reviewed-by: CK Hu <ck.hu@...iatek.com>
> + else if (ret)
> return ret;
>
> return 0;
> --
> 2.48.1
>
Powered by blists - more mailing lists