Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2621925imm; Thu, 18 Oct 2018 18:52:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV61jIKDVcJPML2twtcJIfdSkAHV50phpZTAWUwui5VZxuOlBbSoW7HGomZkIHp3LFwlbNyWB X-Received: by 2002:a63:5949:: with SMTP id j9-v6mr30793922pgm.210.1539913920622; Thu, 18 Oct 2018 18:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539913920; cv=none; d=google.com; s=arc-20160816; b=cAQcUDYEiHCSw5WFaxkU52Hpam5zO0Feh9RfsLO4j7ypAXFPouwIYOmBZZ/AsuruVm uCoqigd+VpdiEebgJRm9FVrE9+juDQzCFCi+7tPbeQAEju4u5XQ9H6HiQcbPDympVW+N XHlubDbTNL6WutDMk6k0m7P1++YwKdtk5Zry4796OY+8508LojleSKfoHf6q1cNAlNai NqRq2iQiVdPP1KO/AEp5yhsk9vYkFXMx6Fss+aKPTcn9NhRpHHpBzgKF7qhAkEK11CnL I4w/Mmtakp0RSzkB/JxtQslItNxubqUnLV8PdmMIz/cdqC8hyXMxnYIWZCsrNAK1HuqS WnBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=TPMkdWvBGvg4FvnssSVbk6AEM880kMjROnlvB26fBzY=; b=KxIWvpAm8CI4YA6XhUSiciZwDSukghMzDgEyJMhkXZNC37QhudrLdPeAE85+9LJk9C 4fZxWKSnsvOQnoX6SeUTeQ5uoFklpp8nT2ll1GaiGXmDBIEoxWLG4m5Veissfrygpt2h +jAUuisuDZs/nKoLUGjGcmMKRkxmEy7P3KTaWttdSbV0FaRARHcCW5FUZn1c5OoEPN7L VkQyLwBUoRJvrE1Fsa+H/8kjJOzU4YBaVcZWnYProl0YGF9TnkpZw5FfeKoIbk7hgWuB 9P3mGST8+5gncncR+PcFjvavfdlJpulhnXoxDTgsOID/iksdAXNIzOv+7cCt7JTifYtL K1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NY5u0BGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28-v6si23130930pgg.384.2018.10.18.18.51.45; Thu, 18 Oct 2018 18:52:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NY5u0BGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbeJSJyp (ORCPT + 99 others); Fri, 19 Oct 2018 05:54:45 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:36963 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbeJSJyo (ORCPT ); Fri, 19 Oct 2018 05:54:44 -0400 Received: by mail-lf1-f65.google.com with SMTP id a82-v6so24061822lfa.4 for ; Thu, 18 Oct 2018 18:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TPMkdWvBGvg4FvnssSVbk6AEM880kMjROnlvB26fBzY=; b=NY5u0BGGW/AWgtwB7T95Txn3sebGYEuSqoaiEIRifkkOcmlQlJ+JHygHgqAGBAsvUo Z3q5vOG6Lz69DFbytRD4tLocthMMtGFAZPBj+3V27aoLOvUd/UaNCojxy8ahG6TrFp5p iAla2TRDMfWO2WCcz+31oUp5n7jdEsSRHxsHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TPMkdWvBGvg4FvnssSVbk6AEM880kMjROnlvB26fBzY=; b=kygYNDHUw2OQjgwWQiRucPxWhQ5g6PaDQ6Gb2gFQbU3jm/AP8j0t+f5AEGUnq+xYx0 FmmhQEshsfo44IvDUyzZ7eZd6Hte+6QG7FUyOapPtsFIZpk+DomKNB89GKujN/slFDzM pQlfaivhJgKqo+fl7Kd8oIDIAOF/B/e7Mod68opPXSDL3ZUukTa+cRUpxRmrM8C2vH16 4yZ9ZMN1k/9tP0bkQ9vIaa3GK4vI9Rqai8ZjGSGzOtCOVAOyWJ0bp2a2+BtdkTFj04wY na37b4svSGK1apeNQPjDKM5m/IsA5Ql96oAHaFUYr5vq/7l+A46QDvEGADTgxqIYJnkF CRkA== X-Gm-Message-State: ABuFfojIc7DuPmws/sFNWWaehJfr6jBSv6G64uVR7PUY4MsmU1xeZYMJ kIY7b10T8W+ZRXJ6LGEL3vhrU+rZ6+fkupE+FEXrig== X-Received: by 2002:a19:771b:: with SMTP id s27-v6mr1623242lfc.84.1539913851673; Thu, 18 Oct 2018 18:50:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:95d7:0:0:0:0:0 with HTTP; Thu, 18 Oct 2018 18:50:51 -0700 (PDT) In-Reply-To: <20181018165101.GA11562@bogus> References: <20181018165101.GA11562@bogus> From: Baolin Wang Date: Fri, 19 Oct 2018 09:50:51 +0800 Message-ID: Subject: Re: [PATCH v4 3/6] dt-bindings: power: Introduce properties to present the battery OCV capacity table To: Rob Herring Cc: Sebastian Reichel , Mark Rutland , Linux PM list , DTML , LKML , yuanjiang.yu@unisoc.com, Mark Brown , Craig Tatlor , Linus Walleij Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19 October 2018 at 00:51, Rob Herring wrote: > On Mon, Oct 15, 2018 at 04:09:22PM +0800, Baolin Wang wrote: >> Some battery driver will use the open circuit voltage (OCV) value to look >> up the corresponding battery capacity percent in one certain degree Celsius. >> Thus this patch provides some battery properties to present the OCV table >> temperatures and OCV capacity table values. >> >> Suggested-by: Sebastian Reichel >> Signed-off-by: Baolin Wang >> Reviewed-by: Linus Walleij >> --- >> Changes from v3: >> - Split binding into one separate patch. >> - Rename ocv-capacity-table-temperatures to ocv-capacity-celsius. >> - Add some words to specify the OCV's unit. >> >> Changes from v2: >> - Use type __be32 to calculate the table length. >> - Update error messages. >> - Add some helper functions. >> >> Changes from v1: >> - New patch in v2. >> --- >> .../devicetree/bindings/power/supply/battery.txt | 15 +++++++++++++++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b/Documentation/devicetree/bindings/power/supply/battery.txt >> index 938d027..1f70e5d 100644 >> --- a/Documentation/devicetree/bindings/power/supply/battery.txt >> +++ b/Documentation/devicetree/bindings/power/supply/battery.txt >> @@ -23,6 +23,17 @@ Optional Properties: >> - constant-charge-current-max-microamp: maximum constant input current >> - constant-charge-voltage-max-microvolt: maximum constant input voltage >> - factory-internal-resistance-micro-ohms: battery factory internal resistance >> + - ocv-capacity-table-0: An array providing the battery capacity percent >> + with corresponding open circuit voltage (OCV) of the battery, which >> + is used to look up battery capacity according to current OCV value. >> + And the open circuit voltage unit is microvolt. > > The order percent and voltage is still not clear. I'd guess one way > based on the text here, but the example is the opposite. The description > here must stand on its own. Yes, you are right. I will correct the order of ocv-capacity-table-n. Thanks. >> + - ocv-capacity-table-1: Same as ocv-capacity-table-0 >> + ...... >> + - ocv-capacity-table-n: Same as ocv-capacity-table-0 >> + - ocv-capacity-celsius: An array containing the temperature in degree Celsius, >> + for each of the battery capacity lookup table. The first temperature value >> + specifies the OCV table 0, and the second temperature value specifies the >> + OCV table 1, and so on. >> >> Battery properties are named, where possible, for the corresponding >> elements in enum power_supply_property, defined in >> @@ -44,6 +55,10 @@ Example: >> constant-charge-current-max-microamp = <900000>; >> constant-charge-voltage-max-microvolt = <4200000>; >> factory-internal-resistance-micro-ohms = <250000>; >> + ocv-capacity-celsius = <(-10) 0 10>; >> + ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...; >> + ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>, ...; >> + ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>, ...; >> }; >> >> charger: charger@11 { >> -- >> 1.7.9.5 >> -- Baolin Wang Best Regards