linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guru Das Srinagesh <gurus@codeaurora.org>
To: Rob Herring <robh@kernel.org>
Cc: Mark Brown <broonie@kernel.org>,
	Markus Elfring <Markus.Elfring@web.de>,
	Lee Jones <lee.jones@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Guenter Roeck <linux@roeck-us.net>, Joe Perches <joe@perches.com>,
	Subbaraman Narayanamurthy <subbaram@codeaurora.org>,
	David Collins <collinsd@codeaurora.org>,
	Anirudh Ghayal <aghayal@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/3] dt-bindings: mfd: Add QCOM PM8008 MFD bindings
Date: Mon, 2 Nov 2020 11:52:39 -0800	[thread overview]
Message-ID: <20201102195238.GB29492@codeaurora.org> (raw)
In-Reply-To: <20201030154900.GA3896697@bogus>

On Fri, Oct 30, 2020 at 10:49:00AM -0500, Rob Herring wrote:
> On Thu, Oct 22, 2020 at 02:35:41PM -0700, Guru Das Srinagesh wrote:
> > Add device tree bindings for the driver for Qualcomm Technology Inc.'s
> > PM8008 MFD PMIC.
> > 
> > Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
> > ---
> >  .../bindings/mfd/qcom,pm8008-irqchip.yaml          | 102 +++++++++++++++++++++
> >  1 file changed, 102 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/mfd/qcom,pm8008-irqchip.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008-irqchip.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008-irqchip.yaml
> > new file mode 100644
> > index 0000000..31d7b68
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008-irqchip.yaml
> > @@ -0,0 +1,102 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mfd/qcom,pm8008-irqchip.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Qualcomm Technologies, Inc. PM8008 Multi-Function Device PMIC
> > +
> > +maintainers:
> > +  - Guru Das Srinagesh <gurus@codeaurora.org>
> > +
> > +description: |
> > +  PM8008 is a PMIC that contains 7 LDOs, 2 GPIOs, temperature monitoring, and
> > +  can be interfaced over I2C.
> 
> No bindings for all those functions? Bindings should be complete.

While pushing out this patchset, I accidentally dropped the "RFC" tag in
the mail subjects. This driver and binding document are meant to be just
an exemplar for how the framework changes would be used, and hence I
felt adding only a single node would suffice for illustration purposes.

> 
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - const: qcom,pm8008-irqchip
> 
> Why irqchip?

Since the driver's main functions are to register with the regmap-irq
framework and to pass a regmap to the child nodes it populates. Would
"qcom,pm8008-mfd" be more appropriate?

> 
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: pm8008
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-controller: true
> > +
> > +  "#address-cells":
> > +    const: 1
> > +    description: Must be specified if child nodes are specified.
> > +
> > +  "#size-cells":
> > +    const: 0
> > +    description: Must be specified if child nodes are specified.
> > +
> > +  "#interrupt-cells":
> > +    const: 2
> > +    description: |
> > +      The first cell is the IRQ number, the second cell is the IRQ trigger flag.
> > +
> > +patternProperties:
> > +  "^.*@[0-9a-f]+$":
> 
> '^.*' can be dropped. That's redundant.

Done.

> 
> > +    type: object
> > +    # Each peripheral in PM8008 must be represented as a child node with an
> > +    # optional label for referencing as phandle elsewhere. This is optional.
> > +    properties:
> > +      compatible:
> > +        description: The compatible string for the peripheral's driver.
> > +
> > +      reg:
> > +        maxItems: 1
> 
> What does the address represent? It's non-standard, so it needs to be 
> defined.

Will add description.

> 
> > +
> > +      interrupts:
> > +        maxItems: 1
> > +
> > +    required:
> > +      - compatible
> > +      - reg
> > +      - interrupts
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - "#interrupt-cells"
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    qupv3_se13_i2c {
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            pm8008i@8 {
> > +                    compatible = "qcom,pm8008-irqchip";
> > +                    reg = <0x8>;
> > +                    #address-cells = <1>;
> > +                    #size-cells = <0>;
> > +                    interrupt-controller;
> > +                    #interrupt-cells = <2>;
> > +
> > +                    interrupt-names = "pm8008";
> > +                    interrupt-parent = <&tlmm>;
> > +                    interrupts = <32 IRQ_TYPE_EDGE_RISING>;
> > +
> > +                    pm8008_tz: qcom,temp-alarm@2400 {
> 
> Must be documented.
> 
> And don't use vendor prefixes in node names. 

Done.

> 
> > +                            compatible = "qcom,spmi-temp-alarm";
> > +                            reg = <0x2400>;
> > +                            interrupts = <0x5 IRQ_TYPE_EDGE_BOTH>;
> > +                            #thermal-sensor-cells = <0>;
> > +                    };
> > +            };
> > +    };
> > +
> > +...
> > -- 
> > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> > a Linux Foundation Collaborative Project
> > 

  reply	other threads:[~2020-11-02 19:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 21:35 [PATCH v2 0/3] Add support for Qualcomm MFD PMIC register layout Guru Das Srinagesh
2020-10-22 21:35 ` [PATCH v2 1/3] regmap-irq: Add support for peripheral offsets Guru Das Srinagesh
2020-11-12 19:33   ` Mark Brown
2021-03-04 18:27     ` Guru Das Srinagesh
2021-03-04 19:52       ` Mark Brown
2020-10-22 21:35 ` [PATCH v2 2/3] dt-bindings: mfd: Add QCOM PM8008 MFD bindings Guru Das Srinagesh
2020-10-30 15:49   ` Rob Herring
2020-11-02 19:52     ` Guru Das Srinagesh [this message]
2020-10-22 21:35 ` [PATCH v2 3/3] mfd: Add PM8008 driver Guru Das Srinagesh

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=20201102195238.GB29492@codeaurora.org \
    --to=gurus@codeaurora.org \
    --cc=Markus.Elfring@web.de \
    --cc=aghayal@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=broonie@kernel.org \
    --cc=collinsd@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    --cc=subbaram@codeaurora.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).