[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f726290fe0678217f2e17b6a68c20d42.sboyd@kernel.org>
Date: Wed, 19 Jul 2023 13:04:48 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Devi Priya <quic_devipriy@...cinc.com>, 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
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?
> + 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()?
> + 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()?
Powered by blists - more mailing lists