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

drm/stm/lvds: 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.

Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Acked-by: Yannick Fertre <yannick.fertre@foss.st.com>
Link: https://lore.kernel.org/r/20250811-drm-clk-round-rate-v2-7-4a91ccf239cf@redhat.com
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>

authored by

Brian Masney and committed by
Raphael Gallais-Pou
1dc50bc8 5ccf442e

+7 -5
+7 -5
drivers/gpu/drm/stm/lvds.c
··· 682 682 return (unsigned long)lvds->pixel_clock_rate; 683 683 } 684 684 685 - static long lvds_pixel_clk_round_rate(struct clk_hw *hw, unsigned long rate, 686 - unsigned long *parent_rate) 685 + static int lvds_pixel_clk_determine_rate(struct clk_hw *hw, 686 + struct clk_rate_request *req) 687 687 { 688 688 struct stm_lvds *lvds = container_of(hw, struct stm_lvds, lvds_ck_px); 689 689 unsigned int pll_in_khz, bdiv = 0, mdiv = 0, ndiv = 0; ··· 703 703 mode = list_first_entry(&connector->modes, 704 704 struct drm_display_mode, head); 705 705 706 - pll_in_khz = (unsigned int)(*parent_rate / 1000); 706 + pll_in_khz = (unsigned int)(req->best_parent_rate / 1000); 707 707 708 708 if (lvds_is_dual_link(lvds->link_type)) 709 709 multiplier = 2; ··· 719 719 lvds->pixel_clock_rate = (unsigned long)pll_get_clkout_khz(pll_in_khz, bdiv, mdiv, ndiv) 720 720 * 1000 * multiplier / 7; 721 721 722 - return lvds->pixel_clock_rate; 722 + req->rate = lvds->pixel_clock_rate; 723 + 724 + return 0; 723 725 } 724 726 725 727 static const struct clk_ops lvds_pixel_clk_ops = { 726 728 .enable = lvds_pixel_clk_enable, 727 729 .disable = lvds_pixel_clk_disable, 728 730 .recalc_rate = lvds_pixel_clk_recalc_rate, 729 - .round_rate = lvds_pixel_clk_round_rate, 731 + .determine_rate = lvds_pixel_clk_determine_rate, 730 732 }; 731 733 732 734 static const struct clk_init_data clk_data = {