summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/imx/ipuv3/imx-tve.c
diff options
context:
space:
mode:
authorBrian Masney <bmasney@redhat.com>2025-08-11 06:56:05 -0400
committerRaphael Gallais-Pou <raphael.gallais-pou@foss.st.com>2025-09-15 15:08:14 +0200
commit6a1977472f6be561aa613d0ee969cb7e268faf5c (patch)
tree1059dbc1336fa7ef3b2116a8e61b77db6a5eed52 /drivers/gpu/drm/imx/ipuv3/imx-tve.c
parente5e0350d5d1ab0e61ea605b6dda742290bea480c (diff)
drm/imx/ipuv3/imx-tve: 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: Brian Masney <bmasney@redhat.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250811-drm-clk-round-rate-v2-1-4a91ccf239cf@redhat.com Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Diffstat (limited to 'drivers/gpu/drm/imx/ipuv3/imx-tve.c')
-rw-r--r--drivers/gpu/drm/imx/ipuv3/imx-tve.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-tve.c b/drivers/gpu/drm/imx/ipuv3/imx-tve.c
index c5629e155d25..63f23b821b0b 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-tve.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-tve.c
@@ -368,17 +368,20 @@ static unsigned long clk_tve_di_recalc_rate(struct clk_hw *hw,
return 0;
}
-static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *prate)
+static int clk_tve_di_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
unsigned long div;
- div = *prate / rate;
+ div = req->best_parent_rate / req->rate;
if (div >= 4)
- return *prate / 4;
+ req->rate = req->best_parent_rate / 4;
else if (div >= 2)
- return *prate / 2;
- return *prate;
+ req->rate = req->best_parent_rate / 2;
+ else
+ req->rate = req->best_parent_rate;
+
+ return 0;
}
static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -409,7 +412,7 @@ static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate,
}
static const struct clk_ops clk_tve_di_ops = {
- .round_rate = clk_tve_di_round_rate,
+ .determine_rate = clk_tve_di_determine_rate,
.set_rate = clk_tve_di_set_rate,
.recalc_rate = clk_tve_di_recalc_rate,
};