Re: [PATCH V4 4/5] phy: freescale: fsl-samsung-hdmi: Use closest divider
From: Dominique Martinet
Date: Tue Sep 03 2024 - 01:12:53 EST
Thank you!
Adam Ford wrote on Mon, Sep 02, 2024 at 08:30:46PM -0500:
> + /* Calculate the differences and use the closest one */
> + delta_frac = (rate - phy_pll_cfg[i].pixclk);
> + delta_int = (rate - int_div_clk);
This assumes rate > whatever pixclk was found, that doesn't look true to
me for the integer calculation (`delta = abs(fout - tmp)` so it looks
like it can pick a larger value)
For the LUT, the way the lookup works is by picking the closest smaller
value so this is not a problem, but someone might come fix that later so
I'd rather just use abs() everywhere for future-proofing
That aside it looks good to me, I'll add a 0.5% tolerance patch and test
this all ASAP (might be a few days); will send the tolerance patch
properly after testing but for reference it will probably look like
this:
---