linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: dmitry.torokhov@gmail.com, mark.rutland@arm.com,
	lee.jones@linaro.org, lgirdwood@gmail.com, broonie@kernel.org,
	wim@linux-watchdog.org, linux@roeck-us.net, p.paillet@st.com,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: mfd: Convert stpmic1 bindings to json-schema
Date: Thu, 6 Feb 2020 18:28:20 +0000	[thread overview]
Message-ID: <20200206182820.GA12162@bogus> (raw)
In-Reply-To: <20200130154315.6260-1-benjamin.gaignard@st.com>

On Thu, Jan 30, 2020 at 04:43:15PM +0100, Benjamin Gaignard wrote:
> Convert stpmic1 bindings to json-schema.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
>  .../devicetree/bindings/input/st,stpmic1-onkey.txt |  28 ---
>  .../devicetree/bindings/mfd/st,stpmic1.txt         |  61 ------
>  .../devicetree/bindings/mfd/st,stpmic1.yaml        | 205 +++++++++++++++++++++
>  .../bindings/regulator/st,stpmic1-regulator.txt    |  64 -------
>  .../bindings/watchdog/st,stpmic1-wdt.txt           |  11 --
>  5 files changed, 205 insertions(+), 164 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/input/st,stpmic1-onkey.txt
>  delete mode 100644 Documentation/devicetree/bindings/mfd/st,stpmic1.txt
>  create mode 100644 Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
>  delete mode 100644 Documentation/devicetree/bindings/regulator/st,stpmic1-regulator.txt
>  delete mode 100644 Documentation/devicetree/bindings/watchdog/st,stpmic1-wdt.txt


> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> new file mode 100644
> index 000000000000..5db86be683dd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml
> @@ -0,0 +1,205 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/st,stpmic1.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: STMicroelectonics STPMIC1 Power Management IC bindings
> +
> +description: STMicroelectronics STPMIC1 Power Management IC
> +
> +maintainers:
> +  - pascal Paillet <p.paillet@st.com>
> +
> +allOf:
> +  - $ref: ../input/input.yaml
> +  - $ref: ../regulator/regulator.yaml

The properties these define don't apply to the parent node here.

> +
> +properties:
> +  compatible:
> +    const: st,stpmic1
> +
> +  reg:
> +    const: 0x33
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  "#interrupt-cells":
> +    const: 2
> +
> +  interrupt-controller: true
> +
> +  onkey:
> +    type: object

input.yaml goes here.

> +
> +    properties:
> +      compatible:
> +        const: st,stpmic1-onkey
> +
> +      interrupts:
> +        items:
> +          - description: onkey-falling, happens when onkey is pressed. IT_PONKEY_F of pmic
> +          - description: onkey-rising, happens when onkey is released. IT_PONKEY_R of pmic
> +
> +      interrupt-names:
> +        items:
> +          - const: onkey-falling
> +          - const: onkey-rising
> +
> +      st,onkey-clear-cc-flag:
> +        description: onkey is able power on after an over-current shutdown event.
> +        $ref: /schemas/types.yaml#/definitions/flag
> +
> +      st,onkey-pu-inactive:
> +        description: onkey pull up is not active
> +        $ref: /schemas/types.yaml#/definitions/flag
> +
> +      power-off-time-sec:
> +        minimum: 1
> +        maximum: 16
> +
> +    required:
> +      - compatible
> +      - interrupts
> +      - interrupt-names
> +
> +  watchdog:
> +    type: object

watchdog.yaml here.

> +
> +    properties:
> +      compatible:
> +        const: st,stpmic1-wdt
> +
> +    required:
> +      - compatible
> +
> +  regulators:
> +    type: object
> +
> +    description: |
> +      Available Regulators in STPMIC1 device are:
> +        - buck1 for Buck BUCK1
> +        - buck2 for Buck BUCK2
> +        - buck3 for Buck BUCK3
> +        - buck4 for Buck BUCK4
> +        - ldo1 for LDO LDO1
> +        - ldo2 for LDO LDO2
> +        - ldo3 for LDO LDO3
> +        - ldo4 for LDO LDO4
> +        - ldo5 for LDO LDO5
> +        - ldo6 for LDO LDO6
> +        - vref_ddr for LDO Vref DDR
> +        - boost for Buck BOOST
> +        - pwr_sw1 for VBUS_OTG switch
> +        - pwr_sw2 for SW_OUT switch
> +      Switches are fixed voltage regulators with only enable/disable capability.
> +
> +    properties:
> +      compatible:
> +        const: st,stpmic1-regulators
> +
> +    required:
> +      - compatible
> +
> +patternProperties:
> +  "^(buck[1-4]|ldo[1-6]|vref_ddr|boost|)$":

Should be a child of 'regulators'

> +    type: object
> +
> +    properties:
> +      st,mask-reset:
> +        description: mask reset for this regulator,
> +                     the regulator configuration is maintained during pmic reset.
> +        $ref: /schemas/types.yaml#/definitions/flag
> +
> +      interrupts:
> +        maxItems: 1
> +
> +      regulator-over-current-protection: true
> +
> +  "^(pwr_sw[1-2])$":
> +    type: object
> +
> +    properties:
> +      interrupts:
> +        maxItems: 1
> +
> +      regulator-over-current-protection: true
> +      regulator-active-discharge: true
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#interrupt-cells"
> +  - interrupt-controller
> +
> +examples:
> +  - |
> +    #include <dt-bindings/mfd/st,stpmic1.h>
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    i2c@0 {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      pmic@33 {
> +        compatible = "st,stpmic1";
> +        reg = <0x33>;
> +        interrupt-parent = <&gpioa>;
> +        interrupts = <0 2>;
> +
> +        interrupt-controller;
> +        #interrupt-cells = <2>;
> +
> +        onkey {
> +          compatible = "st,stpmic1-onkey";
> +          interrupts = <IT_PONKEY_F 0>,<IT_PONKEY_R 1>;
> +          interrupt-names = "onkey-falling", "onkey-rising";
> +          power-off-time-sec = <10>;
> +        };
> +
> +        watchdog {
> +          compatible = "st,stpmic1-wdt";
> +        };
> +
> +        regulators {
> +          compatible = "st,stpmic1-regulators";
> +
> +          ldo6-supply = <&v3v3>;

Not documented.

> +
> +          buck1 {
> +            regulator-name = "vdd_core";
> +            interrupts = <IT_CURLIM_BUCK1 0>;
> +            st,mask-reset;
> +            regulator-boot-on;
> +            regulator-min-microvolt = <700000>;
> +            regulator-max-microvolt = <1200000>;
> +          };
> +
> +          buck3 {
> +            regulator-name = "vdd";
> +            regulator-min-microvolt = <3300000>;
> +            regulator-max-microvolt = <3300000>;
> +            regulator-boot-on;
> +            regulator-pull-down;
> +          };
> +
> +          buck4 {
> +            regulator-name = "v3v3";
> +            interrupts = <IT_CURLIM_BUCK4 0>;
> +            regulator-min-microvolt = <3300000>;
> +            regulator-max-microvolt = <3300000>;
> +          };
> +
> +          ldo6 {
> +            regulator-name = "v1v8";
> +            regulator-min-microvolt = <1800000>;
> +            regulator-max-microvolt = <1800000>;
> +            regulator-over-current-protection;
> +          };
> +        };
> +      };
> +    };
> +
> +...

      reply	other threads:[~2020-02-06 20:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 15:43 [PATCH] dt-bindings: mfd: Convert stpmic1 bindings to json-schema Benjamin Gaignard
2020-02-06 18:28 ` Rob Herring [this message]

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=20200206182820.GA12162@bogus \
    --to=robh@kernel.org \
    --cc=benjamin.gaignard@st.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=p.paillet@st.com \
    --cc=wim@linux-watchdog.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).