Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1355133pxf; Fri, 12 Mar 2021 07:46:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpa8YhlbBqxbTPG8nSM/HL1KZBUk3dyMpWexeqdEWa7Clm1/3qCVmsjuc+tLkOz33eVnek X-Received: by 2002:aa7:df14:: with SMTP id c20mr14862731edy.197.1615564017313; Fri, 12 Mar 2021 07:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615564017; cv=none; d=google.com; s=arc-20160816; b=RN8yd1PduZRBHi7A1dqZjg+pb3Lm4LVEDjNfLq2JGOzMO3Ljjhj1X18k1O16ZXabFO ROFfSv8UuHPjXojJ7VFYT7R5MZ/fszwRZMKqa0DMGHBz7JLYk/6a8l2OffvvoEaMYECT sfYWb437SGFMAqNjwGrGe66Xq/g3Rj1g3Gnc+dEoc5xUB9+Z9fE360X7Dq/cwhCEFwd7 5UxoZmhrvsgDsb9IFRHjuOve6sSp4ofz4r+9VvfIHAJ4YKYlJQ9TD7TWXY6sQAWGyORb eCvpMFTLYal/oH9f8OzFIzOfHFSEVQv68oLeiaeZIf1/Zc7e+gmmfIoYKtSvS/BqtOAk YgtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D2YDzmAe9CFdseHTKnrml+CQDFQqGtjg09J1I/N28do=; b=l9uOp8LKPEk1Ondnv2jrrj9ThbJbYEaDZ/CCH30SLrtuTlCLWPiX/EGheFh2LEA3Ia AwqctIUVquxzg1oXO6RifLYz8Eou+ZJVUKvBdo1TL5fnE5InXUt0DEwaG0i4mMyh5Aku /WpVUOvKB3HB9/+d0WjTh3EeTvielPUGfCatKhEEVnpdbx6pT1vnvHQE8rNVmBfziKIi AcwloWcFnxoi0g+/WQ/8UiSkWvYuJGBL+so5RNj55e85jrwM4wXk8VCwmK+of6q/OCjh Kl98afOzaTkm963bu1T7VMkzFshJny48dDIz0aWhq3/4kGKPimr0zB2FkbGCoMEvbITW hyww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw14si4134217ejb.141.2021.03.12.07.46.34; Fri, 12 Mar 2021 07:46:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbhCLPpW (ORCPT + 99 others); Fri, 12 Mar 2021 10:45:22 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55672 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbhCLPoR (ORCPT ); Fri, 12 Mar 2021 10:44:17 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 465C61F46EC5 Received: by jupiter.universe (Postfix, from userid 1000) id 59BCC480106; Fri, 12 Mar 2021 16:44:08 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Rob Herring Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH 20/38] dt-bindings: power: supply: max17040: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:39 +0100 Message-Id: <20210312154357.1561730-21-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312154357.1561730-1-sebastian.reichel@collabora.com> References: <20210312154357.1561730-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the binding to DT schema format. Signed-off-by: Sebastian Reichel --- .../power/supply/max17040_battery.txt | 52 ---------- .../bindings/power/supply/maxim,max17040.yaml | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+), 52 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/supply/max17040_battery.txt create mode 100644 Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml diff --git a/Documentation/devicetree/bindings/power/supply/max17040_battery.txt b/Documentation/devicetree/bindings/power/supply/max17040_battery.txt deleted file mode 100644 index c802f664b508..000000000000 --- a/Documentation/devicetree/bindings/power/supply/max17040_battery.txt +++ /dev/null @@ -1,52 +0,0 @@ -max17040_battery -~~~~~~~~~~~~~~~~ - -Required properties : - - compatible : "maxim,max17040", "maxim,max17041", "maxim,max17043", - "maxim,max17044", "maxim,max17048", "maxim,max17049", - "maxim,max17058", "maxim,max17059" or "maxim,max77836-battery" - - reg: i2c slave address - -Optional properties : -- maxim,alert-low-soc-level : The alert threshold that sets the state of - charge level (%) where an interrupt is - generated. Can be configured from 1 up to 32 - (%). If skipped the power up default value of - 4 (%) will be used. -- maxim,double-soc : Certain devices return double the capacity. - Specify this boolean property to divide the - reported value in 2 and thus normalize it. - SOC == State of Charge == Capacity. -- maxim,rcomp : A value to compensate readings for various - battery chemistries and operating temperatures. - max17040,41 have 2 byte rcomp, default to - 0x97 0x00. All other devices have one byte - rcomp, default to 0x97. -- interrupts : Interrupt line see Documentation/devicetree/ - bindings/interrupt-controller/interrupts.txt -- wakeup-source : This device has wakeup capabilities. Use this - property to use alert low SOC level interrupt - as wake up source. - -Optional properties support interrupt functionality for alert low state of -charge level, present in some ICs in the same family, and should be used with -compatible "maxim,max77836-battery". - -Example: - - battery-fuel-gauge@36 { - compatible = "maxim,max77836-battery"; - reg = <0x36>; - maxim,alert-low-soc-level = <10>; - interrupt-parent = <&gpio7>; - interrupts = <2 IRQ_TYPE_EDGE_FALLING>; - wakeup-source; - }; - - battery-fuel-gauge@36 { - compatible = "maxim,max17048"; - reg = <0x36>; - maxim,rcomp = /bits/ 8 <0x56>; - maxim,alert-low-soc-level = <10>; - maxim,double-soc; - }; diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml new file mode 100644 index 000000000000..de91cf3f058c --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml @@ -0,0 +1,95 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/maxim,max17040.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Maxim 17040 fuel gauge series + +maintainers: + - Sebastian Reichel + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - maxim,max17040 + - maxim,max17041 + - maxim,max17043 + - maxim,max17044 + - maxim,max17048 + - maxim,max17049 + - maxim,max17058 + - maxim,max17059 + - maxim,max77836-battery + + reg: + maxItems: 1 + + maxim,alert-low-soc-level: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 32 + description: | + The alert threshold that sets the state of charge level (%) where an interrupt is generated. + If skipped the power up default value of 4 (%) will be used. + + maxim,double-soc: + type: boolean + description: | + Certain devices return double the capacity. + Specify this to divide the reported value in 2 and thus normalize it. + SoC == State of Charge == Capacity. + + maxim,rcomp: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + A value to compensate readings for various battery chemistries and operating temperatures. + max17040,41 have 2 byte rcomp, default to 0x97 0x00. + All other devices have one byte rcomp, default to 0x97. + + interrupts: + maxItems: 1 + + wakeup-source: + type: boolean + description: | + Use this property to use alert low SoC level interrupt as wake up source. + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + battery@36 { + compatible = "maxim,max17048"; + reg = <0x36>; + maxim,rcomp = /bits/ 8 <0x56>; + maxim,alert-low-soc-level = <10>; + maxim,double-soc; + }; + }; + - | + #include + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + battery@36 { + compatible = "maxim,max77836-battery"; + reg = <0x36>; + maxim,alert-low-soc-level = <10>; + interrupt-parent = <&gpio7>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + wakeup-source; + }; + }; -- 2.30.1