[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c5a5a32bd13d709bbea310d218c1f68cb2707a02.camel@mediatek.com>
Date: Tue, 13 Jun 2023 01:52:47 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "robh+dt@...nel.org" <robh+dt@...nel.org>,
"kishon@...com" <kishon@...com>,
Chunfeng Yun (云春峰)
<Chunfeng.Yun@...iatek.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>,
Jitao Shi (石记涛) <jitao.shi@...iatek.com>,
"daniel@...ll.ch" <daniel@...ll.ch>,
"granquet@...libre.com" <granquet@...libre.com>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
"airlied@...il.com" <airlied@...il.com>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"vkoul@...nel.org" <vkoul@...nel.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
Mac Shen (沈俊) <Mac.Shen@...iatek.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
Stuart Lee (李翰) <Stuart.Lee@...iatek.com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH v4 5/8] drm/mediatek: hdmi: add v2 support
Hi, Guillaume:
On Mon, 2023-05-29 at 16:31 +0200, Guillaume Ranquet wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> Adds hdmi and hdmi-ddc support for v2 IP.
>
> Signed-off-by: Guillaume Ranquet <granquet@...libre.com>
>
[snip]
> +
> +static unsigned char vddc_read(struct mtk_hdmi_ddc *ddc, unsigned
> int u4_clk_div,
> + unsigned char uc_dev, unsigned int u4_addr,
> + enum sif_bit_t_hdmi uc_addr_type,
> + unsigned char *puc_value, unsigned int u4_count)
> +{
> +unsigned int u4_read_count = 0;
> +unsigned char uc_return_value = 0;
> +
> +if (!puc_value || !u4_count || !u4_clk_div ||
> + uc_addr_type > SIF_16_BIT_HDMI ||
> + (uc_addr_type == SIF_8_BIT_HDMI && u4_addr > 255) ||
> + (uc_addr_type == SIF_16_BIT_HDMI && u4_addr > 65535)) {
uc_addr_type would never be SIF_16_BIT_HDMI, so remove SIF_16_BIT_HDMI.
Regards,
CK
> +return 0;
> +}
> +
> +if (uc_addr_type == SIF_8_BIT_HDMI)
> +u4_read_count = 255 - u4_addr + 1;
> +else if (uc_addr_type == SIF_16_BIT_HDMI)
> +u4_read_count = 65535 - u4_addr + 1;
> +
> +u4_read_count = (u4_read_count > u4_count) ? u4_count :
> u4_read_count;
> +uc_return_value = ddcm_read_hdmi(ddc, u4_clk_div, uc_dev, u4_addr,
> + uc_addr_type, puc_value, u4_read_count);
> +return uc_return_value;
> +}
> +
> +static bool fg_ddc_data_read(struct mtk_hdmi_ddc *ddc,
> + unsigned char b_dev,
> + unsigned char b_data_addr,
> + unsigned char b_data_count,
> + unsigned char *pr_data)
> +{
> +int ret;
> +
> +mutex_lock(&ddc->mtx);
> +
> +hdmi_ddc_request(ddc);
> +ret = vddc_read(ddc, DDC2_CLOK, b_dev, b_data_addr, SIF_8_BIT_HDMI,
> + pr_data, b_data_count);
> +mutex_unlock(&ddc->mtx);
> +
> +return ret == b_data_count;
> +}
> +
>
Powered by blists - more mailing lists