lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 08/12] clk: actions: Add factor clock support
Date
Quoting Manivannan Sadhasivam (2018-03-17 03:09:48)
> +
> +static int clk_val_best(struct clk_hw *hw, unsigned long rate,
> + unsigned long *best_parent_rate)
> +{
[...]
> + }
> +
> + parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw),
> + try_parent_rate);
> + cur_rate = DIV_ROUND_UP(parent_rate, clkt->div) * clkt->mul;
> + if (cur_rate <= rate && cur_rate > best) {
> + bestval = clkt->val;
> + best = cur_rate;
> + *best_parent_rate = parent_rate;
> + }
> + }
> +
> + if (!bestval) {
> + bestval = _get_table_maxval(clkt);
> + *best_parent_rate = clk_hw_round_rate(
> + clk_hw_get_parent(hw), 1);
> + }
> +
> + return bestval;

Also, if this is largely copy/paste from the factor clk code then
perhaps those functions can be exported to here and reused instead of
copy/paste.

> +}

\
 
 \ /
  Last update: 2018-03-20 02:12    [W:0.154 / U:3.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site