From patchwork Sun Sep 6 14:47:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 11759535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75D0492C for ; Sun, 6 Sep 2020 14:48:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6395E214F1 for ; Sun, 6 Sep 2020 14:48:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728846AbgIFOsM (ORCPT ); Sun, 6 Sep 2020 10:48:12 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:60921 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728692AbgIFOsI (ORCPT ); Sun, 6 Sep 2020 10:48:08 -0400 X-Originating-IP: 195.189.32.242 Received: from pc.localdomain (unknown [195.189.32.242]) (Authenticated sender: contact@artur-rojek.eu) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 88D8040007; Sun, 6 Sep 2020 14:48:03 +0000 (UTC) From: Artur Rojek To: Sebastian Reichel , Rob Herring Cc: Paul Cercueil , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek Subject: [PATCH v2 1/2] dt-bindings: power: Convert ingenic,battery.txt to YAML Date: Sun, 6 Sep 2020 16:47:25 +0200 Message-Id: <20200906144726.8852-1-contact@artur-rojek.eu> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Convert the textual documentation of Device Tree bindings for the Ingenic JZ47xx SoCs battery to YAML. Signed-off-by: Artur Rojek --- Changes: v2: move introduction of new compatibles into a separate patch .../bindings/power/supply/ingenic,battery.txt | 31 ---------- .../power/supply/ingenic,battery.yaml | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 31 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.txt create mode 100644 Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt b/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt deleted file mode 100644 index 66430bf73815..000000000000 --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.txt +++ /dev/null @@ -1,31 +0,0 @@ -* Ingenic JZ47xx battery bindings - -Required properties: - -- compatible: Must be "ingenic,jz4740-battery". -- io-channels: phandle and IIO specifier pair to the IIO device. - Format described in iio-bindings.txt. -- monitored-battery: phandle to a "simple-battery" compatible node. - -The "monitored-battery" property must be a phandle to a node using the format -described in battery.txt, with the following properties being required: - -- voltage-min-design-microvolt: Drained battery voltage. -- voltage-max-design-microvolt: Fully charged battery voltage. - -Example: - -#include - -simple_battery: battery { - compatible = "simple-battery"; - voltage-min-design-microvolt = <3600000>; - voltage-max-design-microvolt = <4200000>; -}; - -ingenic_battery { - compatible = "ingenic,jz4740-battery"; - io-channels = <&adc INGENIC_ADC_BATTERY>; - io-channel-names = "battery"; - monitored-battery = <&simple_battery>; -}; diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml new file mode 100644 index 000000000000..b4e0275ac63a --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019-2020 Artur Rojek +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/ingenic,battery.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Ingenic JZ47xx battery bindings + +maintainers: + - Artur Rojek + +properties: + compatible: + const: ingenic,jz4740-battery + + io-channels: + items: + - description: > + phandle and IIO specifier pair to the IIO device. + See Documentation/devicetree/bindings/iio/iio-bindings.txt for more + details. + + io-channel-names: + const: "battery" + + monitored-battery: + items: + - description: > + phandle to a "simple-battery" compatible node. + + This property must be a phandle to a node using the format described + in battery.txt, with the following properties being required: + - voltage-min-design-microvolt: drained battery voltage, + - voltage-max-design-microvolt: fully charged battery voltage. + +required: + - compatible + - io-channels + - io-channel-names + - monitored-battery + +additionalProperties: false + +examples: + - | + #include + + simple_battery: battery { + compatible = "simple-battery"; + voltage-min-design-microvolt = <3600000>; + voltage-max-design-microvolt = <4200000>; + }; + + ingenic-battery { + compatible = "ingenic,jz4740-battery"; + io-channels = <&adc INGENIC_ADC_BATTERY>; + io-channel-names = "battery"; + monitored-battery = <&simple_battery>; + }; From patchwork Sun Sep 6 14:47:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 11759533 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8745213B1 for ; Sun, 6 Sep 2020 14:48:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 709352083E for ; Sun, 6 Sep 2020 14:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbgIFOsJ (ORCPT ); Sun, 6 Sep 2020 10:48:09 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53565 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728028AbgIFOsI (ORCPT ); Sun, 6 Sep 2020 10:48:08 -0400 X-Originating-IP: 195.189.32.242 Received: from pc.localdomain (unknown [195.189.32.242]) (Authenticated sender: contact@artur-rojek.eu) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 1121C40002; Sun, 6 Sep 2020 14:48:04 +0000 (UTC) From: Artur Rojek To: Sebastian Reichel , Rob Herring Cc: Paul Cercueil , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek Subject: [PATCH v2 2/2] dt-bindings: power: ingenic,battery: add new compatibles Date: Sun, 6 Sep 2020 16:47:26 +0200 Message-Id: <20200906144726.8852-2-contact@artur-rojek.eu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906144726.8852-1-contact@artur-rojek.eu> References: <20200906144726.8852-1-contact@artur-rojek.eu> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This binding can support Ingenic JZ4725B and JZ4770 SoCs, as they are compatible with Ingenic JZ4740 battery. Introduce the following compatible property combinations: compatible = "ingenic,jz4725b-battery", "ingenic,jz4740-battery", compatible = "ingenic,jz4770-battery", "ingenic,jz4740-battery" Signed-off-by: Artur Rojek Reviewed-by: Rob Herring --- Changes: v2: new patch .../devicetree/bindings/power/supply/ingenic,battery.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml index b4e0275ac63a..b9e5458499bf 100644 --- a/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml +++ b/Documentation/devicetree/bindings/power/supply/ingenic,battery.yaml @@ -12,7 +12,13 @@ maintainers: properties: compatible: - const: ingenic,jz4740-battery + oneOf: + - const: ingenic,jz4740-battery + - items: + - enum: + - ingenic,jz4725b-battery + - ingenic,jz4770-battery + - const: ingenic,jz4740-battery io-channels: items: