From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Algea Cao <algea.cao@rock-chips.com>,
Sandor Yu <Sandor.yu@nxp.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
kernel@collabora.com, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v4 07/12] phy: rockchip: samsung-hdptx: Setup TMDS char rate via phy_configure_opts_hdmi
Date: Tue, 4 Mar 2025 14:12:19 +0200 [thread overview]
Message-ID: <ddf4c3c9-849c-4d96-a073-966bb19a6047@collabora.com> (raw)
In-Reply-To: <20250304-turtle-of-serious-aurora-2b0bae@houat>
On 3/4/25 10:15 AM, Maxime Ripard wrote:
> On Tue, Mar 04, 2025 at 03:44:06AM +0200, Cristian Ciocaltea wrote:
>> The current workaround to setup the TMDS character rate relies on the
>> unconventional usage of phy_set_bus_width().
>>
>> Make use of the recently introduced HDMI PHY configuration API to
>> properly handle the setup. The workaround will be dropped as soon as
>> the switch has been completed on both ends.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>> drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 54 ++++++++++++++++-------
>> 1 file changed, 38 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> index 2bf525514c1991a1299265d12e1e85f66333c604..7e1d1c10758249aa5bbddbdaae0108bba04f30df 100644
>> --- a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> +++ b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> @@ -394,6 +394,7 @@ struct rk_hdptx_phy {
>>
>> int phy_id;
>> struct phy *phy;
>> + struct phy_configure_opts_hdmi hdmi_cfg;
>> struct clk_bulk_data *clks;
>> int nr_clks;
>> struct reset_control_bulk_data rsts[RST_MAX];
>> @@ -1409,19 +1410,25 @@ static int rk_hdptx_dp_aux_init(struct rk_hdptx_phy *hdptx)
>> static int rk_hdptx_phy_power_on(struct phy *phy)
>> {
>> struct rk_hdptx_phy *hdptx = phy_get_drvdata(phy);
>> - int bus_width = phy_get_bus_width(hdptx->phy);
>> enum phy_mode mode = phy_get_mode(phy);
>> + unsigned int rate = 0;
>> int ret, lane;
>>
>> - /*
>> - * FIXME: Temporary workaround to pass pixel_clk_rate
>> - * from the HDMI bridge driver until phy_configure_opts_hdmi
>> - * becomes available in the PHY API.
>> - */
>> - unsigned int rate = bus_width & 0xfffffff;
>> -
>> - dev_dbg(hdptx->dev, "%s bus_width=%x rate=%u\n",
>> - __func__, bus_width, rate);
>> + if (mode != PHY_MODE_DP) {
>> + if (!hdptx->hdmi_cfg.tmds_char_rate) {
>> + /*
>> + * FIXME: Temporary workaround to setup TMDS char rate
>> + * from the RK DW HDMI QP bridge driver.
>> + * Will be removed as soon the switch to the HDMI PHY
>> + * configuration API has been completed on both ends.
>> + */
>> + rate = phy_get_bus_width(hdptx->phy) & 0xfffffff;
>> + hdptx->hdmi_cfg.tmds_char_rate = rate * 100;
>> + } else {
>> + rate = hdptx->hdmi_cfg.tmds_char_rate / 100;
>> + }
>> + dev_dbg(hdptx->dev, "%s rate=%u\n", __func__, rate);
>> + }
>
> Some story here, I can't make sense of a variable in hHz. If it's
> actually needed and not a bug, this should be very explictly documented.
Not a bug - as explained earlier, phy_set_bus_width() on the other end
passes this in hHz. I agree it should have been properly documented,
but eventually we got this cleaned up in the last patch of the series.
Thanks,
Cristian
next prev parent reply other threads:[~2025-03-04 12:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 1:43 [PATCH v4 00/12] phy: rockchip: samsung-hdptx: Support high color depth management Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 01/12] phy: Add HDMI configuration options Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 02/12] phy: hdmi: Add color depth configuration Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 03/12] phy: rockchip: samsung-hdptx: Fix clock ratio setup Cristian Ciocaltea
2025-03-04 8:13 ` Maxime Ripard
2025-03-04 12:04 ` Cristian Ciocaltea
2025-03-06 13:35 ` Maxime Ripard
2025-03-06 16:38 ` Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 04/12] phy: rockchip: samsung-hdptx: Drop unused struct lcpll_config Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 05/12] phy: rockchip: samsung-hdptx: Drop unused phy_cfg driver data Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 06/12] phy: rockchip: samsung-hdptx: Drop superfluous cfgs " Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 07/12] phy: rockchip: samsung-hdptx: Setup TMDS char rate via phy_configure_opts_hdmi Cristian Ciocaltea
2025-03-04 8:15 ` Maxime Ripard
2025-03-04 12:12 ` Cristian Ciocaltea [this message]
2025-03-04 1:44 ` [PATCH v4 08/12] phy: rockchip: samsung-hdptx: Provide config params validation support Cristian Ciocaltea
2025-03-04 8:18 ` Maxime Ripard
2025-03-04 12:20 ` Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 09/12] phy: rockchip: samsung-hdptx: Restrict altering TMDS char rate via CCF Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 10/12] phy: rockchip: samsung-hdptx: Add high color depth management Cristian Ciocaltea
2025-03-04 8:21 ` Maxime Ripard
2025-03-04 12:28 ` Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 11/12] phy: rockchip: samsung-hdptx: Optimize internal rate handling Cristian Ciocaltea
2025-03-04 1:44 ` [PATCH v4 12/12] phy: rockchip: samsung-hdptx: Avoid Hz-hHz unit conversion overhead Cristian Ciocaltea
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=ddf4c3c9-849c-4d96-a073-966bb19a6047@collabora.com \
--to=cristian.ciocaltea@collabora.com \
--cc=Sandor.yu@nxp.com \
--cc=algea.cao@rock-chips.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=heiko@sntech.de \
--cc=kernel@collabora.com \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mripard@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