public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
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 03/12] phy: rockchip: samsung-hdptx: Fix clock ratio setup
Date: Tue, 4 Mar 2025 14:04:18 +0200	[thread overview]
Message-ID: <155f609f-994f-4140-8453-7e38a5e6deef@collabora.com> (raw)
In-Reply-To: <20250304-small-mindful-mongrel-bd6f8b@houat>

Hi Maxime,

On 3/4/25 10:13 AM, Maxime Ripard wrote:
> Hi,
> 
> On Tue, Mar 04, 2025 at 03:44:02AM +0200, Cristian Ciocaltea wrote:
>> The switch from 1/10 to 1/40 clock ratio must happen when exceeding the
>> 340 MHz rate limit of HDMI 1.4, i.e. when entering the HDMI 2.0 domain,
>> and not before.
>>
>> While at it, introduce a define for this rate limit constant.
>>
>> Fixes: 553be2830c5f ("phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver")
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>  drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> index f88369864c50e4563834ccbb26f1f9f440e99271..cf2c3a46604cb9d8c26fe5ec8346904e0b62848f 100644
>> --- a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> +++ b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c
>> @@ -320,6 +320,7 @@
>>  #define LN3_TX_SER_RATE_SEL_HBR2_MASK	BIT(3)
>>  #define LN3_TX_SER_RATE_SEL_HBR3_MASK	BIT(2)
>>  
>> +#define HDMI14_MAX_RATE			340000000
>>  #define HDMI20_MAX_RATE			600000000
>>  
>>  enum dp_link_rate {
>> @@ -1072,7 +1073,7 @@ static int rk_hdptx_ropll_tmds_mode_config(struct rk_hdptx_phy *hdptx,
>>  
>>  	regmap_write(hdptx->regmap, LNTOP_REG(0200), 0x06);
>>  
>> -	if (rate >= 3400000) {
>> +	if (rate > HDMI14_MAX_RATE / 100) {
> 
> The rate seems to come from rk_hdptx_phy_power_on and eventually from
> tmds_char_rate in the PHY config options, so its rate is in Hertz.

The rate coming from rk_hdptx_phy_power_on() is in hHz, since it passed
via dw_hdmi_qp_rockchip_encoder_enable() as

  phy_set_bus_width(hdmi->phy, div_u64(rate, 100));

> HDMI14_MAX_RATE and HDMI20_MAX_RATE are both defined in Hertz as well.
> It seems super odd to mee that you then convert HDMI14_MAX_RATE to hHz?

This stems from the ropll_tmds_cfg table containing the configuration
params for the supported rates which requires the search keys to be
provided in hHz rather than Hz.

I agree this is nothing but confusing, that's why I fixed this up in
"phy: rockchip: samsung-hdptx: Avoid Hz-hHz unit conversion overhead"

Thanks for reviewing!

Regards,
Cristian


  reply	other threads:[~2025-03-04 12:15 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 [this message]
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
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=155f609f-994f-4140-8453-7e38a5e6deef@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