From: Jie Luo <jie.luo@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney@redhat.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
quic_kkumarcs@quicinc.com, quic_linchen@quicinc.com,
quic_leiwei@quicinc.com, quic_suruchia@quicinc.com
Subject: Re: [PATCH 04/12] clk: qcom: ipq-cmn-pll: Add NSS clock support
Date: Wed, 29 Jul 2026 21:15:42 +0800 [thread overview]
Message-ID: <a9439f32-ee36-4c66-b96e-082b40e9b9c7@oss.qualcomm.com> (raw)
In-Reply-To: <a907cba4-c276-4355-986c-44f6e39c310a@oss.qualcomm.com>
On 7/28/2026 5:29 PM, Konrad Dybcio wrote:
> On 7/24/26 5:00 PM, Luo Jie wrote:
>> The NSS (network subsystem) clock is derived from the CMN PLL output
>> divided by 2 and then further divided by a configurable 6-bit divider
>> with a valid range of 8-63.
>>
>> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
>> ---
>
> This looks very similar to clk-regmap-divider.c (or at least to
> the generic clk-divider.c implementation).
>
You're right — this can be converted to use clk_regmap_div_ops directly.
The NSS and PPE clocks both compute rate = parent_rate / (2 * div),
where div is read/written straight from a register field with no other
transform. The only thing blocking reuse of clk_regmap_div_ops is that
implicit 2 *, which none of the existing CLK_DIVIDER_* flags express.
I'll add a new flag CLK_DIVIDER_EVEN_INTEGERS_NO_OFFSET, to clk-
divider.c/clk-provider.h to express that relationship, pass a flags
field through struct clk_regmap_div (clk-regmap-divider.c/.h) so qcom
clock drivers can opt into it, and register both NSS and PPE as plain
clk_regmap_div instances with .ops = &clk_regmap_div_ops instead of
hand-rolling recalc_rate/set_rate.
> [...]
>
>> /* Register the fixed rate output clocks. */
>> for (i = 0; i < num_clks; i++) {
>> - struct clk_parent_data pdata = { .hw = cmn_pll_hw };
>> + if (fixed_clk[i].rate) {
>> + struct clk_parent_data pdata = { .hw = cmn_pll_hw };
>> +
>> + hw = devm_clk_hw_register_fixed_rate_parent_data(dev,
>> + fixed_clk[i].name,
>> + &pdata, 0,
>> + fixed_clk[i].rate);
>> + } else if (!strcmp(fixed_clk[i].name, "nss")) {
>> + hw = ipq_cmn_pll_nss_register(pdev, cmn_pll->regmap,
>> + cmn_pll_hw);
>
> Huge "no", this must be a compile-time constant and not rely on
> some funky detection.
>
> Konrad
Thanks. Will replace the rate/enable_bit/strcmp(name, ...) runtime
inference with an explicit enum cmn_pll_clk_type field, set directly by
each entry's construction macro (CLK_PLL_OUTPUT/CLK_PLL_GATE/
CLK_PLL_NSS/CLK_PLL_PPE/CLK_PLL_PON/CLK_PLL_EPHY_RAW), and dispatch via
switch in ipq_cmn_pll_register_clks().
next prev parent reply other threads:[~2026-07-29 13:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 15:00 [PATCH 00/12] clk: qcom: ipq-cmn-pll: Add IPQ5210 CMN PLL support Luo Jie
2026-07-24 15:00 ` [PATCH 01/12] clk: qcom: ipq-cmn-pll: Use devm_clk_hw_register_fixed_rate_parent_data Luo Jie
2026-07-24 15:50 ` Konrad Dybcio
2026-07-24 15:00 ` [PATCH 02/12] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5210 SoC Luo Jie
2026-07-24 15:00 ` [PATCH 03/12] clk: qcom: ipq-cmn-pll: Add analog soft-reset helper Luo Jie
2026-07-24 15:00 ` [PATCH 04/12] clk: qcom: ipq-cmn-pll: Add NSS clock support Luo Jie
2026-07-28 9:29 ` Konrad Dybcio
2026-07-29 13:15 ` Jie Luo [this message]
2026-07-24 15:00 ` [PATCH 05/12] clk: qcom: ipq-cmn-pll: Add PPE " Luo Jie
2026-07-24 15:00 ` [PATCH 06/12] clk: qcom: ipq-cmn-pll: Add PON reference " Luo Jie
2026-07-24 15:00 ` [PATCH 07/12] clk: qcom: ipq-cmn-pll: Add EPHY-RAW " Luo Jie
2026-07-24 15:00 ` [PATCH 08/12] clk: composite: Export devm_clk_hw_register_composite_pdata Luo Jie
2026-07-24 16:01 ` Brian Masney
2026-07-28 2:20 ` Jie Luo
2026-07-24 15:00 ` [PATCH 09/12] clk: qcom: ipq-cmn-pll: Add clock gate support for fixed clocks Luo Jie
2026-07-28 9:32 ` Konrad Dybcio
2026-07-29 13:18 ` Jie Luo
2026-07-24 15:00 ` [PATCH 10/12] clk: qcom: ipq-cmn-pll: Add all output clocks for IPQ5210 Luo Jie
2026-07-24 15:00 ` [PATCH 11/12] arm64: dts: qcom: ipq5210: Add CMN PLL device node Luo Jie
2026-07-24 15:00 ` [PATCH 12/12] arm64: dts: qcom: Update IPQ5210 xo_board to use fixed factor clock 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=a9439f32-ee36-4c66-b96e-082b40e9b9c7@oss.qualcomm.com \
--to=jie.luo@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bmasney@redhat.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.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_suruchia@quicinc.com \
--cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®