Commit efc389fa authored by Brian Masney's avatar Brian Masney Committed by Vinod Koul
Browse files

phy: freescale: phy-fsl-samsung-hdmi: convert from round_rate() to determine_rate()



The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
Link: https://patch.msgid.link/20251212-phy-clk-round-rate-v3-1-beae3962f767@redhat.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 5c87da03
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -570,17 +570,20 @@ const struct phy_config *fsl_samsung_hdmi_phy_find_settings(struct fsl_samsung_h
	return fract_div_phy;
}

static long fsl_samsung_hdmi_phy_clk_round_rate(struct clk_hw *hw,
						unsigned long rate, unsigned long *parent_rate)
static int fsl_samsung_hdmi_phy_clk_determine_rate(struct clk_hw *hw,
						   struct clk_rate_request *req)
{
	struct fsl_samsung_hdmi_phy *phy = to_fsl_samsung_hdmi_phy(hw);
	const struct phy_config *target_settings = fsl_samsung_hdmi_phy_find_settings(phy, rate);
	const struct phy_config *target_settings = fsl_samsung_hdmi_phy_find_settings(phy,
										      req->rate);

	if (target_settings == NULL)
		return -EINVAL;

	dev_dbg(phy->dev, "round_rate, closest rate = %u\n", target_settings->pixclk);
	return target_settings->pixclk;
	req->rate = target_settings->pixclk;

	return 0;
}

static int fsl_samsung_hdmi_phy_clk_set_rate(struct clk_hw *hw,
@@ -599,7 +602,7 @@ static int fsl_samsung_hdmi_phy_clk_set_rate(struct clk_hw *hw,

static const struct clk_ops phy_clk_ops = {
	.recalc_rate = phy_clk_recalc_rate,
	.round_rate = fsl_samsung_hdmi_phy_clk_round_rate,
	.determine_rate = fsl_samsung_hdmi_phy_clk_determine_rate,
	.set_rate = fsl_samsung_hdmi_phy_clk_set_rate,
};