@@ -178,18 +178,25 @@ static int clk_pllv2_set_rate(struct clk_hw *hw, unsigned long rate,
178
178
return 0 ;
179
179
}
180
180
181
- static long clk_pllv2_round_rate (struct clk_hw * hw , unsigned long rate ,
182
- unsigned long * prate )
181
+ static int clk_pllv2_determine_rate (struct clk_hw * hw ,
182
+ struct clk_rate_request * req )
183
183
{
184
184
u32 dp_op , dp_mfd , dp_mfn ;
185
185
int ret ;
186
186
187
- ret = __clk_pllv2_set_rate (rate , * prate , & dp_op , & dp_mfd , & dp_mfn );
188
- if (ret )
189
- return ret ;
187
+ ret = __clk_pllv2_set_rate (req -> rate , req -> best_parent_rate , & dp_op ,
188
+ & dp_mfd , & dp_mfn );
189
+ if (ret ) {
190
+ req -> rate = ret ;
190
191
191
- return __clk_pllv2_recalc_rate (* prate , MXC_PLL_DP_CTL_DPDCK0_2_EN ,
192
- dp_op , dp_mfd , dp_mfn );
192
+ return 0 ;
193
+ }
194
+
195
+ req -> rate = __clk_pllv2_recalc_rate (req -> best_parent_rate ,
196
+ MXC_PLL_DP_CTL_DPDCK0_2_EN , dp_op ,
197
+ dp_mfd , dp_mfn );
198
+
199
+ return 0 ;
193
200
}
194
201
195
202
static int clk_pllv2_prepare (struct clk_hw * hw )
@@ -235,7 +242,7 @@ static const struct clk_ops clk_pllv2_ops = {
235
242
.prepare = clk_pllv2_prepare ,
236
243
.unprepare = clk_pllv2_unprepare ,
237
244
.recalc_rate = clk_pllv2_recalc_rate ,
238
- .round_rate = clk_pllv2_round_rate ,
245
+ .determine_rate = clk_pllv2_determine_rate ,
239
246
.set_rate = clk_pllv2_set_rate ,
240
247
};
241
248
0 commit comments