devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] regulator: dt-bindings: qcom,rpmh: Indicate regulator-allow-set-load dependencies
@ 2022-09-07 20:49 Andrew Halaney
  2022-09-08 10:25 ` Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Andrew Halaney @ 2022-09-07 20:49 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, lgirdwood, broonie, robh+dt,
	krzysztof.kozlowski+dt
  Cc: linux-arm-msm, linux-kernel, devicetree, dianders, johan,
	Andrew Halaney, Johan Hovold

For RPMH regulators it doesn't make sense to indicate
regulator-allow-set-load without saying what modes you can switch to,
so be sure to indicate a dependency on regulator-allowed-modes.

In general this is true for any regulators that are setting modes
instead of setting a load directly, for example RPMH regulators. A
counter example would be RPM based regulators, which set a load
change directly instead of a mode change. In the RPM case
regulator-allow-set-load alone is sufficient to describe the regulator
(the regulator can change its output current, here's the new load),
but in the RPMH case what valid operating modes exist must also be
stated to properly describe the regulator (the new load is this, what
is the optimum mode for this regulator with that load, let's change to
that mode now).

With this in place devicetree validation can catch issues like this:

    /mnt/extrassd/git/linux-next/arch/arm64/boot/dts/qcom/sm8350-hdk.dtb: pm8350-rpmh-regulators: ldo5: 'regulator-allowed-modes' is a dependency of 'regulator-allow-set-load'
            From schema: /mnt/extrassd/git/linux-next/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml

Where the RPMH regulator hardware is described as being settable, but
there are no modes described to set it to!

Suggested-by: Johan Hovold <johan+kernel@kernel.org>
Reviewed-by: Johan Hovold <johan+kernel@kernel.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---

v2: https://lore.kernel.org/linux-arm-msm/20220906201959.69920-1-ahalaney@redhat.com/
Changes since v2:
  - Updated commit message to explain how this is a property of the
    hardware, and why it only applies to certain regulators like RPMH
    (Johan + Krzysztof recommendation)
  - Added Johan + Douglas' R-B tags

v1: https://lore.kernel.org/linux-arm-msm/20220902185148.635292-1-ahalaney@redhat.com/
Changes since v1:
  - Dropped first two patches in the series as they were user error
    (thanks Krzysztof for highlighting this!)
  - No change in the remaining patch

 .../devicetree/bindings/regulator/qcom,rpmh-regulator.yaml    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml
index 9a36bee750af..92ff4d59ba20 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml
@@ -99,12 +99,16 @@ properties:
     type: object
     $ref: "regulator.yaml#"
     description: BOB regulator node.
+    dependencies:
+      regulator-allow-set-load: ["regulator-allowed-modes"]
 
 patternProperties:
   "^(smps|ldo|lvs)[0-9]+$":
     type: object
     $ref: "regulator.yaml#"
     description: smps/ldo regulator nodes(s).
+    dependencies:
+      regulator-allow-set-load: ["regulator-allowed-modes"]
 
 required:
   - compatible
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-12-28 11:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 20:49 [PATCH v3] regulator: dt-bindings: qcom,rpmh: Indicate regulator-allow-set-load dependencies Andrew Halaney
2022-09-08 10:25 ` Krzysztof Kozlowski
2022-09-08 14:23   ` Doug Anderson
2022-09-08 14:29     ` Krzysztof Kozlowski
2022-09-08 14:38       ` Doug Anderson
2022-09-08 14:49         ` Krzysztof Kozlowski
2022-09-08 14:38       ` Mark Brown
2022-09-08 14:48         ` Krzysztof Kozlowski
2022-09-08 14:50   ` Andrew Halaney
2022-09-08 14:53     ` Andrew Halaney
2022-09-08 15:50 ` Mark Brown
2022-12-28 10:37 ` Krzysztof Kozlowski
2022-12-28 10:58   ` Johan Hovold
2022-12-28 11:11     ` Krzysztof Kozlowski

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).