Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1355053pxf; Fri, 12 Mar 2021 07:46:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyYqTZ+YRaO//gaiGfJf4RYm94Q0DPe6Nr9JplXfriY1QhOhS1I3yUEElxlxkyXVNmM/fjM X-Received: by 2002:a05:6402:30a5:: with SMTP id df5mr15123790edb.24.1615564012579; Fri, 12 Mar 2021 07:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615564012; cv=none; d=google.com; s=arc-20160816; b=yjMM0VLzx72/vH2Gos29V2P5Xbqki2mniJv8VzQKwjoYKGgHReuBuejFrZYVuuI1nB heVzMiUzEy7ImhowhQJt1+ou4he+obr/ioae07B2hp0z0RDH69xXui/xRH/ZyNc2DZYH VttKFtmEXg0x/x43A1QrXs+n9ClBuQAXxuhuRjMknzjsH7fe1nkngaHym7DW6kyhIl0t MWXr/JRkXUQPunMoYyEmr8UaGMjtfF+NP8jT/Iz4Svac7/TzR6MG7xMgjLX9BYzQoRgp 7CrFGhC8f2eoKlaOKAWGhI3WVOaD43aqVOyIE+kNKsxgqUJNKTrGPbhqMpMGRZ2K7ex1 ZAxg== 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=8Lva5kB27oGniRbLAzx2EvMHOE1ra1AbecpWqRlzdto=; b=vAZNkPENEJYpmMKN2KEVc3RJZ3kXsqJ/ykMswQmRs7lkadsg28WjlXUUll+OvgsNuQ hPlSPMKmn8eNQ3Sbtr7QLF92UArR4/QCnt87v2XhmlgJnI6OwTvMlpMGgd2+4D4Ue9d5 j6bvigA8E1ZLNfCqUgMNiuZ/iR2LD+JrPJsnOqzI45HCYAPrNmPptMB9CdHgumsi42nH TmF00ycSzm+zRoGqDM3xenHz5yWyac1I7CTPGOdo+ZDVEE0uCpy/y/vrtDApXO2grNvo j043IgDGxQ933ePD1teQMbrOVxO13tPfBDyJZOES9DrUwzaY8h1oWcTzyu9+KvbgxutK s1LQ== 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 ay27si4362122edb.171.2021.03.12.07.46.28; Fri, 12 Mar 2021 07:46:52 -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 S232771AbhCLPpU (ORCPT + 99 others); Fri, 12 Mar 2021 10:45:20 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:55656 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232572AbhCLPoQ (ORCPT ); Fri, 12 Mar 2021 10:44:16 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 446521F46EC4 Received: by jupiter.universe (Postfix, from userid 1000) id 582A5480105; 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, David Lechner Subject: [PATCH 19/38] dt-bindings: power: supply: lego-ev3-battery: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:38 +0100 Message-Id: <20210312154357.1561730-20-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. Cc: David Lechner Signed-off-by: Sebastian Reichel --- .../power/supply/lego,ev3-battery.yaml | 55 +++++++++++++++++++ .../power/supply/lego_ev3_battery.txt | 21 ------- 2 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml delete mode 100644 Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt diff --git a/Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml b/Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml new file mode 100644 index 000000000000..518eabb63588 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/lego,ev3-battery.yaml @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/lego,ev3-battery.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: LEGO MINDSTORMS EV3 Battery + +maintainers: + - David Lechner + - Sebastian Reichel + +description: | + LEGO MINDSTORMS EV3 has some built-in capability for monitoring the battery. + It uses 6 AA batteries or a special Li-ion rechargeable battery pack that is + detected by a key switch in the battery compartment. + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + const: lego,ev3-battery + + io-channels: + items: + - description: ADC channel for battery voltage + - description: ADC channel for battery current + + io-channel-names: + items: + - const: voltage + - const: current + + rechargeable-gpios: + maxItems: 1 + description: Rechargeable battery indication gpio + +required: + - compatible + - io-channels + - io-channel-names + - rechargeable-gpios + +additionalProperties: false + +examples: + - | + #include + battery { + compatible = "lego,ev3-battery"; + io-channels = <&adc 4>, <&adc 3>; + io-channel-names = "voltage", "current"; + rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>; + }; diff --git a/Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt b/Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt deleted file mode 100644 index 5485633b1faa..000000000000 --- a/Documentation/devicetree/bindings/power/supply/lego_ev3_battery.txt +++ /dev/null @@ -1,21 +0,0 @@ -LEGO MINDSTORMS EV3 Battery -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -LEGO MINDSTORMS EV3 has some built-in capability for monitoring the battery. -It uses 6 AA batteries or a special Li-ion rechargeable battery pack that is -detected by a key switch in the battery compartment. - -Required properties: - - compatible: Must be "lego,ev3-battery" - - io-channels: phandles to analog inputs for reading voltage and current - - io-channel-names: Must be "voltage", "current" - - rechargeable-gpios: phandle to the rechargeable battery indication gpio - -Example: - - battery { - compatible = "lego,ev3-battery"; - io-channels = <&adc 4>, <&adc 3>; - io-channel-names = "voltage", "current"; - rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>; - }; -- 2.30.1