@@ -96,16 +96,17 @@ static int sclk_div_bestdiv(struct clk_hw *hw, unsigned long rate,
96
96
return bestdiv ;
97
97
}
98
98
99
- static long sclk_div_round_rate (struct clk_hw * hw , unsigned long rate ,
100
- unsigned long * prate )
99
+ static int sclk_div_determine_rate (struct clk_hw * hw ,
100
+ struct clk_rate_request * req )
101
101
{
102
102
struct clk_regmap * clk = to_clk_regmap (hw );
103
103
struct meson_sclk_div_data * sclk = meson_sclk_div_data (clk );
104
104
int div ;
105
105
106
- div = sclk_div_bestdiv (hw , rate , prate , sclk );
106
+ div = sclk_div_bestdiv (hw , req -> rate , & req -> best_parent_rate , sclk );
107
+ req -> rate = DIV_ROUND_UP_ULL ((u64 )req -> best_parent_rate , div );
107
108
108
- return DIV_ROUND_UP_ULL (( u64 ) * prate , div ) ;
109
+ return 0 ;
109
110
}
110
111
111
112
static void sclk_apply_ratio (struct clk_regmap * clk ,
@@ -237,7 +238,7 @@ static int sclk_div_init(struct clk_hw *hw)
237
238
238
239
const struct clk_ops meson_sclk_div_ops = {
239
240
.recalc_rate = sclk_div_recalc_rate ,
240
- .round_rate = sclk_div_round_rate ,
241
+ .determine_rate = sclk_div_determine_rate ,
241
242
.set_rate = sclk_div_set_rate ,
242
243
.enable = sclk_div_enable ,
243
244
.disable = sclk_div_disable ,
0 commit comments