Re: [PATCH V6 4/5] phy: freescale: fsl-samsung-hdmi: Use closest divider

From: Frieder Schrempf
Date: Thu Sep 05 2024 - 03:31:00 EST


On 05.09.24 1:30 AM, Adam Ford wrote:
> Currently, if the clock values cannot be set to the exact rate,
> the round_rate and set_rate functions use the closest value found in
> the look-up-table. In preparation of removing values from the LUT
> that can be calculated evenly with the integer calculator, it's
> necessary to ensure to check both the look-up-table and the integer
> divider clock values to get the closest values to the requested
> value. It does this by measuring the difference between the
> requested clock value and the closest value in both integer divider
> calucator and the fractional clock look-up-table.
>
> Which ever has the smallest difference between them is returned as
> the cloesest rate.
>
> Signed-off-by: Adam Ford <aford173@xxxxxxxxx>
> Signed-off-by: Dominique Martinet <dominique.martinet@xxxxxxxxxxxxxxxxx>

Reviewed-by: Frieder Schrempf <frieder.schrempf@xxxxxxxxxx>
Tested-by: Frieder Schrempf <frieder.schrempf@xxxxxxxxxx>