@@ -570,18 +570,23 @@ static long bcm2835_pll_rate_from_divisors(unsigned long parent_rate,
570
570
return rate >> A2W_PLL_FRAC_BITS ;
571
571
}
572
572
573
- static long bcm2835_pll_round_rate (struct clk_hw * hw , unsigned long rate ,
574
- unsigned long * parent_rate )
573
+ static int bcm2835_pll_determine_rate (struct clk_hw * hw ,
574
+ struct clk_rate_request * req )
575
575
{
576
576
struct bcm2835_pll * pll = container_of (hw , struct bcm2835_pll , hw );
577
577
const struct bcm2835_pll_data * data = pll -> data ;
578
578
u32 ndiv , fdiv ;
579
579
580
- rate = clamp (rate , data -> min_rate , data -> max_rate );
580
+ req -> rate = clamp (req -> rate , data -> min_rate , data -> max_rate );
581
581
582
- bcm2835_pll_choose_ndiv_and_fdiv (rate , * parent_rate , & ndiv , & fdiv );
582
+ bcm2835_pll_choose_ndiv_and_fdiv (req -> rate , req -> best_parent_rate ,
583
+ & ndiv , & fdiv );
583
584
584
- return bcm2835_pll_rate_from_divisors (* parent_rate , ndiv , fdiv , 1 );
585
+ req -> rate = bcm2835_pll_rate_from_divisors (req -> best_parent_rate ,
586
+ ndiv , fdiv ,
587
+ 1 );
588
+
589
+ return 0 ;
585
590
}
586
591
587
592
static unsigned long bcm2835_pll_get_rate (struct clk_hw * hw ,
@@ -783,7 +788,7 @@ static const struct clk_ops bcm2835_pll_clk_ops = {
783
788
.unprepare = bcm2835_pll_off ,
784
789
.recalc_rate = bcm2835_pll_get_rate ,
785
790
.set_rate = bcm2835_pll_set_rate ,
786
- .round_rate = bcm2835_pll_round_rate ,
791
+ .determine_rate = bcm2835_pll_determine_rate ,
787
792
.debug_init = bcm2835_pll_debug_init ,
788
793
};
789
794
0 commit comments