From nobody Mon Feb 9 19:06:18 2026 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E5EB3101B2 for ; Mon, 12 Jan 2026 23:21:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768260071; cv=none; b=LXXfUU+i0h7PuR5wWvWnBLCyqAhcACliMMgVdWsHPGypPFz8QvA9p4fr/TqapLasN5r4QlH6K6xJa+mUgUntSrSlhipJw3rowmEMmILpDzwwRE01ia3AvWzJ1CNapcQHksy5EYG64640OmOwSfVN6XkK4GMPYWvuCYeg6D2uZMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768260071; c=relaxed/simple; bh=UTvAhpGPD94aGV3BTlshKqJj1GF2Jg+pTmK83rcvKFc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MM7BPiSHbVZcaQVTKMjbkXO2axuXqsB1XXx7P3sDX80l9ZTERLbENj3YhXyLsAaxWxOqfSqc2srCf4vQT/BkhHmLbJZLoQ34vLtDVvWbyz9dhr4NORuyB5xsTDBkqGgJhPOKHiigWufQBKPQImoQkwM+rJCubuADVC2PI3vS4b4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=jLZ7zjTV; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jLZ7zjTV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1768260066; bh=UTvAhpGPD94aGV3BTlshKqJj1GF2Jg+pTmK83rcvKFc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jLZ7zjTVubi9lSjC3hwxf8/yJB8k0eq03ORqcRGhSnBrg/AsJhXlyhTwqsOn05sjw NSdBuzMkTfRopCFx4xn466ePdSAhvwVZqYyaKPP7qnY+omW3AiVli+b02czF72DO6H R7e4MOWH+TWvtKgvar0neQzGnpgpsDlUrtwgnkQC6zz7BzNijJpKo1gHtm2sEjj7by Q50+gC3itCNttJP9Isr1gptsJR5RG769/6Vb+2Ge+/lRQ9uDLGUoj1RKNTu1/PN0n5 aEAYeh9y0Y3DNIx/NQZTp5GALI8FoioNp0pJy6E88yttmmYHVhYODZdEwnktdukezt SIll6b0CH/R2g== Received: from localhost (unknown [82.79.138.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by bali.collaboradmins.com (Postfix) with ESMTPSA id 9589017E1543; Tue, 13 Jan 2026 00:21:06 +0100 (CET) From: Cristian Ciocaltea Date: Tue, 13 Jan 2026 01:20:57 +0200 Subject: [PATCH v6 10/11] phy: rockchip: samsung-hdptx: Extend rk_hdptx_phy_verify_hdmi_config() helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260113-phy-hdptx-frl-v6-10-8d5f97419c0b@collabora.com> References: <20260113-phy-hdptx-frl-v6-0-8d5f97419c0b@collabora.com> In-Reply-To: <20260113-phy-hdptx-frl-v6-0-8d5f97419c0b@collabora.com> To: Vinod Koul , Kishon Vijay Abraham I , Heiko Stuebner , Algea Cao , Dmitry Baryshkov , Neil Armstrong Cc: kernel@collabora.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.14.3 In order to facilitate introduction of HDMI 2.1 FRL support and to avoid recomputing the link rate after verifying the HDMI configuration given as input, extend rk_hdptx_phy_verify_hdmi_config() by providing an optional output parameter to store the validated configuration. For improved code readability, also rename the existing hdmi input parameter. Signed-off-by: Cristian Ciocaltea --- drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 35 ++++++++++++-------= ---- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c b/drivers/ph= y/rockchip/phy-rockchip-samsung-hdptx.c index f1cad0264952..c9942aaf2766 100644 --- a/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c +++ b/drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c @@ -1439,25 +1439,24 @@ static int rk_hdptx_phy_power_off(struct phy *phy) } =20 static int rk_hdptx_phy_verify_hdmi_config(struct rk_hdptx_phy *hdptx, - struct phy_configure_opts_hdmi *hdmi) + struct phy_configure_opts_hdmi *hdmi_in, + struct rk_hdptx_hdmi_cfg *hdmi_out) { int i; =20 - if (!hdmi->tmds_char_rate || hdmi->tmds_char_rate > HDMI20_MAX_RATE) + if (!hdmi_in->tmds_char_rate || hdmi_in->tmds_char_rate > HDMI20_MAX_RATE) return -EINVAL; =20 for (i =3D 0; i < ARRAY_SIZE(rk_hdptx_tmds_ropll_cfg); i++) - if (hdmi->tmds_char_rate =3D=3D rk_hdptx_tmds_ropll_cfg[i].rate) + if (hdmi_in->tmds_char_rate =3D=3D rk_hdptx_tmds_ropll_cfg[i].rate) break; =20 if (i =3D=3D ARRAY_SIZE(rk_hdptx_tmds_ropll_cfg) && - !rk_hdptx_phy_clk_pll_calc(hdmi->tmds_char_rate, NULL)) + !rk_hdptx_phy_clk_pll_calc(hdmi_in->tmds_char_rate, NULL)) return -EINVAL; =20 - if (!hdmi->bpc) - hdmi->bpc =3D 8; - - switch (hdmi->bpc) { + switch (hdmi_in->bpc) { + case 0: case 8: case 10: case 12: @@ -1467,6 +1466,11 @@ static int rk_hdptx_phy_verify_hdmi_config(struct rk= _hdptx_phy *hdptx, return -EINVAL; } =20 + if (hdmi_out) { + hdmi_out->rate =3D hdmi_in->tmds_char_rate; + hdmi_out->bpc =3D hdmi_in->bpc ?: 8; + } + return 0; } =20 @@ -1732,17 +1736,15 @@ static int rk_hdptx_phy_configure(struct phy *phy, = union phy_configure_opts *opt int ret; =20 if (mode !=3D PHY_MODE_DP) { - ret =3D rk_hdptx_phy_verify_hdmi_config(hdptx, &opts->hdmi); + ret =3D rk_hdptx_phy_verify_hdmi_config(hdptx, &opts->hdmi, &hdptx->hdmi= _cfg); if (ret) { dev_err(hdptx->dev, "invalid hdmi params for phy configure\n"); } else { - hdptx->hdmi_cfg.rate =3D opts->hdmi.tmds_char_rate; - hdptx->hdmi_cfg.bpc =3D opts->hdmi.bpc; hdptx->restrict_rate_change =3D true; + dev_dbg(hdptx->dev, "%s rate=3D%llu bpc=3D%u\n", __func__, + hdptx->hdmi_cfg.rate, hdptx->hdmi_cfg.bpc); } =20 - dev_dbg(hdptx->dev, "%s rate=3D%llu bpc=3D%u\n", __func__, - hdptx->hdmi_cfg.rate, hdptx->hdmi_cfg.bpc); return ret; } =20 @@ -1786,7 +1788,7 @@ static int rk_hdptx_phy_validate(struct phy *phy, enu= m phy_mode mode, struct rk_hdptx_phy *hdptx =3D phy_get_drvdata(phy); =20 if (mode !=3D PHY_MODE_DP) - return rk_hdptx_phy_verify_hdmi_config(hdptx, &opts->hdmi); + return rk_hdptx_phy_verify_hdmi_config(hdptx, &opts->hdmi, NULL); =20 return rk_hdptx_phy_verify_dp_config(hdptx, &opts->dp); } @@ -1926,12 +1928,11 @@ static int rk_hdptx_phy_clk_determine_rate(struct c= lk_hw *hw, struct phy_configure_opts_hdmi hdmi =3D { .tmds_char_rate =3D req->rate, }; - int ret =3D rk_hdptx_phy_verify_hdmi_config(hdptx, &hdmi); + + int ret =3D rk_hdptx_phy_verify_hdmi_config(hdptx, &hdmi, &hdptx->hdmi_c= fg); =20 if (ret) return ret; - - hdptx->hdmi_cfg.rate =3D req->rate; } =20 /* --=20 2.52.0