From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6DBD4C282DE for ; Thu, 6 Mar 2025 16:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KNRXsKh01rhF30GssN/t2CdMz9Ve9tXNYIHSL6EIwmE=; b=DACOn30ZEP41t1 iTrJ4cTKm9EgFV9IT+tx/ru73vkGYZ4SLsebplpiNjUS9eD7FpP0WAPSyREduECk4zOJKbtbuyFa6 O0W85QT6XTvRLVeKcaKaC1wTzzeJfQIfraIDyw0CygdEwUSxY9/X8M5fOPkukADxOqSoVwpBw/4Os c5Mc6VxPXud60tior2zl7FHCZ9dB9CoLzyojCBPwDsCKreQTK5cyb1x2RZBtbVAJJRUia2jCzNDOb bpkiPknzUEb0DYhytg5N0sDNBzQtBt0PlDKdIZeKQ0/ETKEl+Ry+v6jCo4ibiwUMuWU3RgAbE3kkO q4NHb5Hpj/OWrkroeF8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tqEH1-0000000BXfx-2A2b; Thu, 06 Mar 2025 16:40:39 +0000 Received: from bali.collaboradmins.com ([148.251.105.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tqEFN-0000000BXMu-3j9w; Thu, 06 Mar 2025 16:38:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1741279135; bh=pf36QmNJXVaZuz3s0mehd9lTyDeLXhfnvdrEPGA0Fj8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LVdJ9bO6yHENnaiGBkjkHB6ID9jroBGW+832lD2QHbp1MoPDOdOrLAFh5PK67eH3B J8hW+/HhpWumL0HgRcfXj2n1b964Dgd8IrMCFuVesFqGfwbOHN7DRsMd9U3Y9bJGLq /1SKMpO2qRhSrh5oztFLL3if988MSDBQxXrnXsaogjwuLH0UpNhEFzfHgjpU4SGLaO vFlF264y7A44/zYXFotkTS6KgYN/PsL23H8Hw7ZwxYICU3/sySmMCbfoNNICpYPIUu J087mlZc7AmqD2XPxjTg1d3O7lmHAf3H074JopdaaJYcuvc8+QEn/vrnRaaAV1bdiS WylyrhmOK71AQ== Received: from [192.168.1.90] (unknown [84.232.140.93]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 3232D17E086B; Thu, 6 Mar 2025 17:38:55 +0100 (CET) Message-ID: <0600430d-12c1-4af7-9082-76448943b02a@collabora.com> Date: Thu, 6 Mar 2025 18:38:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 03/12] phy: rockchip: samsung-hdptx: Fix clock ratio setup To: Maxime Ripard Cc: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Algea Cao , Sandor Yu , Dmitry Baryshkov , kernel@collabora.com, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org References: <20250304-phy-sam-hdptx-bpc-v4-0-8657847c13f7@collabora.com> <20250304-phy-sam-hdptx-bpc-v4-3-8657847c13f7@collabora.com> <20250304-small-mindful-mongrel-bd6f8b@houat> <155f609f-994f-4140-8453-7e38a5e6deef@collabora.com> <20250306-masked-voracious-octopus-be05b8@houat> Content-Language: en-US From: Cristian Ciocaltea In-Reply-To: <20250306-masked-voracious-octopus-be05b8@houat> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250306_083858_080374_9DD7DBDC X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On 3/6/25 3:35 PM, Maxime Ripard wrote: > On Tue, Mar 04, 2025 at 02:04:18PM +0200, Cristian Ciocaltea wrote: >> 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 >>>> --- >>>> 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" > > Yeah, sorry, I noticed it after sending the review. Still, I'd advise to > put that patch first, it's a bit weird to add more patch we're going to > rework later on. No worries and yes, I've already planned to move the patch before all the others adding more stuff. I'd still keep this patch as is, to make it easier for backporting, as well as the next three patches dropping stuff, before continuing with the unit conversion. -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy