[PATCH 1/3] dt-bindings: regulator: Document Unisoc SC2730 PMIC bindings

Otto Pflüger posted 3 patches 1 month, 1 week ago
[PATCH 1/3] dt-bindings: regulator: Document Unisoc SC2730 PMIC bindings
Posted by Otto Pflüger 1 month, 1 week ago
Add bindings for the regulators found in the Spreadtrum/Unisoc SC2730
PMIC, used e.g. with the UMS512 and UMS9230 SoCs.

Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
---
 .../bindings/regulator/sprd,sc2730-regulator.yaml  | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml b/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml
new file mode 100644
index 000000000000..36f5f4d338bb
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/sprd,sc2730-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc SC2730 Power Management IC regulators
+
+maintainers:
+  - Otto Pflüger <otto.pflueger@abscue.de>
+
+properties:
+  compatible:
+    const: sprd,sc2730-regulator
+
+patternProperties:
+  "^DCDC_(CORE|CPU|GEN[0-1]|GPU|MEM|MEMQ|MODEM|SRAM)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+  "^LDO_AVDD(12|18)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+  "^LDO_VDD(18_DCXO|28)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+  "^LDO_VDD(EMMCCORE|KPLED|LDO[0-2]|SD(CORE|IO)|SIM[0-2]|USB33|WCN|WIFIPA)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+  "^LDO_VDDCAM(A0|A1|D0|D1|IO|MOT)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+  "^LDO_VDDRF(1V25|18)$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+
+additionalProperties: false
+...

-- 
2.51.0

Re: [PATCH 1/3] dt-bindings: regulator: Document Unisoc SC2730 PMIC bindings
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On Fri, Feb 20, 2026 at 06:01:49PM +0100, Otto Pflüger wrote:
> Add bindings for the regulators found in the Spreadtrum/Unisoc SC2730
> PMIC, used e.g. with the UMS512 and UMS9230 SoCs.
> 
> Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de>
> ---
>  .../bindings/regulator/sprd,sc2730-regulator.yaml  | 51 ++++++++++++++++++++++
>  1 file changed, 51 insertions(+)

So your second patch depends on it, but nothing in cover letter or this
patch changelog explain that making it extra difficult for maintainers.
You want them to guess the dependencies?

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

It is just "ADD"

> 
> diff --git a/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml b/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml
> new file mode 100644
> index 000000000000..36f5f4d338bb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/sprd,sc2730-regulator.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/sprd,sc2730-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Unisoc SC2730 Power Management IC regulators
> +
> +maintainers:
> +  - Otto Pflüger <otto.pflueger@abscue.de>
> +
> +properties:
> +  compatible:
> +    const: sprd,sc2730-regulator

Let's drop the compatible (which changes my comment on other patch as
you can put only $ref in oneOf).

> +
> +patternProperties:
> +  "^DCDC_(CORE|CPU|GEN[0-1]|GPU|MEM|MEMQ|MODEM|SRAM)$":

All names are lowercase without underscores. See DTS coding style.

Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: regulator: Document Unisoc SC2730 PMIC bindings
Posted by Otto Pflüger 1 month, 1 week ago
On Sat, Feb 21, 2026 at 11:52:55AM +0100, Krzysztof Kozlowski wrote:
> [...]
> > +properties:
> > +  compatible:
> > +    const: sprd,sc2730-regulator
> 
> Let's drop the compatible (which changes my comment on other patch as
> you can put only $ref in oneOf).

Sorry, I don't quite understand this part. It seems that you are
suggesting to change the top-level MFD bindings in the other patch to
look like this:

  regulators:
    type: object
    oneOf:
      - $ref: /schemas/regulator/sprd,sc2730-regulator.yaml#
      - $ref: /schemas/regulator/sprd,sc2731-regulator.yaml#

If that's the case, how should the regulator bindings for SC2730 be
distinguished from SC2731 without the compatible? Would it be fine to
keep the compatible here if I drop the additional if/then constraints in
the other patch?
Re: [PATCH 1/3] dt-bindings: regulator: Document Unisoc SC2730 PMIC bindings
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 21/02/2026 14:02, Otto Pflüger wrote:
> On Sat, Feb 21, 2026 at 11:52:55AM +0100, Krzysztof Kozlowski wrote:
>> [...]
>>> +properties:
>>> +  compatible:
>>> +    const: sprd,sc2730-regulator
>>
>> Let's drop the compatible (which changes my comment on other patch as
>> you can put only $ref in oneOf).
> 
> Sorry, I don't quite understand this part. It seems that you are
> suggesting to change the top-level MFD bindings in the other patch to
> look like this:
> 
>   regulators:
>     type: object
>     oneOf:
>       - $ref: /schemas/regulator/sprd,sc2730-regulator.yaml#
>       - $ref: /schemas/regulator/sprd,sc2731-regulator.yaml#

Yes

> 
> If that's the case, how should the regulator bindings for SC2730 be
> distinguished from SC2731 without the compatible? Would it be fine to

They don't have to be distinguished. The parent (so main node)
compatible defines everything.

> keep the compatible here if I drop the additional if/then constraints in
> the other patch?

But I also said that you can have if:then: defining the $ref... and then
you would notice that you actually need to split the binding.


Best regards,
Krzysztof