[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_Jsq+TLt0ousbggKGF5wEdJYLqofxt9a-qDqLCkq0AE_y2Rg@mail.gmail.com>
Date: Mon, 15 Mar 2021 12:27:33 -0600
From: Rob Herring <robh+dt@...nel.org>
To: Sebastian Reichel <sebastian.reichel@...labora.com>
Cc: Sebastian Reichel <sre@...nel.org>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Collabora Kernel ML <kernel@...labora.com>
Subject: Re: [PATCH 11/38] dt-bindings: power: supply: sbs-manager: Convert to
DT schema format
On Fri, Mar 12, 2021 at 8:45 AM Sebastian Reichel
<sebastian.reichel@...labora.com> wrote:
>
> Convert the binding to DT schema format.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@...labora.com>
> ---
> .../bindings/power/supply/sbs,sbs-manager.txt | 66 -----------
> .../power/supply/sbs,sbs-manager.yaml | 111 ++++++++++++++++++
> 2 files changed, 111 insertions(+), 66 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.txt
> create mode 100644 Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml
>
> diff --git a/Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml b/Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml
> new file mode 100644
> index 000000000000..592c476d83e6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml
> @@ -0,0 +1,111 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/supply/sbs,sbs-manager.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: SBS compliant manger
> +
> +maintainers:
> + - Sebastian Reichel <sre@...nel.org>
> +
> +allOf:
> + - $ref: power-supply.yaml#
> +
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - enum:
> + - lltc,ltc1760
> + - enum:
> + - sbs,sbs-manager
> + - items:
> + - const: sbs,sbs-manager
> +
> + reg:
> + const: 0xa
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> + gpio-controller: true
> +
> + "#gpio-cells":
> + const: 2
> +
> +required:
> + - compatible
> + - reg
> +
> +additionalProperties: false
> +
> +dependencies:
> + '#gpio-cells': [gpio-controller]
> + gpio-controller: ['#gpio-cells']
The core schema should capture these dependencies.
> +
> +patternProperties:
> + "^i2c@[1-4]$":
> + type: object
> +
> + allOf:
> + - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + #include <dt-bindings/gpio/gpio.h>
> +
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + batman: battery-manager@a {
> + compatible = "lltc,ltc1760", "sbs,sbs-manager";
> + reg = <0x0a>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + gpio-controller;
> + #gpio-cells = <2>;
> +
> + i2c@1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1>;
> +
> + battery@b {
> + compatible = "ti,bq20z65", "sbs,sbs-battery";
> + reg = <0x0b>;
> + sbs,battery-detect-gpios = <&batman 1 1>;
> + };
> + };
> +
> + i2c@2 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <2>;
> +
> + battery@b {
> + compatible = "ti,bq20z65", "sbs,sbs-battery";
> + reg = <0x0b>;
> + sbs,battery-detect-gpios = <&batman 2 1>;
> + };
> + };
> +
> + i2c@3 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <3>;
> +
> + battery@b {
> + compatible = "ti,bq20z65", "sbs,sbs-battery";
> + reg = <0x0b>;
> + sbs,battery-detect-gpios = <&batman 3 1>;
> + };
> + };
> + };
> + };
> --
> 2.30.1
>
Powered by blists - more mailing lists