Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1361074pxf; Fri, 12 Mar 2021 07:54:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUeAwSIXxXMwik46v/AGrjeND9vGcTQfUuTXYTgd+VnOAa1+FmU2c4eJ563Cmk+qfL0u+q X-Received: by 2002:aa7:da48:: with SMTP id w8mr14553243eds.81.1615564456490; Fri, 12 Mar 2021 07:54:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615564456; cv=none; d=google.com; s=arc-20160816; b=BXOhEhrYOXcA9t9wnqW6of45d0zFidssp2ZDqriXNfvpgJfpf0jdYUQXNmQuWA29xX 0yiZ9aLgjyv/3k+BLtt4iyg24oCeqzzyZNmirxZaY+ADMeXhfx/bEQvidc6X/OoKGj8m hy/YLPQe/eUhBtQizxVaURbZl0n9lE/bm/zgOVtfAfZ8uwO26bF/K8lvNiz7pcV0IH4T yUWTmaY/IGESMGGL9k9nhxqI+ZMK+g+B7ZPhpmqFPypArA1ePPtIZuKkdG3OmUKN/hZk qqDL5/Oi6wO/7CaeyQgl2ZLNdfYyF5mutRRvOYogGIhMYqK3EjWNedK4q8gRsBh2q7gq ZDUA== 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=/w1LbEvORhZueYwhwHoyZrhyxJY3hdVFRDlUVL4VfvQ=; b=CCDpKiiIWuYqAm+YyPQRJrHgMQSzfgs1t6B9EYK4NFCu6e/dH6ARe9f8QFeRfk1y+F auGLESg1riqhLWFBYngb+z71Yvgn6eYoR/wHLLhNGiu4LqrXbFqyEcLcGXeROYg4es6n 1DNgqm5qUWVgQdPQLgjBbyz7/z3yX+DUNvCDenfKr7F+BbJVb8aLTZJPoPrcQgc+bNl0 SROYTfnn2Kp7x4V7TDIlSk4HbuTAkHfbMDSU8weJr8cw8u8vpiVwWeomJTFEwvdEh75c A6y1VPrjI33AgABYGNtU+SrVhUw2AUlOFCMbe6RPMZTMSLpG55DlfYIa63Jm1pFEUPTA mD1g== 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 h13si4083964edt.586.2021.03.12.07.53.52; Fri, 12 Mar 2021 07:54:16 -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 S232575AbhCLPwo (ORCPT + 99 others); Fri, 12 Mar 2021 10:52:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbhCLPwa (ORCPT ); Fri, 12 Mar 2021 10:52:30 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F32CAC061765; Fri, 12 Mar 2021 07:52:29 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id A3BF31F46E78 Received: by jupiter.universe (Postfix, from userid 1000) id 6B2BF480118; 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 30/38] dt-bindings: power: supply: lp8727: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:49 +0100 Message-Id: <20210312154357.1561730-31-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 --- .../bindings/power/supply/lp8727_charger.txt | 43 ------- .../bindings/power/supply/ti,lp8727.yaml | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 43 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/supply/lp8727_charger.txt create mode 100644 Documentation/devicetree/bindings/power/supply/ti,lp8727.yaml diff --git a/Documentation/devicetree/bindings/power/supply/lp8727_charger.txt b/Documentation/devicetree/bindings/power/supply/lp8727_charger.txt deleted file mode 100644 index 0355a4b68f79..000000000000 --- a/Documentation/devicetree/bindings/power/supply/lp8727_charger.txt +++ /dev/null @@ -1,43 +0,0 @@ -Binding for TI/National Semiconductor LP8727 Charger - -Required properties: -- compatible: "ti,lp8727" -- reg: I2C slave address 27h - -Optional properties: -- interrupts: interrupt specifier (see interrupt binding[0]) -- debounce-ms: interrupt debounce time. (u32) - -AC and USB charging parameters -- charger-type: "ac" or "usb" (string) -- eoc-level: value of 'enum lp8727_eoc_level' (u8) -- charging-current: value of 'enum lp8727_ichg' (u8) - -[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt - -Example) - -lp8727@27 { - compatible = "ti,lp8727"; - reg = <0x27>; - - /* GPIO 134 is used for LP8728 interrupt pin */ - interrupt-parent = <&gpio5>; /* base = 128 */ - interrupts = <6 0x2>; /* offset = 6, falling edge type */ - - debounce-ms = <300>; - - /* AC charger: 5% EOC and 500mA charging current */ - ac { - charger-type = "ac"; - eoc-level = /bits/ 8 <0>; - charging-current = /bits/ 8 <4>; - }; - - /* USB charger: 10% EOC and 400mA charging current */ - usb { - charger-type = "usb"; - eoc-level = /bits/ 8 <1>; - charging-current = /bits/ 8 <2>; - }; -}; diff --git a/Documentation/devicetree/bindings/power/supply/ti,lp8727.yaml b/Documentation/devicetree/bindings/power/supply/ti,lp8727.yaml new file mode 100644 index 000000000000..65894b36a69d --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/ti,lp8727.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/ti,lp8727.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Binding for TI/National Semiconductor LP8727 Charger + +maintainers: + - Sebastian Reichel + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + const: ti,lp8727 + + reg: + const: 0x27 + + interrupts: + maxItems: 1 + + debounce-ms: + $ref: /schemas/types.yaml#/definitions/uint32 + description: interrupt debounce time in ms + + ac: + type: object + description: AC charging parameters + properties: + charger-type: + const: ac + + eoc-level: + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 0 + maximum: 6 + description: | + End of Charge Percentage with the following mapping: + 0 = 5%, 1 = 10%, 2 = 16%, 3 = 20%, 4 = 25%, 5 = 33%, 6 = 50% + + charging-current: + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 0 + maximum: 9 + description: | + Charging current with the following mapping: + 0 = 90mA, 1 = 100mA, 2 = 400mA, 3 = 450mA, 4 = 500mA, 5 = 600mA, + 6 = 700mA, 7 = 800mA, 8 = 900mA, 9 = 1000mA + + usb: + type: object + description: USB charging parameters + properties: + charger-type: + const: usb + + eoc-level: + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 0 + maximum: 6 + description: | + End of Charge Percentage with the following mapping: + 0 = 5%, 1 = 10%, 2 = 16%, 3 = 20%, 4 = 25%, 5 = 33%, 6 = 50% + + charging-current: + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 0 + maximum: 9 + description: | + Charging current with the following mapping: + 0 = 90mA, 1 = 100mA, 2 = 400mA, 3 = 450mA, 4 = 500mA, 5 = 600mA, + 6 = 700mA, 7 = 800mA, 8 = 900mA, 9 = 1000mA + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + lp8727: charger@27 { + compatible = "ti,lp8727"; + reg = <0x27>; + interrupt-parent = <&gpio5>; + interrupts = <6 IRQ_TYPE_EDGE_FALLING>; + debounce-ms = <300>; + + /* AC charger: 5% EOC and 500mA charging current */ + ac { + charger-type = "ac"; + eoc-level = /bits/ 8 <0>; + charging-current = /bits/ 8 <4>; + }; + + /* USB charger: 10% EOC and 400mA charging current */ + usb { + charger-type = "usb"; + eoc-level = /bits/ 8 <1>; + charging-current = /bits/ 8 <2>; + }; + }; + }; + -- 2.30.1