devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Jagadeesh Kona <quic_jkona@quicinc.com>,
	Andy Gross <agross@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Vinod Koul <vkoul@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Taniya Das <quic_tdas@quicinc.com>,
	Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
	Imran Shaik <quic_imrashai@quicinc.com>,
	Ajit Pandey <quic_ajipan@quicinc.com>
Subject: Re: [PATCH V2 3/6] clk: qcom: clk-alpha-pll: Remove explicit CAL_L configuration for EVO PLL
Date: Fri, 26 May 2023 11:33:21 +0200	[thread overview]
Message-ID: <6e1d098d-03b9-aa63-a0bf-6cf748a0db0d@linaro.org> (raw)
In-Reply-To: <20230525172142.9039-4-quic_jkona@quicinc.com>



On 25.05.2023 19:21, Jagadeesh Kona wrote:
> In lucid evo pll, the CAL_L field is part of L value register itself, and
> the l value configuration passed from clock controller driver includes
> CAL_L and L values as well. Hence remove explicit configuration of CAL_L
> for evo pll.
> 
> Fixes: 260e36606a03 ("clk: qcom: clk-alpha-pll: add Lucid EVO PLL configuration interfaces")
> Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
> Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
> ---
Oh that isn't obvious at first sight, nice find!

I'd suggest a different solution though:

#define LUCID_EVO_PLL_L_LVAL	GENMASK(..
#define LUCID_EVO_PLL_L_CAL_L	GENMASK(..

lval = FIELD_PREP(LUCID_EVO_PLL_L_LVAL, config->l) |
       FIELD_PREP(LUCID_EVO_PLL_L_CAL_L, config->cal_l);

This would make the separation between the two parts more explicit

however

config->l would then represent the L value and not the end value
written to the L register

Up to you, whichever you find saner!

Konrad

> Changes since V1:
>  - Newly added.
> 
>  drivers/clk/qcom/clk-alpha-pll.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
> index f81c7c561352..68a80395997b 100644
> --- a/drivers/clk/qcom/clk-alpha-pll.c
> +++ b/drivers/clk/qcom/clk-alpha-pll.c
> @@ -270,7 +270,6 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);
>  #define LUCID_EVO_PCAL_NOT_DONE		BIT(8)
>  #define LUCID_EVO_ENABLE_VOTE_RUN       BIT(25)
>  #define LUCID_EVO_PLL_L_VAL_MASK        GENMASK(15, 0)
> -#define LUCID_EVO_PLL_CAL_L_VAL_SHIFT	16
>  
>  /* ZONDA PLL specific */
>  #define ZONDA_PLL_OUT_MASK	0xf
> @@ -2084,10 +2083,7 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_zonda_ops);
>  void clk_lucid_evo_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,
>  				 const struct alpha_pll_config *config)
>  {
> -	u32 lval = config->l;
> -
> -	lval |= TRION_PLL_CAL_VAL << LUCID_EVO_PLL_CAL_L_VAL_SHIFT;
> -	clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), lval);
> +	clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l);
>  	clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->alpha);
>  	clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->config_ctl_val);
>  	clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config->config_ctl_hi_val);

  reply	other threads:[~2023-05-26  9:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 17:21 [PATCH V2 0/6] Add camera clock controller support for SM8550 Jagadeesh Kona
2023-05-25 17:21 ` [PATCH V2 1/6] dt-bindings: clock: qcom: Add SM8550 camera clock controller Jagadeesh Kona
2023-05-26 12:29   ` Bryan O'Donoghue
2023-05-25 17:21 ` [PATCH V2 2/6] clk: qcom: Update l value configuration for lucid ole and evo plls Jagadeesh Kona
2023-05-26 13:22   ` Bryan O'Donoghue
2023-06-01 14:20     ` Jagadeesh Kona
2023-05-25 17:21 ` [PATCH V2 3/6] clk: qcom: clk-alpha-pll: Remove explicit CAL_L configuration for EVO PLL Jagadeesh Kona
2023-05-26  9:33   ` Konrad Dybcio [this message]
2023-05-26 15:53     ` Dmitry Baryshkov
2023-06-01 14:33       ` Jagadeesh Kona
2023-06-01 14:43         ` Dmitry Baryshkov
2023-06-09 11:50           ` Jagadeesh Kona
2023-06-09 12:25             ` Dmitry Baryshkov
2023-06-14 11:53               ` Jagadeesh Kona
2023-06-14 12:26                 ` Dmitry Baryshkov
2023-06-23 16:35                   ` Jagadeesh Kona
2023-05-26 15:54   ` Bryan O'Donoghue
2023-05-26 15:57     ` Bryan O'Donoghue
2023-06-01 14:21       ` Jagadeesh Kona
2023-05-25 17:21 ` [PATCH V2 4/6] clk: qcom: camcc-sm8550: Add camera clock controller driver for SM8550 Jagadeesh Kona
2023-05-26 19:54   ` Konrad Dybcio
2023-06-01 14:34     ` Jagadeesh Kona
2023-05-25 17:21 ` [PATCH V2 5/6] clk: qcom: camcc-sm8550: Add support for qdss, sleep and xo clocks Jagadeesh Kona
2023-05-25 17:21 ` [PATCH V2 6/6] arm64: dts: qcom: sm8550: Add camera clock controller Jagadeesh Kona

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=6e1d098d-03b9-aa63-a0bf-6cf748a0db0d@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=agross@kernel.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+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=vladimir.zapolskiy@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).