@@ -216,31 +216,38 @@ static void imx_pll14xx_calc_settings(struct clk_pll14xx *pll, unsigned long rat
216
216
t -> mdiv , t -> kdiv );
217
217
}
218
218
219
- static long clk_pll1416x_round_rate (struct clk_hw * hw , unsigned long rate ,
220
- unsigned long * prate )
219
+ static int clk_pll1416x_determine_rate (struct clk_hw * hw ,
220
+ struct clk_rate_request * req )
221
221
{
222
222
struct clk_pll14xx * pll = to_clk_pll14xx (hw );
223
223
const struct imx_pll14xx_rate_table * rate_table = pll -> rate_table ;
224
224
int i ;
225
225
226
226
/* Assuming rate_table is in descending order */
227
227
for (i = 0 ; i < pll -> rate_count ; i ++ )
228
- if (rate >= rate_table [i ].rate )
229
- return rate_table [i ].rate ;
228
+ if (req -> rate >= rate_table [i ].rate ) {
229
+ req -> rate = rate_table [i ].rate ;
230
+
231
+ return 0 ;
232
+ }
230
233
231
234
/* return minimum supported value */
232
- return rate_table [pll -> rate_count - 1 ].rate ;
235
+ req -> rate = rate_table [pll -> rate_count - 1 ].rate ;
236
+
237
+ return 0 ;
233
238
}
234
239
235
- static long clk_pll1443x_round_rate (struct clk_hw * hw , unsigned long rate ,
236
- unsigned long * prate )
240
+ static int clk_pll1443x_determine_rate (struct clk_hw * hw ,
241
+ struct clk_rate_request * req )
237
242
{
238
243
struct clk_pll14xx * pll = to_clk_pll14xx (hw );
239
244
struct imx_pll14xx_rate_table t ;
240
245
241
- imx_pll14xx_calc_settings (pll , rate , * prate , & t );
246
+ imx_pll14xx_calc_settings (pll , req -> rate , req -> best_parent_rate , & t );
247
+
248
+ req -> rate = t .rate ;
242
249
243
- return t . rate ;
250
+ return 0 ;
244
251
}
245
252
246
253
static unsigned long clk_pll14xx_recalc_rate (struct clk_hw * hw ,
@@ -470,7 +477,7 @@ static const struct clk_ops clk_pll1416x_ops = {
470
477
.unprepare = clk_pll14xx_unprepare ,
471
478
.is_prepared = clk_pll14xx_is_prepared ,
472
479
.recalc_rate = clk_pll14xx_recalc_rate ,
473
- .round_rate = clk_pll1416x_round_rate ,
480
+ .determine_rate = clk_pll1416x_determine_rate ,
474
481
.set_rate = clk_pll1416x_set_rate ,
475
482
};
476
483
@@ -483,7 +490,7 @@ static const struct clk_ops clk_pll1443x_ops = {
483
490
.unprepare = clk_pll14xx_unprepare ,
484
491
.is_prepared = clk_pll14xx_is_prepared ,
485
492
.recalc_rate = clk_pll14xx_recalc_rate ,
486
- .round_rate = clk_pll1443x_round_rate ,
493
+ .determine_rate = clk_pll1443x_determine_rate ,
487
494
.set_rate = clk_pll1443x_set_rate ,
488
495
};
489
496
0 commit comments