]> www.infradead.org Git - users/jedix/linux-maple.git/commit
phy: freescale: fsl-samsung-hdmi: Refactor finding PHY settings
authorAdam Ford <aford173@gmail.com>
Sun, 4 May 2025 20:40:41 +0000 (15:40 -0500)
committerVinod Koul <vkoul@kernel.org>
Wed, 14 May 2025 11:15:51 +0000 (12:15 +0100)
commit41db4623346777be6ce694338b5adc570c4b671d
tree45fe77581d59265b60ca97afb1d76689143a3404
parentbe79213b4f9ab6e5abf870b97f8a1cab5bf049b3
phy: freescale: fsl-samsung-hdmi: Refactor finding PHY settings

There are two functions, round_rate and set_rate that duplicate
a lot of the same work, so simplify the code by creating a helper
function that will identify the phy settings for a desired clock
rate and return the structure with the corresponding settings.
>From this structure, the round_rate and set_rate can both get what
they need to achieve the clock setting closest to the desired rate
as possible while minimizing the duplicated code.

Also rename phy_clk_set_rate to fsl_samsung_hdmi_phy_clk_set_rate.

Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
Link: https://lore.kernel.org/r/20250504204043.418924-2-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-samsung-hdmi.c