2022-06-26 19:35:13

by David Heidelberg

[permalink] [raw]
Subject: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

Convert Qualcomm SPMI PMIC binding to yaml format.

Additional changes:
- filled many missing compatibles

Co-developed-by: Caleb Connolly <[email protected]>
Signed-off-by: David Heidelberg <[email protected]>
---
v3:
- added subnodes, there are two not converted to YAML yet, but it works
- now it prints milion directly unrelated warning to this binding
(it's related to the included subnodes bindings, can be merged,
but it'll generate more warnings and preferably anyone can takeover
from here)
- add qcom,pmx65

v2:
- changed author to myself, kept Caleb as co-author
- moved nodename to properties
- add nodenames for pm* with deprecated property
- add ^$ to pattern properties
- dropped interrupt-names property
- added reg prop. to the nodes which have register in nodename
- added compatible pmx55
Signed-off-by: David Heidelberg <[email protected]>
---
.../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
.../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
2 files changed, 191 insertions(+), 94 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml

diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
deleted file mode 100644
index eb78e3ae7703..000000000000
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
+++ /dev/null
@@ -1,94 +0,0 @@
- Qualcomm SPMI PMICs multi-function device bindings
-
-The Qualcomm SPMI series presently includes PM8941, PM8841 and PMA8084
-PMICs. These PMICs use a QPNP scheme through SPMI interface.
-QPNP is effectively a partitioning scheme for dividing the SPMI extended
-register space up into logical pieces, and set of fixed register
-locations/definitions within these regions, with some of these regions
-specifically used for interrupt handling.
-
-The QPNP PMICs are used with the Qualcomm Snapdragon series SoCs, and are
-interfaced to the chip via the SPMI (System Power Management Interface) bus.
-Support for multiple independent functions are implemented by splitting the
-16-bit SPMI slave address space into 256 smaller fixed-size regions, 256 bytes
-each. A function can consume one or more of these fixed-size register regions.
-
-Required properties:
-- compatible: Should contain one of:
- "qcom,pm660",
- "qcom,pm660l",
- "qcom,pm7325",
- "qcom,pm8004",
- "qcom,pm8005",
- "qcom,pm8019",
- "qcom,pm8028",
- "qcom,pm8110",
- "qcom,pm8150",
- "qcom,pm8150b",
- "qcom,pm8150c",
- "qcom,pm8150l",
- "qcom,pm8226",
- "qcom,pm8350c",
- "qcom,pm8841",
- "qcom,pm8901",
- "qcom,pm8909",
- "qcom,pm8916",
- "qcom,pm8941",
- "qcom,pm8950",
- "qcom,pm8953",
- "qcom,pm8994",
- "qcom,pm8998",
- "qcom,pma8084",
- "qcom,pmd9635",
- "qcom,pmi8950",
- "qcom,pmi8962",
- "qcom,pmi8994",
- "qcom,pmi8998",
- "qcom,pmk8002",
- "qcom,pmk8350",
- "qcom,pmr735a",
- "qcom,smb2351",
- or generalized "qcom,spmi-pmic".
-- reg: Specifies the SPMI USID slave address for this device.
- For more information see:
- Documentation/devicetree/bindings/spmi/spmi.yaml
-
-Required properties for peripheral child nodes:
-- compatible: Should contain "qcom,xxx", where "xxx" is a peripheral name.
-
-Optional properties for peripheral child nodes:
-- interrupts: Interrupts are specified as a 4-tuple. For more information
- see:
- Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml
-- interrupt-names: Corresponding interrupt name to the interrupts property
-
-Each child node of SPMI slave id represents a function of the PMIC. In the
-example below the rtc device node represents a peripheral of pm8941
-SID = 0. The regulator device node represents a peripheral of pm8941 SID = 1.
-
-Example:
-
- spmi {
- compatible = "qcom,spmi-pmic-arb";
-
- pm8941@0 {
- compatible = "qcom,pm8941", "qcom,spmi-pmic";
- reg = <0x0 SPMI_USID>;
-
- rtc {
- compatible = "qcom,rtc";
- interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
- interrupt-names = "alarm";
- };
- };
-
- pm8941@1 {
- compatible = "qcom,pm8941", "qcom,spmi-pmic";
- reg = <0x1 SPMI_USID>;
-
- regulator {
- compatible = "qcom,regulator";
- regulator-name = "8941_boost";
- };
- };
- };
diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
new file mode 100644
index 000000000000..32daebc3a0bc
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -0,0 +1,191 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SPMI PMICs multi-function device
+
+description: |
+ Some Qualcomm PMICs used with the Snapdragon series SoCs are interfaced
+ to the chip via the SPMI (System Power Management Interface) bus.
+ Support for multiple independent functions are implemented by splitting the
+ 16-bit SPMI peripheral address space into 256 smaller fixed-size regions, 256 bytes
+ each. A function can consume one or more of these fixed-size register regions.
+
+ The Qualcomm SPMI series includes the PM8941, PM8841, PMA8084, PM8998 and other
+ PMICs. These PMICs use a "QPNP" scheme through SPMI interface.
+ QPNP is effectively a partitioning scheme for dividing the SPMI extended
+ register space up into logical pieces, and set of fixed register
+ locations/definitions within these regions, with some of these regions
+ specifically used for interrupt handling.
+
+maintainers:
+ - Stephen Boyd <[email protected]>
+
+properties:
+ $nodename:
+ oneOf:
+ - pattern: '^pmic@.*$'
+ - pattern: '^pm(a|s)?[0-9]*@.*$'
+ deprecated: true
+
+ compatible:
+ items:
+ - enum:
+ - qcom,pm660
+ - qcom,pm660l
+ - qcom,pm6150
+ - qcom,pm6150l
+ - qcom,pm6350
+ - qcom,pm7325
+ - qcom,pm8004
+ - qcom,pm8005
+ - qcom,pm8009
+ - qcom,pm8019
+ - qcom,pm8110
+ - qcom,pm8150
+ - qcom,pm8150b
+ - qcom,pm8150l
+ - qcom,pm8226
+ - qcom,pm8350
+ - qcom,pm8350b
+ - qcom,pm8350c
+ - qcom,pm8841
+ - qcom,pm8909
+ - qcom,pm8916
+ - qcom,pm8941
+ - qcom,pm8950
+ - qcom,pm8994
+ - qcom,pm8998
+ - qcom,pma8084
+ - qcom,pmd9635
+ - qcom,pmi8950
+ - qcom,pmi8962
+ - qcom,pmi8994
+ - qcom,pmi8998
+ - qcom,pmk8350
+ - qcom,pmm8155au
+ - qcom,pmr735a
+ - qcom,pmr735b
+ - qcom,pms405
+ - qcom,pmx55
+ - qcom,pmx65
+ - qcom,smb2351
+ - const: qcom,spmi-pmic
+
+ reg:
+ minItems: 1
+ maxItems: 2
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ labibb:
+ type: object
+ $ref: /schemas/regulator/qcom-labibb-regulator.yaml#
+
+ regulators:
+ type: object
+ $ref: /schemas/regulator/regulator.yaml#
+
+patternProperties:
+ "^adc@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
+
+ "^adc-tm@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#
+
+ "^audio-codec@[0-9a-f]+$":
+ type: object
+ additionalProperties: true # FIXME qcom,pm8916-wcd-analog-codec binding not converted yet
+
+ "extcon@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
+
+ "gpio(s)?@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
+
+ "pon@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/power/reset/qcom,pon.yaml#
+
+ "pwm@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/leds/leds-qcom-lpg.yaml#
+
+ "^rtc@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
+
+ "^temp-alarm@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
+
+ "^vibrator@[0-9a-f]+$":
+ type: object
+ additionalProperties: true # FIXME qcom,pm8916-vib binding not converted yet
+
+ "^mpps@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#
+
+ "(.*)?(wled|leds)@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/leds/backlight/qcom-wled.yaml#
+ unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/spmi/spmi.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ spmi@c440000 {
+ compatible = "qcom,spmi-pmic-arb";
+ reg = <0x0c440000 0x1100>,
+ <0x0c600000 0x2000000>,
+ <0x0e600000 0x100000>,
+ <0x0e700000 0xa0000>,
+ <0x0c40a000 0x26000>;
+ reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
+ interrupt-names = "periph_irq";
+ interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
+ qcom,ee = <0>;
+ qcom,channel = <0>;
+ #address-cells = <2>;
+ #size-cells = <0>;
+ interrupt-controller;
+ #interrupt-cells = <4>;
+ cell-index = <0>;
+
+ pmi8998_lsid0: pmic@2 {
+ compatible = "qcom,pmi8998", "qcom,spmi-pmic";
+ reg = <0x2 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmi8998_gpio: gpios@c000 {
+ compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
+ reg = <0xc000>;
+ gpio-controller;
+ gpio-ranges = <&pmi8998_gpio 0 0 14>;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+ };
+ };
--
2.35.1


2022-06-27 13:45:03

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> Convert Qualcomm SPMI PMIC binding to yaml format.
>
> Additional changes:
> - filled many missing compatibles
>
> Co-developed-by: Caleb Connolly <[email protected]>
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> v3:
> - added subnodes, there are two not converted to YAML yet, but it works
> - now it prints milion directly unrelated warning to this binding
> (it's related to the included subnodes bindings, can be merged,
> but it'll generate more warnings and preferably anyone can takeover
> from here)
> - add qcom,pmx65
>
> v2:
> - changed author to myself, kept Caleb as co-author
> - moved nodename to properties
> - add nodenames for pm* with deprecated property
> - add ^$ to pattern properties
> - dropped interrupt-names property
> - added reg prop. to the nodes which have register in nodename
> - added compatible pmx55
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> 2 files changed, 191 insertions(+), 94 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/thermal/qcom,spmi-temp-alarm.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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.

2022-07-14 18:56:09

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Sun, Jun 26, 2022 at 1:16 PM David Heidelberg <[email protected]> wrote:
>
> Convert Qualcomm SPMI PMIC binding to yaml format.
>
> Additional changes:
> - filled many missing compatibles
>
> Co-developed-by: Caleb Connolly <[email protected]>
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> v3:
> - added subnodes, there are two not converted to YAML yet, but it works
> - now it prints milion directly unrelated warning to this binding
> (it's related to the included subnodes bindings, can be merged,
> but it'll generate more warnings and preferably anyone can takeover
> from here)
> - add qcom,pmx65
>
> v2:
> - changed author to myself, kept Caleb as co-author
> - moved nodename to properties
> - add nodenames for pm* with deprecated property
> - add ^$ to pattern properties
> - dropped interrupt-names property
> - added reg prop. to the nodes which have register in nodename
> - added compatible pmx55
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> 2 files changed, 191 insertions(+), 94 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml

Looks like the referenced file is in linux-next, so:

Reviewed-by: Rob Herring <[email protected]>

This should fix a lot of undocumented compatible warnings.

Rob

2022-08-10 00:22:28

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> Convert Qualcomm SPMI PMIC binding to yaml format.
>
> Additional changes:
> - filled many missing compatibles
>
> Co-developed-by: Caleb Connolly <[email protected]>
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> v3:
> - added subnodes, there are two not converted to YAML yet, but it works
> - now it prints milion directly unrelated warning to this binding
> (it's related to the included subnodes bindings, can be merged,
> but it'll generate more warnings and preferably anyone can takeover
> from here)
> - add qcom,pmx65
>
> v2:
> - changed author to myself, kept Caleb as co-author
> - moved nodename to properties
> - add nodenames for pm* with deprecated property
> - add ^$ to pattern properties
> - dropped interrupt-names property
> - added reg prop. to the nodes which have register in nodename
> - added compatible pmx55
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> 2 files changed, 191 insertions(+), 94 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
>

As this hasn't been picked up, I applied it. Thanks!

2022-08-10 11:12:36

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Tue, 09 Aug 2022, Rob Herring wrote:

> On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> > Convert Qualcomm SPMI PMIC binding to yaml format.
> >
> > Additional changes:
> > - filled many missing compatibles
> >
> > Co-developed-by: Caleb Connolly <[email protected]>
> > Signed-off-by: David Heidelberg <[email protected]>
> > ---
> > v3:
> > - added subnodes, there are two not converted to YAML yet, but it works
> > - now it prints milion directly unrelated warning to this binding
> > (it's related to the included subnodes bindings, can be merged,
> > but it'll generate more warnings and preferably anyone can takeover
> > from here)
> > - add qcom,pmx65
> >
> > v2:
> > - changed author to myself, kept Caleb as co-author
> > - moved nodename to properties
> > - add nodenames for pm* with deprecated property
> > - add ^$ to pattern properties
> > - dropped interrupt-names property
> > - added reg prop. to the nodes which have register in nodename
> > - added compatible pmx55
> > Signed-off-by: David Heidelberg <[email protected]>
> > ---
> > .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> > .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> > 2 files changed, 191 insertions(+), 94 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> > create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> >
>
> As this hasn't been picked up, I applied it. Thanks!

I'd prefer to take it via MFD if it's all the same to you.

In case there are additional fix-ups required during the next cycle.

--
DEPRECATED: Please use [email protected]

2022-08-10 12:14:00

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Wed, 10 Aug 2022, David Heidelberg wrote:

> On 10/08/2022 12:57, Lee Jones wrote:
> > On Tue, 09 Aug 2022, Rob Herring wrote:
> >
> > > On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> > > > Convert Qualcomm SPMI PMIC binding to yaml format.
> > > >
> > > > Additional changes:
> > > > - filled many missing compatibles
> > > >
> > > > Co-developed-by: Caleb Connolly <[email protected]>
> > > > Signed-off-by: David Heidelberg <[email protected]>
> > > > ---
> > > > v3:
> > > > - added subnodes, there are two not converted to YAML yet, but it works
> > > > - now it prints milion directly unrelated warning to this binding
> > > > (it's related to the included subnodes bindings, can be merged,
> > > > but it'll generate more warnings and preferably anyone can takeover
> > > > from here)
> > > > - add qcom,pmx65
> > > >
> > > > v2:
> > > > - changed author to myself, kept Caleb as co-author
> > > > - moved nodename to properties
> > > > - add nodenames for pm* with deprecated property
> > > > - add ^$ to pattern properties
> > > > - dropped interrupt-names property
> > > > - added reg prop. to the nodes which have register in nodename
> > > > - added compatible pmx55
> > > > Signed-off-by: David Heidelberg <[email protected]>
> > > > ---
> > > > .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> > > > .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> > > > 2 files changed, 191 insertions(+), 94 deletions(-)
> > > > delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> > > > create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> > > >
> > > As this hasn't been picked up, I applied it. Thanks!
> > I'd prefer to take it via MFD if it's all the same to you.
> >
> > In case there are additional fix-ups required during the next cycle.
>
> I can rebase it against MFD if it's more convenient.

*Shouldn't* be required. I suspect it'll just apply.

--
DEPRECATED: Please use [email protected]

2022-08-10 12:14:52

by David Heidelberg

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On 10/08/2022 12:57, Lee Jones wrote:
> On Tue, 09 Aug 2022, Rob Herring wrote:
>
>> On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
>>> Convert Qualcomm SPMI PMIC binding to yaml format.
>>>
>>> Additional changes:
>>> - filled many missing compatibles
>>>
>>> Co-developed-by: Caleb Connolly <[email protected]>
>>> Signed-off-by: David Heidelberg <[email protected]>
>>> ---
>>> v3:
>>> - added subnodes, there are two not converted to YAML yet, but it works
>>> - now it prints milion directly unrelated warning to this binding
>>> (it's related to the included subnodes bindings, can be merged,
>>> but it'll generate more warnings and preferably anyone can takeover
>>> from here)
>>> - add qcom,pmx65
>>>
>>> v2:
>>> - changed author to myself, kept Caleb as co-author
>>> - moved nodename to properties
>>> - add nodenames for pm* with deprecated property
>>> - add ^$ to pattern properties
>>> - dropped interrupt-names property
>>> - added reg prop. to the nodes which have register in nodename
>>> - added compatible pmx55
>>> Signed-off-by: David Heidelberg <[email protected]>
>>> ---
>>> .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
>>> .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
>>> 2 files changed, 191 insertions(+), 94 deletions(-)
>>> delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
>>> create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
>>>
>> As this hasn't been picked up, I applied it. Thanks!
> I'd prefer to take it via MFD if it's all the same to you.
>
> In case there are additional fix-ups required during the next cycle.

I can rebase it against MFD if it's more convenient.


David

>
--
David Heidelberg
Consultant Software Engineer

Matrix: @okias:matrix.org

2022-08-10 14:20:32

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Sun, 26 Jun 2022, David Heidelberg wrote:

> Convert Qualcomm SPMI PMIC binding to yaml format.
>
> Additional changes:
> - filled many missing compatibles
>
> Co-developed-by: Caleb Connolly <[email protected]>
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> v3:
> - added subnodes, there are two not converted to YAML yet, but it works
> - now it prints milion directly unrelated warning to this binding
> (it's related to the included subnodes bindings, can be merged,
> but it'll generate more warnings and preferably anyone can takeover
> from here)
> - add qcom,pmx65
>
> v2:
> - changed author to myself, kept Caleb as co-author
> - moved nodename to properties
> - add nodenames for pm* with deprecated property
> - add ^$ to pattern properties
> - dropped interrupt-names property
> - added reg prop. to the nodes which have register in nodename
> - added compatible pmx55
> Signed-off-by: David Heidelberg <[email protected]>
> ---
> .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> 2 files changed, 191 insertions(+), 94 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
>
> diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> deleted file mode 100644
> index eb78e3ae7703..000000000000
> --- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> +++ /dev/null
> @@ -1,94 +0,0 @@
> - Qualcomm SPMI PMICs multi-function device bindings
> -
> -The Qualcomm SPMI series presently includes PM8941, PM8841 and PMA8084
> -PMICs. These PMICs use a QPNP scheme through SPMI interface.
> -QPNP is effectively a partitioning scheme for dividing the SPMI extended
> -register space up into logical pieces, and set of fixed register
> -locations/definitions within these regions, with some of these regions
> -specifically used for interrupt handling.
> -
> -The QPNP PMICs are used with the Qualcomm Snapdragon series SoCs, and are
> -interfaced to the chip via the SPMI (System Power Management Interface) bus.
> -Support for multiple independent functions are implemented by splitting the
> -16-bit SPMI slave address space into 256 smaller fixed-size regions, 256 bytes
> -each. A function can consume one or more of these fixed-size register regions.
> -
> -Required properties:
> -- compatible: Should contain one of:
> - "qcom,pm660",
> - "qcom,pm660l",
> - "qcom,pm7325",
> - "qcom,pm8004",
> - "qcom,pm8005",
> - "qcom,pm8019",
> - "qcom,pm8028",
> - "qcom,pm8110",
> - "qcom,pm8150",
> - "qcom,pm8150b",
> - "qcom,pm8150c",
> - "qcom,pm8150l",
> - "qcom,pm8226",
> - "qcom,pm8350c",
> - "qcom,pm8841",
> - "qcom,pm8901",
> - "qcom,pm8909",
> - "qcom,pm8916",
> - "qcom,pm8941",
> - "qcom,pm8950",
> - "qcom,pm8953",
> - "qcom,pm8994",
> - "qcom,pm8998",
> - "qcom,pma8084",
> - "qcom,pmd9635",
> - "qcom,pmi8950",
> - "qcom,pmi8962",
> - "qcom,pmi8994",
> - "qcom,pmi8998",
> - "qcom,pmk8002",
> - "qcom,pmk8350",
> - "qcom,pmr735a",
> - "qcom,smb2351",
> - or generalized "qcom,spmi-pmic".
> -- reg: Specifies the SPMI USID slave address for this device.
> - For more information see:
> - Documentation/devicetree/bindings/spmi/spmi.yaml
> -
> -Required properties for peripheral child nodes:
> -- compatible: Should contain "qcom,xxx", where "xxx" is a peripheral name.
> -
> -Optional properties for peripheral child nodes:
> -- interrupts: Interrupts are specified as a 4-tuple. For more information
> - see:
> - Documentation/devicetree/bindings/spmi/qcom,spmi-pmic-arb.yaml
> -- interrupt-names: Corresponding interrupt name to the interrupts property
> -
> -Each child node of SPMI slave id represents a function of the PMIC. In the
> -example below the rtc device node represents a peripheral of pm8941
> -SID = 0. The regulator device node represents a peripheral of pm8941 SID = 1.
> -
> -Example:
> -
> - spmi {
> - compatible = "qcom,spmi-pmic-arb";
> -
> - pm8941@0 {
> - compatible = "qcom,pm8941", "qcom,spmi-pmic";
> - reg = <0x0 SPMI_USID>;
> -
> - rtc {
> - compatible = "qcom,rtc";
> - interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
> - interrupt-names = "alarm";
> - };
> - };
> -
> - pm8941@1 {
> - compatible = "qcom,pm8941", "qcom,spmi-pmic";
> - reg = <0x1 SPMI_USID>;
> -
> - regulator {
> - compatible = "qcom,regulator";
> - regulator-name = "8941_boost";
> - };
> - };
> - };
> diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> new file mode 100644
> index 000000000000..32daebc3a0bc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> @@ -0,0 +1,191 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm SPMI PMICs multi-function device
> +
> +description: |
> + Some Qualcomm PMICs used with the Snapdragon series SoCs are interfaced
> + to the chip via the SPMI (System Power Management Interface) bus.
> + Support for multiple independent functions are implemented by splitting the
> + 16-bit SPMI peripheral address space into 256 smaller fixed-size regions, 256 bytes
> + each. A function can consume one or more of these fixed-size register regions.
> +
> + The Qualcomm SPMI series includes the PM8941, PM8841, PMA8084, PM8998 and other
> + PMICs. These PMICs use a "QPNP" scheme through SPMI interface.
> + QPNP is effectively a partitioning scheme for dividing the SPMI extended
> + register space up into logical pieces, and set of fixed register
> + locations/definitions within these regions, with some of these regions
> + specifically used for interrupt handling.
> +
> +maintainers:
> + - Stephen Boyd <[email protected]>
> +
> +properties:
> + $nodename:
> + oneOf:
> + - pattern: '^pmic@.*$'
> + - pattern: '^pm(a|s)?[0-9]*@.*$'
> + deprecated: true
> +
> + compatible:
> + items:
> + - enum:
> + - qcom,pm660
> + - qcom,pm660l
> + - qcom,pm6150
> + - qcom,pm6150l
> + - qcom,pm6350
> + - qcom,pm7325
> + - qcom,pm8004
> + - qcom,pm8005
> + - qcom,pm8009
> + - qcom,pm8019
> + - qcom,pm8110
> + - qcom,pm8150
> + - qcom,pm8150b
> + - qcom,pm8150l
> + - qcom,pm8226
> + - qcom,pm8350
> + - qcom,pm8350b
> + - qcom,pm8350c
> + - qcom,pm8841
> + - qcom,pm8909
> + - qcom,pm8916
> + - qcom,pm8941
> + - qcom,pm8950
> + - qcom,pm8994
> + - qcom,pm8998
> + - qcom,pma8084
> + - qcom,pmd9635
> + - qcom,pmi8950
> + - qcom,pmi8962
> + - qcom,pmi8994
> + - qcom,pmi8998
> + - qcom,pmk8350
> + - qcom,pmm8155au
> + - qcom,pmr735a
> + - qcom,pmr735b
> + - qcom,pms405
> + - qcom,pmx55
> + - qcom,pmx65
> + - qcom,smb2351
> + - const: qcom,spmi-pmic
> +
> + reg:
> + minItems: 1
> + maxItems: 2
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + labibb:
> + type: object
> + $ref: /schemas/regulator/qcom-labibb-regulator.yaml#
> +
> + regulators:
> + type: object
> + $ref: /schemas/regulator/regulator.yaml#
> +
> +patternProperties:
> + "^adc@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#
> +
> + "^adc-tm@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#
> +
> + "^audio-codec@[0-9a-f]+$":
> + type: object
> + additionalProperties: true # FIXME qcom,pm8916-wcd-analog-codec binding not converted yet
> +
> + "extcon@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/extcon/qcom,pm8941-misc.yaml#
> +
> + "gpio(s)?@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#
> +
> + "pon@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/power/reset/qcom,pon.yaml#
> +
> + "pwm@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/leds/leds-qcom-lpg.yaml#
> +
> + "^rtc@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
> +
> + "^temp-alarm@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#
> +
> + "^vibrator@[0-9a-f]+$":
> + type: object
> + additionalProperties: true # FIXME qcom,pm8916-vib binding not converted yet
> +
> + "^mpps@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#
> +
> + "(.*)?(wled|leds)@[0-9a-f]+$":
> + type: object
> + $ref: /schemas/leds/backlight/qcom-wled.yaml#
> + unevaluatedProperties: false
> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/spmi/spmi.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + spmi@c440000 {
> + compatible = "qcom,spmi-pmic-arb";
> + reg = <0x0c440000 0x1100>,
> + <0x0c600000 0x2000000>,
> + <0x0e600000 0x100000>,
> + <0x0e700000 0xa0000>,
> + <0x0c40a000 0x26000>;
> + reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
> + interrupt-names = "periph_irq";
> + interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
> + qcom,ee = <0>;
> + qcom,channel = <0>;
> + #address-cells = <2>;
> + #size-cells = <0>;
> + interrupt-controller;
> + #interrupt-cells = <4>;
> + cell-index = <0>;
> +
> + pmi8998_lsid0: pmic@2 {
> + compatible = "qcom,pmi8998", "qcom,spmi-pmic";
> + reg = <0x2 SPMI_USID>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + pmi8998_gpio: gpios@c000 {
> + compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
> + reg = <0xc000>;
> + gpio-controller;
> + gpio-ranges = <&pmi8998_gpio 0 0 14>;
> + #gpio-cells = <2>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + };
> + };
> + };

--
DEPRECATED: Please use [email protected]

2022-08-10 15:48:58

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Wed, Aug 10, 2022 at 4:57 AM Lee Jones <[email protected]> wrote:
>
> On Tue, 09 Aug 2022, Rob Herring wrote:
>
> > On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> > > Convert Qualcomm SPMI PMIC binding to yaml format.
> > >
> > > Additional changes:
> > > - filled many missing compatibles
> > >
> > > Co-developed-by: Caleb Connolly <[email protected]>
> > > Signed-off-by: David Heidelberg <[email protected]>
> > > ---
> > > v3:
> > > - added subnodes, there are two not converted to YAML yet, but it works
> > > - now it prints milion directly unrelated warning to this binding
> > > (it's related to the included subnodes bindings, can be merged,
> > > but it'll generate more warnings and preferably anyone can takeover
> > > from here)
> > > - add qcom,pmx65
> > >
> > > v2:
> > > - changed author to myself, kept Caleb as co-author
> > > - moved nodename to properties
> > > - add nodenames for pm* with deprecated property
> > > - add ^$ to pattern properties
> > > - dropped interrupt-names property
> > > - added reg prop. to the nodes which have register in nodename
> > > - added compatible pmx55
> > > Signed-off-by: David Heidelberg <[email protected]>
> > > ---
> > > .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> > > .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> > > 2 files changed, 191 insertions(+), 94 deletions(-)
> > > delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> > > create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> > >
> >
> > As this hasn't been picked up, I applied it. Thanks!
>
> I'd prefer to take it via MFD if it's all the same to you.
>
> In case there are additional fix-ups required during the next cycle.

I'm going to send it to Linus this week for rc1 so that won't be an issue.

Rob

2022-08-10 16:15:25

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3] dt-bindings: mfd: convert to yaml Qualcomm SPMI PMIC

On Wed, 10 Aug 2022, Rob Herring wrote:

> On Wed, Aug 10, 2022 at 4:57 AM Lee Jones <[email protected]> wrote:
> >
> > On Tue, 09 Aug 2022, Rob Herring wrote:
> >
> > > On Sun, 26 Jun 2022 21:16:30 +0200, David Heidelberg wrote:
> > > > Convert Qualcomm SPMI PMIC binding to yaml format.
> > > >
> > > > Additional changes:
> > > > - filled many missing compatibles
> > > >
> > > > Co-developed-by: Caleb Connolly <[email protected]>
> > > > Signed-off-by: David Heidelberg <[email protected]>
> > > > ---
> > > > v3:
> > > > - added subnodes, there are two not converted to YAML yet, but it works
> > > > - now it prints milion directly unrelated warning to this binding
> > > > (it's related to the included subnodes bindings, can be merged,
> > > > but it'll generate more warnings and preferably anyone can takeover
> > > > from here)
> > > > - add qcom,pmx65
> > > >
> > > > v2:
> > > > - changed author to myself, kept Caleb as co-author
> > > > - moved nodename to properties
> > > > - add nodenames for pm* with deprecated property
> > > > - add ^$ to pattern properties
> > > > - dropped interrupt-names property
> > > > - added reg prop. to the nodes which have register in nodename
> > > > - added compatible pmx55
> > > > Signed-off-by: David Heidelberg <[email protected]>
> > > > ---
> > > > .../bindings/mfd/qcom,spmi-pmic.txt | 94 ---------
> > > > .../bindings/mfd/qcom,spmi-pmic.yaml | 191 ++++++++++++++++++
> > > > 2 files changed, 191 insertions(+), 94 deletions(-)
> > > > delete mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt
> > > > create mode 100644 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> > > >
> > >
> > > As this hasn't been picked up, I applied it. Thanks!
> >
> > I'd prefer to take it via MFD if it's all the same to you.
> >
> > In case there are additional fix-ups required during the next cycle.
>
> I'm going to send it to Linus this week for rc1 so that won't be an issue.

Works for me then, thanks.

Acked-by: Lee Jones <[email protected]>

--
Lee Jones [李琼斯]