Devicetree
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Qiang Yu <qiang.yu@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>,
	Taniya Das <taniya.das@oss.qualcomm.com>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	krishna.chundru@oss.qualcomm.com
Subject: Re: [PATCH v7 3/7] clk: qcom: Add generic clkref_en support
Date: Mon, 6 Jul 2026 14:24:02 +0200	[thread overview]
Message-ID: <e187bb2d-9496-4683-8eac-17a94941c952@oss.qualcomm.com> (raw)
In-Reply-To: <20260702-tcsr_qref_0702-v7-3-776f2811b7af@oss.qualcomm.com>

On 7/2/26 9:36 AM, Qiang Yu wrote:
> Before XO refclk is distributed to PCIe/USB/eDP PHYs, it passes through
> a QREF block. QREF is powered by dedicated LDO rails, and the clkref_en
> register controls whether refclk is gated through to the PHY side.
> 
> These clkref controls are different from typical GCC branch clocks:
> - only a single enable bit is present, without branch-style config bits
> - regulators must be voted before enable and unvoted after disable
> 
> Model this as a dedicated clk_ref clock type with custom clk_ops instead
> of reusing struct clk_branch semantics.
> 
> Also provide a common registration/probe API so the same clkref model
> can be reused regardless of where clkref_en registers are placed, e.g.
> TCSR on glymur and TLMM on SM8750.
> 
> Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com>
> ---

[...]

> +struct qcom_clk_ref_provider {
> +	struct qcom_clk_ref *refs;
> +	size_t num_refs;
> +};

If you define num_refs first, then you can have refs be a
zero-length array with __counted_by(num_refs) and make provider
a single allocation, like:

512946cf0f32 ("nvmem: rockchip-otp: alloc clks with main struct")

otherwise someone will come around and "fix" it in a day or two

otherwise

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
 
Konrad

  reply	other threads:[~2026-07-06 12:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  7:36 [PATCH v7 0/7] clk: qcom: Add common clkref support and migrate Glymur and Mahua Qiang Yu
2026-07-02  7:36 ` [PATCH v7 1/7] dt-bindings: clock: qcom: Move glymur TCSR to own binding Qiang Yu
2026-07-02  7:46   ` sashiko-bot
2026-07-03  5:58   ` Krzysztof Kozlowski
2026-07-03 12:16     ` Qiang Yu
2026-07-03 14:50       ` Krzysztof Kozlowski
2026-07-06  3:20         ` Qiang Yu
2026-07-02  7:36 ` [PATCH v7 2/7] dt-bindings: clock: qcom,glymur-tcsr: Add mahua support Qiang Yu
2026-07-02  7:36 ` [PATCH v7 3/7] clk: qcom: Add generic clkref_en support Qiang Yu
2026-07-06 12:24   ` Konrad Dybcio [this message]
2026-07-06 13:25     ` Qiang Yu
2026-07-02  7:36 ` [PATCH v7 4/7] clk: qcom: tcsrcc-glymur: Add regulator supplies and migrate to clk_ref helper Qiang Yu
2026-07-02  7:36 ` [PATCH v7 5/7] clk: qcom: tcsrcc-glymur: Add Mahua QREF regulator support Qiang Yu
2026-07-06 12:47   ` Konrad Dybcio
2026-07-06 13:28     ` Qiang Yu
2026-07-02  7:36 ` [PATCH v7 6/7] arm64: dts: qcom: glymur: Add QREF regulator supplies to TCSR Qiang Yu
2026-07-02  7:36 ` [PATCH v7 7/7] arm64: dts: qcom: mahua: " Qiang Yu
2026-07-06 12:50   ` Konrad Dybcio

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=e187bb2d-9496-4683-8eac-17a94941c952@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=bmasney@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krishna.chundru@oss.qualcomm.com \
    --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=qiang.yu@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=taniya.das@oss.qualcomm.com \
    /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