Re: [PATCH 2/3] dt-bindings: mfd: sprd,sc2731: Reference sprd,sc2730-regulator bindings

From: Krzysztof Kozlowski

Date: Sat Feb 21 2026 - 05:50:40 EST


On Fri, Feb 20, 2026 at 06:01:50PM +0100, Otto Pflüger wrote:
> The SC2730 PMIC provides a different set of regulators than SC2731 and
> thus requires separate regulator bindings. Determine which bindings to
> include based on the compatible string of the PMIC.
>
> Signed-off-by: Otto Pflüger <otto.pflueger@xxxxxxxxx>
> ---
> Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> index b023e1ef8d3c..e4ebb511bba1 100644
> --- a/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> +++ b/Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
> @@ -99,6 +99,19 @@ required:
> - '#interrupt-cells'
> - '#size-cells'
>
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + enum:
> + - sprd,sc2730
> + then:
> + properties:
> + regulators:
> + type: object
> + $ref: /schemas/regulator/sprd,sc2730-regulator.yaml#

This contradicts the top-level which says it is sc2731. It cannot be
both. You just need oneOf for $ref or compatible, in the top level place
for regulators and then just drop this. If you want additionally (!!!)
to put constraints what can be the child, it's fine, but just with
compatible if you have it and also what about all of other children?

... which will lead you to next problem - it's getting complicated, so
why not having it just separate schema?

Best regards,
Krzysztof