Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1362877pxf; Fri, 12 Mar 2021 07:56:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJytnIjlQ+CfQLpk6+J5BLUH7q1vj4wPc9I7vKk/ikGxr5sRiqQyV2gTNzQpMHZ6XpFQ0FgG X-Received: by 2002:a17:906:14d4:: with SMTP id y20mr9391541ejc.190.1615564592725; Fri, 12 Mar 2021 07:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615564592; cv=none; d=google.com; s=arc-20160816; b=z0CvhwDgKmnJx9DtitoX7mKKNZ6BKzz7n5ae9rEg2gadl3h3EXhTOeAo+QI+i0VeeZ coU8StGa65GkAKEajSC5BJe/r/jUKnrGPmU4PuUydI4ym2rC5MsDGA3Vq+HvjU5SUYpH INt2L+pk+DU7/pY2Zy95hJ4nmm6I+Fm8wlzlGTMbhlHZuA8xqtsP9viRBCRPKKGgisbD G2pF0cPDiGLGyGMRzIAOz8wBy4FbJ379ZQdmPifpvTXhs7+TVaXHG/k1B6qFigUYdtkt 6zFm88lgZQCvV7tOEXR+gIyravSKRW7V5fvuZU7bz6ODYZfloEH3T7qa1BS9zUHXsI3W qRPQ== 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=fIJOXmpSUc9XwgyJKDuo+nfn3zdwMFPSsFa9ONtW8dI=; b=GS3xw8GQiRPTcyuKGeKq06s56XjF0eTAYNvDjhL4mmKQQwZn/b/Vguv8K5Q8wEqGC0 hhZESH5g8LxTgw6cTvgCRGBaCVNshTbjzwYfM//L739GqAPMQ8vNaXjrarAEWcxU1Y+y A8F05V1upD0XkGw6VMQufFcq1Y+pHCL2jvzpwLhvTbszwppq+BiPeM/773Jx8kTTaUry Wkk5fb6Wksuj71khdjkBPTvfqXHzWm6y9AooIsAwWEIlr8ba5EXEoAPuAZbGJdEaXFoQ C8Qa1wYSLQe3p2XvgiNOVOQJRXmKZLeB/UtfvntV2WmcLOTrObSebHTNyTtee97hPyVt ikXQ== 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 j20si4485480ejy.7.2021.03.12.07.56.09; Fri, 12 Mar 2021 07:56:32 -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 S232778AbhCLPwt (ORCPT + 99 others); Fri, 12 Mar 2021 10:52:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232057AbhCLPwa (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 9E9E8C061762; Fri, 12 Mar 2021 07:52:27 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 755F11F46E70 Received: by jupiter.universe (Postfix, from userid 1000) id 704E148011A; 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 32/38] dt-bindings: power: supply: ltc294x: Convert to DT schema format Date: Fri, 12 Mar 2021 16:43:51 +0100 Message-Id: <20210312154357.1561730-33-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/lltc,ltc294x.yaml | 66 +++++++++++++++++++ .../bindings/power/supply/ltc2941.txt | 28 -------- 2 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/supply/lltc,ltc294x.yaml delete mode 100644 Documentation/devicetree/bindings/power/supply/ltc2941.txt diff --git a/Documentation/devicetree/bindings/power/supply/lltc,ltc294x.yaml b/Documentation/devicetree/bindings/power/supply/lltc,ltc294x.yaml new file mode 100644 index 000000000000..043bf378040f --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/lltc,ltc294x.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/power/supply/lltc,ltc294x.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Binding for LTC2941, LTC2942, LTC2943 and LTC2944 battery fuel gauges + +description: | + All chips measure battery capacity. + The LTC2942 is pin compatible with the LTC2941, it adds voltage and + temperature monitoring, and is runtime detected. LTC2943 and LTC2944 + are software compatible, uses a slightly different conversion formula + for the charge counter and adds voltage, current and temperature monitoring. + +maintainers: + - Sebastian Reichel + +allOf: + - $ref: power-supply.yaml# + +properties: + compatible: + enum: + - lltc,ltc2941 + - lltc,ltc2942 + - lltc,ltc2943 + - lltc,ltc2944 + + reg: + maxItems: 1 + + lltc,resistor-sense: + $ref: /schemas/types.yaml#/definitions/int32 + description: | + Sense resistor value in milli-ohms. + Can be negative value when the battery has been connected to the wrong end of the resistor. + + lltc,prescaler-exponent: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The prescaler exponent as explained in the datasheet. + This determines the range and accuracy of the gauge. + The value is programmed into the chip only if it differs from the current setting. + The setting is lost when the battery is disconnected. + +required: + - compatible + - reg + - lltc,resistor-sense + - lltc,prescaler-exponent + +additionalProperties: false + +examples: + - | + i2c0 { + #address-cells = <1>; + #size-cells = <0>; + battery@64 { + compatible = "lltc,ltc2943"; + reg = <0x64>; + lltc,resistor-sense = <15>; + lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */ + }; + }; diff --git a/Documentation/devicetree/bindings/power/supply/ltc2941.txt b/Documentation/devicetree/bindings/power/supply/ltc2941.txt deleted file mode 100644 index 3b9ba147b041..000000000000 --- a/Documentation/devicetree/bindings/power/supply/ltc2941.txt +++ /dev/null @@ -1,28 +0,0 @@ -binding for LTC2941, LTC2942, LTC2943 and LTC2944 battery gauges - -All chips measure battery capacity. -The LTC2942 is pin compatible with the LTC2941, it adds voltage and -temperature monitoring, and is runtime detected. LTC2943 and LTC2944 -is software compatible, uses a slightly different conversion formula -for the charge counter and adds voltage, current and temperature monitoring. - -Required properties: -- compatible: Should contain "lltc,ltc2941", "lltc,ltc2942", "lltc,ltc2943" - or "lltc,ltc2944" which also indicates the type of I2C chip attached. -- reg: The 7-bit I2C address. -- lltc,resistor-sense: The sense resistor value in milli-ohms. Can be a 32-bit - negative value when the battery has been connected to the wrong end of the - resistor. -- lltc,prescaler-exponent: The prescaler exponent as explained in the datasheet. - This determines the range and accuracy of the gauge. The value is programmed - into the chip only if it differs from the current setting. The setting is - lost when the battery is disconnected. - -Example from the Topic Miami Florida board: - - fuelgauge: ltc2943@64 { - compatible = "lltc,ltc2943"; - reg = <0x64>; - lltc,resistor-sense = <15>; - lltc,prescaler-exponent = <5>; /* 2^(2*5) = 1024 */ - }; -- 2.30.1