Re: [PATCH 1/2] dt-bindings: mfd: add support for P1 from SpacemiT

From: Krzysztof Kozlowski
Date: Mon Dec 30 2024 - 06:27:37 EST


On 30/12/2024 11:02, Troy Mitchell wrote:
> +
> +properties:
> + compatible:
> + const: spacemit,p1-pmic


spacemit,p1

Unless this can be something else?

> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + regulators:
> + type: object
> +
> + properties:
> + compatible:
> + const: pmic,p1-regulator

Drop compatible, regulators are not re-usable blocks.

> +
> + required:
> + - compatible
> +
> + patternProperties:
> + "^(dcdc-reg[1-6]|aldo-reg[1-4]|dldo-reg[1-7]|switch)$":

You can drop all "reg" suffixes.

> + type: object
> + $ref: /schemas/regulator/regulator.yaml#
> + unevaluatedProperties: false
> +
> + unevaluatedProperties: false
> +
> + pinctrl:

pinctrl or gpio?

> + type: object
> +
> + properties:
> + compatible:
> + const: pmic,p1-pinctrl
> +
> + "#gpio-cells":
> + const: 2
> +
> + gpio-controller: true
> +
> + required:
> + - compatible
> + - "#gpio-cells"
> + - gpio-controller
> +
> + unevaluatedProperties: false

No $ref? Then additionalProperties and put it after type: ... but if you
do not have here pinctrl, then just fold the node into parent.


> +
> + pwrkey:
> + type: object
> + $ref: /schemas/input/input.yaml#
> +
> + properties:
> + compatible:
> + const: pmic,p1-pwrkey
> +
> + required:
> + - compatible


No resources here, fold the device into parent.


> +
> + unevaluatedProperties: false
> +
> + rtc:
> + type: object
> + $ref: /schemas/rtc/rtc.yaml#


No resources here, fold the device into parent.

> +
> + properties:
> + compatible:
> + const: pmic,p1-rtc
> +
> + required:
> + - compatible
> +
> + unevaluatedProperties: false
> +
> +

Only one blank line

> +required:
> + - compatible
> + - reg
> + - interrupts
> +
> +unevaluatedProperties: false


example-schema explains when to use unevaluated/additionalProps.


Best regards,
Krzysztof