Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/hdmi_phy_8998: 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. The change to use clamp_t() was
done manually.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/667878/
Link: https://lore.kernel.org/r/20250810-drm-msm-phy-clk-round-rate-v2-7-0fd1f7979c83@redhat.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Brian Masney and committed by
Dmitry Baryshkov
a38d1fbb 5beef1fe

+6 -10
+6 -10
drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
··· 646 646 return 0; 647 647 } 648 648 649 - static long hdmi_8998_pll_round_rate(struct clk_hw *hw, 650 - unsigned long rate, 651 - unsigned long *parent_rate) 649 + static int hdmi_8998_pll_determine_rate(struct clk_hw *hw, 650 + struct clk_rate_request *req) 652 651 { 653 - if (rate < HDMI_PCLK_MIN_FREQ) 654 - return HDMI_PCLK_MIN_FREQ; 655 - else if (rate > HDMI_PCLK_MAX_FREQ) 656 - return HDMI_PCLK_MAX_FREQ; 657 - else 658 - return rate; 652 + req->rate = clamp_t(unsigned long, req->rate, HDMI_PCLK_MIN_FREQ, HDMI_PCLK_MAX_FREQ); 653 + 654 + return 0; 659 655 } 660 656 661 657 static unsigned long hdmi_8998_pll_recalc_rate(struct clk_hw *hw, ··· 684 688 685 689 static const struct clk_ops hdmi_8998_pll_ops = { 686 690 .set_rate = hdmi_8998_pll_set_clk_rate, 687 - .round_rate = hdmi_8998_pll_round_rate, 691 + .determine_rate = hdmi_8998_pll_determine_rate, 688 692 .recalc_rate = hdmi_8998_pll_recalc_rate, 689 693 .prepare = hdmi_8998_pll_prepare, 690 694 .unprepare = hdmi_8998_pll_unprepare,