[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhcCXGWJhMBDCp6k@builder.lan>
Date: Wed, 23 Feb 2022 21:58:20 -0600
From: Bjorn Andersson <bjorn.andersson@...aro.org>
To: Ansuel Smith <ansuelsmth@...il.com>
Cc: Andy Gross <agross@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Taniya Das <tdas@...eaurora.org>,
linux-arm-msm@...r.kernel.org, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 10/16] clk: qcom: clk-rcg: add clk_rcg_floor_ops ops
On Thu 17 Feb 17:56 CST 2022, Ansuel Smith wrote:
> Add clk_rcg_floor_ops for clock that can't provide a stable freq and
> require to use a floor freq to provide the requested frequency.
>
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> ---
> drivers/clk/qcom/clk-rcg.c | 24 ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/drivers/clk/qcom/clk-rcg.c b/drivers/clk/qcom/clk-rcg.c
> index a9d181d6be21..88845baa7f84 100644
> --- a/drivers/clk/qcom/clk-rcg.c
> +++ b/drivers/clk/qcom/clk-rcg.c
> @@ -526,6 +526,19 @@ static int clk_rcg_set_rate(struct clk_hw *hw, unsigned long rate,
> return __clk_rcg_set_rate(rcg, f);
> }
>
> +static int clk_rcg_set_floor_rate(struct clk_hw *hw, unsigned long rate,
> + unsigned long parent_rate)
> +{
> + struct clk_rcg *rcg = to_clk_rcg(hw);
> + const struct freq_tbl *f;
> +
> + f = qcom_find_freq_floor(rcg->freq_tbl, rate);
> + if (!f)
> + return -EINVAL;
> +
> + return __clk_rcg_set_rate(rcg, f);
> +}
> +
> static int clk_rcg_bypass_set_rate(struct clk_hw *hw, unsigned long rate,
> unsigned long parent_rate)
> {
> @@ -816,6 +829,17 @@ const struct clk_ops clk_rcg_ops = {
> };
> EXPORT_SYMBOL_GPL(clk_rcg_ops);
>
> +const struct clk_ops clk_rcg_floor_ops = {
> + .enable = clk_enable_regmap,
> + .disable = clk_disable_regmap,
> + .get_parent = clk_rcg_get_parent,
> + .set_parent = clk_rcg_set_parent,
> + .recalc_rate = clk_rcg_recalc_rate,
> + .determine_rate = clk_rcg_determine_rate,
> + .set_rate = clk_rcg_set_floor_rate,
> +};
> +EXPORT_SYMBOL_GPL(clk_rcg_floor_ops);
> +
> const struct clk_ops clk_rcg_bypass_ops = {
> .enable = clk_enable_regmap,
> .disable = clk_disable_regmap,
> --
> 2.34.1
>
Powered by blists - more mailing lists