From: Stephen Boyd <sboyd@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Conor Dooley <conor+dt@kernel.org>,
Jie Luo <quic_luoj@quicinc.com>,
Konrad Dybcio <konradybcio@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Rob Herring <robh@kernel.org>, Will Deacon <will@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, quic_kkumarcs@quicinc.com,
quic_suruchia@quicinc.com, quic_pavir@quicinc.com,
quic_linchen@quicinc.com, quic_leiwei@quicinc.com,
bartosz.golaszewski@linaro.org, srinivas.kandagatla@linaro.org
Subject: Re: [PATCH v3 2/4] clk: qcom: Add CMN PLL clock controller driver for IPQ SoC
Date: Fri, 30 Aug 2024 15:24:19 -0700 [thread overview]
Message-ID: <04944b77ce6327ba5f4ec96348a9cda2.sboyd@kernel.org> (raw)
In-Reply-To: <7736d0d0-634d-403d-b70f-f33b7402456c@quicinc.com>
Quoting Jie Luo (2024-08-30 09:14:28)
> Hi Stephen,
> Please find below a minor update to my earlier message on clk_ops usage.
Ok. Next time you can trim the reply to save me time.
> On 8/28/2024 1:44 PM, Jie Luo wrote:
> > On 8/28/2024 7:50 AM, Stephen Boyd wrote:
> >> Quoting Luo Jie (2024-08-27 05:46:00)
> >>> + case 48000000:
> >>> + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 7);
> >>> + break;
> >>> + case 50000000:
> >>> + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 8);
> >>> + break;
> >>> + case 96000000:
> >>> + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 7);
> >>> + val &= ~CMN_PLL_REFCLK_DIV;
> >>> + val |= FIELD_PREP(CMN_PLL_REFCLK_DIV, 2);
> >>> + break;
> >>> + default:
> >>> + return -EINVAL;
> >>> + }
> >>
> >> Why isn't this done with struct clk_ops::set_rate() or clk_ops::init()?
> >
> > OK, I will move this code into the clk_ops::init().
>
> This code is expected to be executed once for initializing the CMN PLL
> to enable output clocks, and requires the parent clock rate to be
> available. However the parent clock rate is not available in the
> clk_ops::init(). Hence clk_ops::set_rate() seems to be the right option
> for this. Please let us know if this approach is fine. Thanks.
Sure. It actually sounds like the PLL has a mux to select different
reference clks. Is that right? If so, it seems like there should be
multiple 'clocks' for the DT property and many parents possible. If
that's the case then it should be possible to have something like
clocks = <0>, <&refclk>, <0>;
in the DT node and then have clk_set_rate() from the consumer actually
set the parent index in hardware. If that's all static then it can be
done with assigned-clock-parents or assigned-clock-rates.
next prev parent reply other threads:[~2024-08-30 22:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 12:45 [PATCH v3 0/4] Add CMN PLL clock controller driver for IPQ9574 Luo Jie
2024-08-27 12:45 ` [PATCH v3 1/4] dt-bindings: clock: qcom: Add CMN PLL clock controller for IPQ SoC Luo Jie
2024-08-27 12:46 ` [PATCH v3 2/4] clk: qcom: Add CMN PLL clock controller driver " Luo Jie
2024-08-27 23:50 ` Stephen Boyd
2024-08-28 5:44 ` Jie Luo
2024-08-30 16:14 ` Jie Luo
2024-08-30 22:24 ` Stephen Boyd [this message]
2024-09-02 15:33 ` Jie Luo
2024-09-02 18:39 ` Dmitry Baryshkov
2024-09-03 14:00 ` Jie Luo
2024-09-03 14:08 ` Dmitry Baryshkov
2024-09-03 21:36 ` Stephen Boyd
2024-09-05 15:32 ` Jie Luo
2024-08-27 12:46 ` [PATCH v3 3/4] arm64: defconfig: Enable Qualcomm IPQ CMN PLL clock controller Luo Jie
2024-08-27 12:46 ` [PATCH v3 4/4] arm64: dts: qcom: Add CMN PLL node for IPQ9574 SoC Luo Jie
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=04944b77ce6327ba5f4ec96348a9cda2.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.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_kkumarcs@quicinc.com \
--cc=quic_leiwei@quicinc.com \
--cc=quic_linchen@quicinc.com \
--cc=quic_luoj@quicinc.com \
--cc=quic_pavir@quicinc.com \
--cc=quic_suruchia@quicinc.com \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=will@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 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).