Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1354738pxf; Fri, 12 Mar 2021 07:46:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuXNJxtGaIyHqBavUDxw1I01a+teVQaMRnBLyjipUH0KB0KqvpnGS2khbS7TWfq3lehKTc X-Received: by 2002:a17:906:8583:: with SMTP id v3mr9329791ejx.361.1615563987934; Fri, 12 Mar 2021 07:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615563987; cv=none; d=google.com; s=arc-20160816; b=SNNQrOt8UHTUeof6NNCetJ1Y3BUNU0U5pi+zUXtnw0yyqRWcflQjJXA4HVoMsVc/mD G/DzErgQP08xk1M3JbObCXg/LTDSJ23CiRCc5elhEGaHDg+21ujz/XS0jT+9kQJ10KZE T/7brn4MsyOF/8vQxXHFC6Kz38n3ycR4PBrKKq91zPHr7eg2mOv/CP0En5XJhzGylaYu /hNzv6ik5s0jvf08Ml3zn0q08feiDUcUc1Uml8hpIB9UEvW1nxkftf3lRzOv0rvDKpTZ L1vYZwqafS31kU7YvbsJQNYAlvEf3+f2HbsFLQ48gw6PCbMP5xPT4vGfnkzGiur6WH85 SOKg== 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=KA3XItMzrP+JB6GyYiryYNzbn8BMFQQk0yYGTtf6r5Q=; b=h8HpR4Qvm04ImYoV9+J8OlW8oAf8LwLYz8PGIkzNAAM/pcAv7DtaFdgrUCpGXo0PvZ 9GYFbv2QfGyGG+/vxOA+ZyR1xzTS02Abv3AQ2By4DOoI0OLkZIc4VzJPjYwcIIP++kf3 HHbpnMKgnU+GYNyrU99ZlFrDa8PYnP57EFrA4/E1uyTPT/a3UDgZuqDFeTZoDRvCsMBJ iIAnosDkegynpb3V9Wv8obIQJZigtQTApwX+DlrRnhkFYhGBOMt3CwUGt6UXOjeutvnu 6wemWIi2fDtCZQ+af5LHUEB05Sb4te8BjKFGVvAeOGB/PPXZNwsK70X9snVKqGj5pJir IRpA== 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 4si4442776edc.544.2021.03.12.07.46.04; Fri, 12 Mar 2021 07:46:27 -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 S232987AbhCLPo6 (ORCPT + 99 others); Fri, 12 Mar 2021 10:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232067AbhCLPoO (ORCPT ); Fri, 12 Mar 2021 10:44:14 -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 93C46C061574; Fri, 12 Mar 2021 07:44:13 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 831721F46E8C Received: by jupiter.universe (Postfix, from userid 1000) id 3A7704800DF; 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 07/38] dt-bindings: power: supply: bq2415x: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:26 +0100 Message-Id: <20210312154357.1561730-8-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/bq2415x.txt | 47 --------- .../bindings/power/supply/bq2415x.yaml | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 47 deletions(-) delete mode 100644 Documentation/devicetree/bindings/power/supply/bq2415x.txt create mode 100644 Documentation/devicetree/bindings/power/supply/bq2415x.yaml diff --git a/Documentation/devicetree/bindings/power/supply/bq2415x.txt b/Documentation/devicetree/bindings/power/supply/bq2415x.txt deleted file mode 100644 index d0327f0b59ad..000000000000 --- a/Documentation/devicetree/bindings/power/supply/bq2415x.txt +++ /dev/null @@ -1,47 +0,0 @@ -Binding for TI bq2415x Li-Ion Charger - -Required properties: -- compatible: Should contain one of the following: - * "ti,bq24150" - * "ti,bq24150" - * "ti,bq24150a" - * "ti,bq24151" - * "ti,bq24151a" - * "ti,bq24152" - * "ti,bq24153" - * "ti,bq24153a" - * "ti,bq24155" - * "ti,bq24156" - * "ti,bq24156a" - * "ti,bq24158" -- reg: integer, i2c address of the device. -- ti,current-limit: integer, initial maximum current charger can pull - from power supply in mA. -- ti,weak-battery-voltage: integer, weak battery voltage threshold in mV. - The chip will use slow precharge if battery voltage - is below this value. -- ti,battery-regulation-voltage: integer, maximum charging voltage in mV. -- ti,charge-current: integer, maximum charging current in mA. -- ti,termination-current: integer, charge will be terminated when current in - constant-voltage phase drops below this value (in mA). -- ti,resistor-sense: integer, value of sensing resistor in milliohm. - -Optional properties: -- ti,usb-charger-detection: phandle to usb charger detection device. - (required for auto mode) - -Example from Nokia N900: - -bq24150a { - compatible = "ti,bq24150a"; - reg = <0x6b>; - - ti,current-limit = <100>; - ti,weak-battery-voltage = <3400>; - ti,battery-regulation-voltage = <4200>; - ti,charge-current = <650>; - ti,termination-current = <100>; - ti,resistor-sense = <68>; - - ti,usb-charger-detection = <&isp1704>; -}; diff --git a/Documentation/devicetree/bindings/power/supply/bq2415x.yaml b/Documentation/devicetree/bindings/power/supply/bq2415x.yaml new file mode 100644 index 000000000000..f8461f06e6f4 --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/bq2415x.yaml @@ -0,0 +1,98 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2021 Sebastian Reichel +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/bq2415x.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Binding for TI bq2415x Li-Ion Charger + +maintainers: + - Sebastian Reichel + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - ti,bq24150 + - ti,bq24150 + - ti,bq24150a + - ti,bq24151 + - ti,bq24151a + - ti,bq24152 + - ti,bq24153 + - ti,bq24153a + - ti,bq24155 + - ti,bq24156 + - ti,bq24156a + - ti,bq24158 + + reg: + maxItems: 1 + + ti,current-limit: + $ref: /schemas/types.yaml#/definitions/uint32 + description: initial maximum current charger can pull from power supply in mA. + + ti,weak-battery-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + weak battery voltage threshold in mV. + The chip will use slow precharge if battery voltage is below this value. + + ti,battery-regulation-voltage: + $ref: /schemas/types.yaml#/definitions/uint32 + description: maximum charging voltage in mV. + + ti,charge-current: + $ref: /schemas/types.yaml#/definitions/uint32 + description: maximum charging current in mA. + + ti,termination-current: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + charge will be terminated when current in constant-voltage phase drops + below this value (in mA). + + ti,resistor-sense: + $ref: /schemas/types.yaml#/definitions/uint32 + description: value of sensing resistor in milliohm. + + ti,usb-charger-detection: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to usb charger detection device (required for auto mode) + +required: + - compatible + - reg + - ti,current-limit + - ti,weak-battery-voltage + - ti,battery-regulation-voltage + - ti,charge-current + - ti,termination-current + - ti,resistor-sense + +additionalProperties: false + +examples: + - | + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + + charger@6b { + compatible = "ti,bq24150a"; + reg = <0x6b>; + + ti,current-limit = <100>; + ti,weak-battery-voltage = <3400>; + ti,battery-regulation-voltage = <4200>; + ti,charge-current = <650>; + ti,termination-current = <100>; + ti,resistor-sense = <68>; + + ti,usb-charger-detection = <&isp1704>; + }; + }; -- 2.30.1