Message ID | 20241230-k1-p1-v1-1-aa4e02b9f993@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Add support for the P1 PMIC from SpacemiT | expand |
On Mon, 30 Dec 2024 18:02:05 +0800, Troy Mitchell wrote: > P1 PMIC contains of regulator, pinctrl, pwrkey and rtc. > > P1 contains a load switch, which allows you to control > whether a device is powered on (such as a MIPI screen) > > Signed-off-by: Troy Mitchell <TroyMitchell988@gmail.com> > --- > .../devicetree/bindings/mfd/spacemit,p1.yaml | 153 +++++++++++++++++++++ > 1 file changed, 153 insertions(+) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: Documentation/devicetree/bindings/mfd/spacemit,p1.example.dtb: /example-0/i2c/pmic@41: failed to match any schema with compatible: ['spacemit,p1'] doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241230-k1-p1-v1-1-aa4e02b9f993@gmail.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
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
diff --git a/Documentation/devicetree/bindings/mfd/spacemit,p1.yaml b/Documentation/devicetree/bindings/mfd/spacemit,p1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7475d403aeb3d0e72ffa9b6fbcbb6545d5bc429f --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/spacemit,p1.yaml @@ -0,0 +1,153 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/spacemit,p1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: P1 Power Management Integrated Circuit + +maintainers: + - Troy Mitchell <troymitchell988@gmail.com> + +description: + PMIC chip P1 produced by SpacemiT. The device consists of I2C controlled MFD, + which contains regulator, pinctrl, pwrkey and rtc. + +properties: + compatible: + const: spacemit,p1-pmic + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + regulators: + type: object + + properties: + compatible: + const: pmic,p1-regulator + + required: + - compatible + + patternProperties: + "^(dcdc-reg[1-6]|aldo-reg[1-4]|dldo-reg[1-7]|switch)$": + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + + unevaluatedProperties: false + + pinctrl: + type: object + + properties: + compatible: + const: pmic,p1-pinctrl + + "#gpio-cells": + const: 2 + + gpio-controller: true + + required: + - compatible + - "#gpio-cells" + - gpio-controller + + unevaluatedProperties: false + + pwrkey: + type: object + $ref: /schemas/input/input.yaml# + + properties: + compatible: + const: pmic,p1-pwrkey + + required: + - compatible + + unevaluatedProperties: false + + rtc: + type: object + $ref: /schemas/rtc/rtc.yaml# + + properties: + compatible: + const: pmic,p1-rtc + + required: + - compatible + + unevaluatedProperties: false + + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pmic@41 { + compatible = "spacemit,p1"; + reg = <0x41>; + interrupt-parent = <&intc>; + interrupts = <64>; + + regulators { + compatible = "pmic,p1-regulator"; + + dcdc-reg1 { + regulator-name = "dcdc1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3450000>; + regulator-ramp-delay = <5000>; + regulator-always-on; + }; + + aldo-reg1 { + regulator-name = "aldo1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-boot-on; + }; + + dldo-reg1 { + regulator-name = "dldo1"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <3400000>; + regulator-boot-on; + }; + + switch { + regulator-name = "switch"; + }; + }; + + pinctrl { + compatible = "pmic,p1-pinctrl"; + gpio-controller; + #gpio-cells = <2>; + }; + + pwrkey { + compatible = "pmic,p1-pwrkey"; + }; + + rtc { + compatible = "pmic,p1-rtc"; + }; + }; + };
P1 PMIC contains of regulator, pinctrl, pwrkey and rtc. P1 contains a load switch, which allows you to control whether a device is powered on (such as a MIPI screen) Signed-off-by: Troy Mitchell <TroyMitchell988@gmail.com> --- .../devicetree/bindings/mfd/spacemit,p1.yaml | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+)