]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: rockchip: samsung-hdptx: Fix clock ratio setup
authorCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Tue, 18 Mar 2025 12:35:37 +0000 (14:35 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Apr 2025 11:48:03 +0000 (17:18 +0530)
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.

Therefore, use the correct comparison operator '>' instead of '>=' when
checking the max rate.  While at it, introduce a define for this rate
limit constant.

Fixes: 553be2830c5f ("phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20250318-phy-sam-hdptx-bpc-v6-3-8cb1678e7663@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c

index fe7c057483563686b8076cf2ce562440cfa6fe55..34a7ef20936422b540b699f1acba44ca465501b7 100644 (file)
 #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) {
                /* For 1/40 bitrate clk */
                rk_hdptx_multi_reg_write(hdptx, rk_hdtpx_tmds_lntop_highbr_seq);
        } else {