All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Abhishek Sahu <absahu@codeaurora.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Ajit Pandey <quic_ajipan@quicinc.com>,
	Imran Shaik <quic_imrashai@quicinc.com>,
	Taniya Das <quic_tdas@quicinc.com>,
	Jagadeesh Kona <quic_jkona@quicinc.com>
Subject: Re: [PATCH 2/5] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops
Date: Sat, 2 Mar 2024 00:56:11 +0100	[thread overview]
Message-ID: <630bb10a-2197-4573-a6d5-01fa6650c315@linaro.org> (raw)
In-Reply-To: <20240229-camcc-support-sm8150-v1-2-8c28c6c87990@quicinc.com>

On 29.02.2024 06:38, Satya Priya Kakitapalli wrote:
> From: Taniya Das <quic_tdas@quicinc.com>
> 
> Regera PLL ops are required to control the Regera PLL from clock
> controller drivers, thus add support for the same.
> 
> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---

[...]


> +static int clk_regera_pll_enable(struct clk_hw *hw)

This function is 1:1 clk_zonda_pll_enable() logic-wise, except for
the `if (val & ZONDA_STAY_IN_CFA)` part. Would it be an issue on
Regera?

> +static void clk_regera_pll_disable(struct clk_hw *hw)

This again is clk_zonda_pll_disable(), except the very last value written
to PLL_OPMODE is different. Could you commonize them?


> +
> +static void zonda_pll_adjust_l_val(unsigned long rate, unsigned long prate,
> +									u32 *l)

(Ugly wrapping, please touch it up)

..should it apply to zonda as the name suggests? Also, any explanations?

> +	u64 remainder, quotient;
> +
> +	quotient = rate;
> +	remainder = do_div(quotient, prate);
> +	*l = quotient;
> +
> +	if ((remainder * 2) / prate)
> +		*l = *l + 1;
> +}
> +
> +static int clk_regera_pll_set_rate(struct clk_hw *hw, unsigned long rate,
> +				  unsigned long prate)
> +{
> +	struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
> +	unsigned long rrate;
> +	u32 l, alpha_width = pll_alpha_width(pll);
> +	u64 a;
> +	int ret;
> +
> +	rrate = alpha_pll_round_rate(rate, prate, &l, &a, alpha_width);
> +
> +	ret = alpha_pll_check_rate_margin(hw, rrate, rate);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (a && (a & BIT(15)))

What is BIT(15)?

Also, the left part of the condition is totally bogus, if a is 0 then
a & BIT(15) will surely be zero as well.

Konrad



  reply	other threads:[~2024-03-01 23:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29  5:38 [PATCH 0/5] clk: qcom: sm8150: Add camera clock controller support for SM8150 Satya Priya Kakitapalli
2024-02-29  5:38 ` [PATCH 1/5] clk: qcom: alpha-pll: Fix the pll post div mask Satya Priya Kakitapalli
2024-03-01 23:48   ` Konrad Dybcio
2024-02-29  5:38 ` [PATCH 2/5] clk: qcom: clk-alpha-pll: Add support for Regera PLL ops Satya Priya Kakitapalli
2024-03-01 23:56   ` Konrad Dybcio [this message]
2024-03-08  8:26     ` Satya Priya Kakitapalli (Temp)
2024-03-13 18:43       ` Konrad Dybcio
2024-02-29  5:38 ` [PATCH 3/5] dt-bindings: clock: qcom: Add SM8150 camera clock controller Satya Priya Kakitapalli
2024-02-29  8:00   ` Krzysztof Kozlowski
2024-02-29  5:38 ` [PATCH 4/5] clk: qcom: Add camera clock controller driver for SM8150 Satya Priya Kakitapalli
2024-03-02 16:13   ` Bryan O'Donoghue
2024-03-06  8:30     ` Satya Priya Kakitapalli (Temp)
2024-03-06 13:55       ` Bryan O'Donoghue
2024-03-08 10:46         ` Satya Priya Kakitapalli (Temp)
2024-03-08 10:58           ` Bryan O'Donoghue
2024-03-08 10:59             ` Bryan O'Donoghue
2024-03-08 12:40               ` Satya Priya Kakitapalli (Temp)
2024-03-08 13:04                 ` Bryan O'Donoghue
2024-03-08 11:54           ` Dmitry Baryshkov
2024-03-28  9:42             ` Satya Priya Kakitapalli (Temp)
2024-04-05  6:27     ` Satya Priya Kakitapalli (Temp)
2024-04-05 21:32       ` Stephen Boyd
2024-02-29  5:38 ` [PATCH 5/5] arm64: dts: qcom: Add camera clock controller for sm8150 Satya Priya Kakitapalli
2024-03-02 16:15   ` Bryan O'Donoghue
2024-03-06  8:32     ` Satya Priya Kakitapalli (Temp)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=630bb10a-2197-4573-a6d5-01fa6650c315@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=absahu@codeaurora.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=quic_ajipan@quicinc.com \
    --cc=quic_imrashai@quicinc.com \
    --cc=quic_jkona@quicinc.com \
    --cc=quic_skakitap@quicinc.com \
    --cc=quic_tdas@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.