[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f4d6f3d3-568a-c3ee-3c87-9b0a65ad2912@quicinc.com>
Date: Thu, 20 Jul 2023 10:36:22 +0530
From: Devi Priya <quic_devipriy@...cinc.com>
To: Stephen Boyd <sboyd@...nel.org>, <agross@...nel.org>,
<andersson@...nel.org>, <konrad.dybcio@...aro.org>,
<linux-arm-msm@...r.kernel.org>, <linux-clk@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <mturquette@...libre.com>
CC: <quic_srichara@...cinc.com>, <quic_sjaganat@...cinc.com>,
<quic_kathirav@...cinc.com>, <quic_anusha@...cinc.com>,
<quic_saahtoma@...cinc.com>
Subject: Re: [PATCH] clk: qcom: clk-alpha-pll: Use determine_rate instead of
round_rate
On 7/20/2023 1:34 AM, Stephen Boyd wrote:
> Quoting Devi Priya (2023-07-10 02:32:06)
>> @@ -1094,25 +1099,25 @@ static const struct clk_div_table clk_alpha_2bit_div_table[] = {
>> { }
>> };
>>
>> -static long
>> -clk_alpha_pll_postdiv_round_rate(struct clk_hw *hw, unsigned long rate,
>> - unsigned long *prate)
>> +static int clk_alpha_pll_postdiv_determine_rate(struct clk_hw *hw,
>> + struct clk_rate_request *req)
>> {
>> struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
>> const struct clk_div_table *table;
>> + unsigned long rate = req->rate;
>>
>> if (pll->width == 2)
>> table = clk_alpha_2bit_div_table;
>> else
>> table = clk_alpha_div_table;
>>
>> - return divider_round_rate(hw, rate, prate, table,
>> - pll->width, CLK_DIVIDER_POWER_OF_TWO);
>> + req->rate = divider_round_rate(hw, rate, &req->best_parent_rate, table,
>
> Can you use divider_determine_rate() instead?
Sure, okay
>
>> + pll->width, CLK_DIVIDER_POWER_OF_TWO);
>> + return 0;
>> }
>>
>> -static long
>> -clk_alpha_pll_postdiv_round_ro_rate(struct clk_hw *hw, unsigned long rate,
>> - unsigned long *prate)
>> +static int clk_alpha_pll_postdiv_determine_ro_rate(struct clk_hw *hw,
>> + struct clk_rate_request *req)
>> {
>> struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
>> u32 ctl, div;
> [...]
>> @@ -1452,14 +1459,16 @@ clk_trion_pll_postdiv_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
>> return (parent_rate / div);
>> }
>>
>> -static long
>> -clk_trion_pll_postdiv_round_rate(struct clk_hw *hw, unsigned long rate,
>> - unsigned long *prate)
>> +static int
>> +clk_trion_pll_postdiv_determine_rate(struct clk_hw *hw,
>> + struct clk_rate_request *req)
>> {
>> struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
>>
>> - return divider_round_rate(hw, rate, prate, pll->post_div_table,
>> - pll->width, CLK_DIVIDER_ROUND_CLOSEST);
>> + req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
>
> divider_determine_rate()?
Sure
>
>> + pll->post_div_table, pll->width,
>> + CLK_DIVIDER_ROUND_CLOSEST);
>> + return 0;
>> };
>>
>> static int
>> @@ -1485,18 +1494,21 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate,
>>
>> const struct clk_ops clk_alpha_pll_postdiv_trion_ops = {
>> .recalc_rate = clk_trion_pll_postdiv_recalc_rate,
>> - .round_rate = clk_trion_pll_postdiv_round_rate,
>> + .determine_rate = clk_trion_pll_postdiv_determine_rate,
>> .set_rate = clk_trion_pll_postdiv_set_rate,
>> };
>> EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_trion_ops);
>>
>> -static long clk_alpha_pll_postdiv_fabia_round_rate(struct clk_hw *hw,
>> - unsigned long rate, unsigned long *prate)
>> +static int
>> +clk_alpha_pll_postdiv_fabia_determine_rate(struct clk_hw *hw,
>> + struct clk_rate_request *req)
>> {
>> struct clk_alpha_pll_postdiv *pll = to_clk_alpha_pll_postdiv(hw);
>>
>> - return divider_round_rate(hw, rate, prate, pll->post_div_table,
>> - pll->width, CLK_DIVIDER_ROUND_CLOSEST);
>> + req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
>> + pll->post_div_table, pll->width,
>> + CLK_DIVIDER_ROUND_CLOSEST);
>
> divider_determine_rate()?
Sure
Thanks,
Devi Priya
Powered by blists - more mailing lists