[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250310-8ulp_hdmi-v1-1-a2f231e31987@atmark-techno.com>
Date: Mon, 10 Mar 2025 10:21:32 +0900
From: Dominique Martinet <dominique.martinet@...ark-techno.com>
To: Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>
Cc: Adam Ford <aford173@...il.com>,
Frieder Schrempf <frieder.schrempf@...tron.de>,
Marco Felsch <m.felsch@...gutronix.de>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Lucas Stach <l.stach@...gutronix.de>, linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org, Makoto Sato <makoto.sato@...ark-techno.com>,
Dominique Martinet <dominique.martinet@...ark-techno.com>
Subject: [PATCH] phy: freescale: fsl-samsung-hdmi: return closest rate
instead LUT
From: Makoto Sato <makoto.sato@...ark-techno.com>
If the requested rate is not an exact match of the integer divider
phy_clk_round_rate() would return the look up table value,
but phy_clk_set_rate() can still use the integer divider if it results
in a frequency that is closer than the look up table.
In particular, not returning the actually used value here made the hdmi
bridge driver reject a frequency that has an integer divider rate
within 0.5% of the target:
for 83.5mHz, the integer divider generates 83.2mHz (-0.36%), but the
next LUT value (82.5mHz) is 1.2% off which incorrectly rejects modes
requiring this frequency.
This commit updates phy_clk_round_rate() to use the same logic as the
set operation.
Signed-off-by: Makoto Sato <makoto.sato@...ark-techno.com>
Signed-off-by: Dominique Martinet <dominique.martinet@...ark-techno.com>
---
We're finally using this rewrite in our (outdated) tree and noticed the
"best" mode missing on one of our picky displays.
It all looks good with this fix, thanks again!
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index e4c0a82d16d9ef0f64ebf9e505b8620423cdc416..91c4d27a31f48fc49f1e8417d7089f5519b8a0a2 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -557,8 +557,9 @@ static long phy_clk_round_rate(struct clk_hw *hw,
if (int_div_clk == rate)
return int_div_clk;
- /* If neither rate is an exact match, use the value from the LUT */
- return fract_div_phy->pixclk;
+ /* If neither rate is an exact match, use the closest value */
+ return fsl_samsung_hdmi_phy_get_closest_rate(rate, int_div_clk,
+ fract_div_phy->pixclk);
}
static int phy_use_fract_div(struct fsl_samsung_hdmi_phy *phy, const struct phy_config *fract_div_phy)
---
base-commit: 80e54e84911a923c40d7bee33a34c1b4be148d7a
change-id: 20250310-8ulp_hdmi-f8deac08611e
Best regards,
--
Dominique Martinet <dominique.martinet@...ark-techno.com>
Powered by blists - more mailing lists