]> www.infradead.org Git - users/jedix/linux-maple.git/commit
phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation
authorAdam Ford <aford173@gmail.com>
Sat, 26 Oct 2024 13:19:59 +0000 (08:19 -0500)
committerVinod Koul <vkoul@kernel.org>
Sun, 8 Dec 2024 15:51:20 +0000 (21:21 +0530)
commitd567679f2b6a8bcea20589bbea6488c0236886cd
tree93a2d21ed862530391601787a2fa1ee744856a0a
parent1b9b8b159601d174526ce1c3a62ebe3a7286003b
phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation

Currently, the calcuation for fld_tg_code is based on a lookup table,
but there are gaps in the lookup table, and frequencies in these
gaps may not properly use the correct divider.  Based on the description
of FLD_CK_DIV, the internal PLL frequency should be less than 50 MHz,
so directly calcuate the value of FLD_CK_DIV from pixclk.
This allow for proper calcuation of any pixel clock and eliminates a
few gaps in the LUT.

Since the value of the int_pllclk is in Hz, do the fixed-point
math in Hz to achieve a more accurate value and reduces the complexity
of the caluation to 24MHz * (256 / int_pllclk).

Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20241026132014.73050-3-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-samsung-hdmi.c