From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "robh+dt@kernel.org" <robh+dt@kernel.org>,
"kishon@ti.com" <kishon@ti.com>,
"Chunfeng Yun (云春峰)" <Chunfeng.Yun@mediatek.com>,
"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
"Jitao Shi (石记涛)" <jitao.shi@mediatek.com>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"granquet@baylibre.com" <granquet@baylibre.com>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"airlied@gmail.com" <airlied@gmail.com>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"vkoul@kernel.org" <vkoul@kernel.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Mac Shen (沈俊)" <Mac.Shen@mediatek.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"krzysztof.kozlowski@linaro.org" <krzysztof.kozlowski@linaro.org>,
"Stuart Lee (李翰)" <Stuart.Lee@mediatek.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH v4 5/8] drm/mediatek: hdmi: add v2 support
Date: Tue, 13 Jun 2023 01:52:47 +0000 [thread overview]
Message-ID: <c5a5a32bd13d709bbea310d218c1f68cb2707a02.camel@mediatek.com> (raw)
In-Reply-To: <20220919-v4-5-687f09a06dd9@baylibre.com>
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@baylibre.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;
> +}
> +
>
next prev parent reply other threads:[~2023-06-13 1:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 14:30 [PATCH v4 0/8] Add MT8195 HDMI support Guillaume Ranquet
2023-05-29 14:30 ` [PATCH v4 1/8] dt-bindings: display: mediatek: add MT8195 hdmi bindings Guillaume Ranquet
2023-06-08 21:05 ` Rob Herring
2023-06-09 15:49 ` Guillaume Ranquet
2023-06-10 4:16 ` Chun-Kuang Hu
2023-05-29 14:30 ` [PATCH v4 2/8] drm/mediatek: hdmi: use a regmap instead of iomem Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 3/8] drm/mediatek: extract common functions from the mtk hdmi driver Guillaume Ranquet
2023-06-13 2:37 ` CK Hu (胡俊光)
2023-05-29 14:31 ` [PATCH v4 4/8] drm/mediatek: hdmi: make the cec dev optional Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 5/8] drm/mediatek: hdmi: add v2 support Guillaume Ranquet
2023-06-13 1:52 ` CK Hu (胡俊光) [this message]
2023-06-13 2:19 ` CK Hu (胡俊光)
2023-06-13 2:52 ` CK Hu (胡俊光)
2023-06-13 5:35 ` CK Hu (胡俊光)
2023-06-13 8:24 ` CK Hu (胡俊光)
2023-06-14 3:41 ` CK Hu (胡俊光)
2023-05-29 14:31 ` [PATCH v4 6/8] drm/mediatek: hdmi: v2: add audio support Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 7/8] dt-bindings: display: mediatek: dpi: Add compatible for MediaTek MT8195 Guillaume Ranquet
2023-05-29 14:31 ` [PATCH v4 8/8] drm/mediatek: dpi: Add mt8195 hdmi to DPI driver Guillaume Ranquet
2023-06-14 6:14 ` CK Hu (胡俊光)
2024-01-15 11:06 ` [PATCH v4 0/8] Add MT8195 HDMI support AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5a5a32bd13d709bbea310d218c1f68cb2707a02.camel@mediatek.com \
--to=ck.hu@mediatek.com \
--cc=Chunfeng.Yun@mediatek.com \
--cc=Mac.Shen@mediatek.com \
--cc=Stuart.Lee@mediatek.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=granquet@baylibre.com \
--cc=jitao.shi@mediatek.com \
--cc=kishon@ti.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).