linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Kiran Gunda <kgunda@codeaurora.org>
Cc: swboyd@chromium.org, lee.jones@linaro.org, agross@kernel.org,
	bjorn.andersson@linaro.org, devicetree@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	mark.rutland@arm.com, linux-arm-msm-owner@vger.kernel.org,
	Stephen Boyd <sboyd@kernel.org>
Subject: Re: [PATCH V5 1/2] mfd: qcom-spmi-pmic: Convert bindings to .yaml format
Date: Mon, 11 Jan 2021 15:42:00 -0600	[thread overview]
Message-ID: <20210111214200.GA3094286@robh.at.kernel.org> (raw)
In-Reply-To: <1609329384-15534-2-git-send-email-kgunda@codeaurora.org>

On Wed, Dec 30, 2020 at 05:26:22PM +0530, Kiran Gunda wrote:
> Convert the bindings from .txt to .yaml format.
> 
> Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
> ---
>  .../devicetree/bindings/mfd/qcom,spmi-pmic.txt     |  80 --------------
>  .../devicetree/bindings/mfd/qcom,spmi-pmic.yaml    | 117 +++++++++++++++++++++
>  2 files changed, 117 insertions(+), 80 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.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> new file mode 100644
> index 0000000..b753bdb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
> @@ -0,0 +1,117 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%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 bindings
> +
> +maintainers:
> +  - Stephen Boyd <sboyd@kernel.org>
> +  - Kiran Gunda <kgunda@codeaurora.org>
> +
> +description: |
> +  The Qualcomm SPMI 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.
> +
> +properties:
> +  spmi_bus:
> +    type: object
> +    description: SPMI bus node

This is outside the scope of this binding.

> +
> +patternProperties:
> +  "^pmic@[0-9]$":
> +    description: Child PMIC nodes
> +    type: object

You've defined spmi_bus and pmic@... as siblings. I assume you meant 
parent/child instead. You'd need to indent all this 4 more spaces. 

However, this is also outside the scope of the binding and should be 
removed.

> +
> +    properties:
> +      compatible:

So this needs to be at the top level. 'compatible' is also how we decide 
to apply a schema to a node. What you did here will never be applied. 
Introduce an error to the example and see.

> +        items:
> +          - enum:
> +              # Sorted based on subtype ID the device reports
> +              - qcom,pm8941
> +              - qcom,pm8841
> +              - qcom,pma8084
> +              - qcom,pm8019
> +              - qcom,pm8226
> +              - qcom,pm8110
> +              - qcom,pma8084
> +              - qcom,pmi8962
> +              - qcom,pmd9635
> +              - qcom,pm8994
> +              - qcom,pmi8994
> +              - qcom,pm8916
> +              - qcom,pm8004
> +              - qcom,pm8909
> +              - qcom,pm8950
> +              - qcom,pmi8950
> +              - qcom,pm8998
> +              - qcom,pmi8998
> +              - qcom,pm8005
> +              - qcom,pm660l
> +              - qcom,pm660
> +
> +          - enum:
> +              - qcom,spmi-pmic

You can use 'const' here instead of enum.

> +
> +      reg:
> +        maxItems: 1
> +        description:
> +          Specifies the SPMI USID slave address for this device.
> +          For more information see bindings/spmi/spmi.txt
> +
> +    patternProperties:
> +      "^[a-zA-Z0-9]$":
> +        description:
> +          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.
> +        type: object

No, you need to define all the child nodes. This may mean you need to 
split to several schemas if each PMIC has different sub devices.

> +
> +    required:
> +      - compatible
> +      - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/spmi/spmi.h>
> +
> +    spmi_bus {
> +        compatible = "qcom,spmi-pmic-arb";
> +        #address-cells = <2>;
> +        #size-cells = <0>;
> +
> +        pmic@0 {
> +         compatible = "qcom,pm8941";
> +         reg = <0x0 SPMI_USID>;
> +
> +         rtc {
> +           compatible = "qcom,rtc";

Not documented nor used anywhere.

> +           interrupts = <0x0 0x61 0x1 0x1>;
> +           interrupt-names = "alarm";
> +          };
> +        };
> +
> +        pmic@1 {
> +         compatible = "qcom,pm8941";
> +         reg = <0x1 SPMI_USID>;
> +
> +         regulator {
> +           compatible = "qcom,regulator";

Same here.

> +           regulator-name = "8941_boost";
> +           };
> +          };
> +        };
> +...
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>  a Linux Foundation Collaborative Project
> 

  reply	other threads:[~2021-01-11 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 11:56 [PATCH V5 0/2] Convert qcom,spmi-pmic bindings from .txt to .yaml Kiran Gunda
2020-12-30 11:56 ` [PATCH V5 1/2] mfd: qcom-spmi-pmic: Convert bindings to .yaml format Kiran Gunda
2021-01-11 21:42   ` Rob Herring [this message]
2021-02-10 13:29     ` kgunda
2020-12-30 11:56 ` [PATCH V5 2/2] mfd: qcom-spmi-pmic: Add support for pm6150 and pm6150l Kiran Gunda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210111214200.GA3094286@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kgunda@codeaurora.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-msm-owner@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sboyd@kernel.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).