Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1469114ima; Sun, 21 Oct 2018 12:28:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV62MES4x5k35QMeY5BbVHPfvB7K+D0SwdNW6e8omRKV9AzdoYhpYMl4z58HRykLH89hfYUCC X-Received: by 2002:a63:c251:: with SMTP id l17-v6mr12894874pgg.146.1540150092471; Sun, 21 Oct 2018 12:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540150092; cv=none; d=google.com; s=arc-20160816; b=gFr7Zm66khcJh4PZEKpU03eZTONrGZs7xZovikbTdOSKZZl/fUprPqSXXS/SSGwlQA qoHObsnkp2O75RTv2NfcxTbv6tC9UIB9RTrapRyw4HJOvoF1RfcgLQRXu8rw7tEsGTB1 8Id+/Od5baA5+71TQXJpYzgjMXtaVtr7X21MpfhUNGy24elBPkYyh7dT2lH1n7AZu3Av /o7a4KpGF/8X5m9/5Sa9OQeT2my5uezsWs+NnLLHnrui9YbDgH0KEIf3jOl309kuxwF3 stD5OmpuZmh7kuqftnCxoZIxzXF6uQZ54GfLl8D7IbPLduGjHOikKh2dZaBDFmnKNNHw ePzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mKxIvpUvu/jrTNn5tXbNtQDSrVTXYXu5v5KW2KM8CBs=; b=He43AdfWv6VU/GNxnjXzyJ8xPWG3TjYxZ5+oWOCStIfMDe5FrTKycuOukAfV9kQMHt nqqqtI2FD0vow8wV9chPCMviZArjecvkACNqKv1IgTgv7F+wSr2qP7vXKobAYqi/CEUh ioeeK64df8Ln+L0+7cnaPYuivLyt/GuuVOkcDLc7L+KFCe7ToW96tCdUTcGlFIL4s13M SdTk4ivwDqV5fs6/q/BPmQiyQWu1qeU4Ru/SASnz+WHyPx9WFWr7iGNb3S0ni8o7lfq3 76/wl6IPmQgf9A2yRY3yk18iDHsCzh5TrolvS3ZhvLxl8dEVjTGEMbUVcV1n/anOfsjx Lyaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iu1nb9X9; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17-v6si30884525pgi.491.2018.10.21.12.27.57; Sun, 21 Oct 2018 12:28:12 -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=@kernel.org header.s=default header.b=iu1nb9X9; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728174AbeJVDm3 (ORCPT + 99 others); Sun, 21 Oct 2018 23:42:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:33372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727156AbeJVDm3 (ORCPT ); Sun, 21 Oct 2018 23:42:29 -0400 Received: from earth.universe (unknown [62.214.5.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 888DC20658; Sun, 21 Oct 2018 19:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540150027; bh=DQantDa2DRZvntC4/uobEQGOw15PK0GejlSTBcPH4Gc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iu1nb9X9/PKL/puEjYO+snZnNqlI9/KgtYPxSv4Wc3rNXS7MIfDqt3P1wDwTMgDOg 2rl5eOy13cv1vMr2gITe3UiIhIBv2wLBMFQzhO1iy52vE8x2UzMgzVz6V/UH/eMUjo dW0//QIzDhLrGN8li+oLVxoCbYpa/iDNV0DwYziI= Received: by earth.universe (Postfix, from userid 1000) id D3F603C098F; Sun, 21 Oct 2018 18:24:30 +0200 (CEST) Date: Sun, 21 Oct 2018 18:24:30 +0200 From: Sebastian Reichel To: Baolin Wang Cc: robh+dt@kernel.org, mark.rutland@arm.com, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, yuanjiang.yu@unisoc.com, broonie@kernel.org, ctatlor97@gmail.com, linus.walleij@linaro.org Subject: Re: [PATCH v5 3/6] dt-bindings: power: Introduce properties to present the battery OCV capacity table Message-ID: <20181021162430.qfz2teauewdy5jva@earth.universe> References: <3a0c6487c9503cf64432f630e65790cc5c3f70ab.1539915051.git.baolin.wang@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lgjqzksp5zzrqfpo" Content-Disposition: inline In-Reply-To: <3a0c6487c9503cf64432f630e65790cc5c3f70ab.1539915051.git.baolin.wang@linaro.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lgjqzksp5zzrqfpo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Oct 19, 2018 at 06:53:12PM +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 Celsi= us. > Thus this patch provides some battery properties to present the OCV table > temperatures and OCV capacity table values. >=20 > Suggested-by: Sebastian Reichel > Signed-off-by: Baolin Wang > Reviewed-by: Linus Walleij > --- Looks good to me. -- Sebastian > Changes from v4: > - Improve the description of ocv-capacity-table-n to make the order clea= r. >=20 > 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. >=20 > Changes from v2: > - Use type __be32 to calculate the table length. > - Update error messages. > - Add some helper functions. >=20 > Changes from v1: > - New patch in v2. > --- > .../devicetree/bindings/power/supply/battery.txt | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) >=20 > diff --git a/Documentation/devicetree/bindings/power/supply/battery.txt b= /Documentation/devicetree/bindings/power/supply/battery.txt > index 938d027..89871ab 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 resi= stance > + - ocv-capacity-table-0: An array providing the open circuit voltage (OC= V) > + of the battery and corresponding battery capacity percent, which is u= sed > + to look up battery capacity according to current OCV value. And the o= pen > + circuit voltage unit is microvolt. > + - 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 C= elsius, > + 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. > =20 > 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 =3D <900000>; > constant-charge-voltage-max-microvolt =3D <4200000>; > factory-internal-resistance-micro-ohms =3D <250000>; > + ocv-capacity-celsius =3D <(-10) 0 10>; > + ocv-capacity-table-0 =3D <4185000 100>, <4113000 95>, <4066000 90>, ..= =2E; > + ocv-capacity-table-1 =3D <4200000 100>, <4185000 95>, <4113000 90>, ..= =2E; > + ocv-capacity-table-2 =3D <4250000 100>, <4200000 95>, <4185000 90>, ..= =2E; > }; > =20 > charger: charger@11 { > --=20 > 1.7.9.5 >=20 --lgjqzksp5zzrqfpo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlvMqD4ACgkQ2O7X88g7 +po+qA//YPKLr1a2+dJGER6QU5BNbQLcQW98aYF04eTnq5R+sGX9+zCgH/uvQVJ7 BS98J+pMSi/Bpq3AHIrfPnTrjdROGk9BG3RjdRqSd8eFLgEI9i9yUEXnwdY/RxCH WTXai4lBLeN7vvcTRu6s2FYIzA1m84B/BzEU4Dy5KjLVIKqQzUSZSB6WDW7P6DSF YOa/9Vh7bjKfijaCnmJk4SQM8rFyxFzAiWHnfe+sbNv/jLEU6LK5D0rbJnD5Cr2M oIn0JY6m/BfydAanAvlsD9hG7lhRsciePXtGw9XP5EVBuMgb2VSMJZmp0Qs51UhR oO6P2io2tJpyi9RxO1yHFGCm0+k+J7h6Wwy+IW/MSDtT6m4PSmfKQwmHKGA5g5dz AlOUNfsSy/GbNmmpnM7M+lEGZNNgo2ue6neCRaJ7V6NhpuptwW6gE0OOUT9zg94x 9Hya3Of0HTdiIBFchfFyUbxI7zTBlsiqLU93jOMe/Ggsh4AO8kZDhTCfa0BvHSAx Ixt+34Yl6lpP1PT5exMPVFk7YkgjOR2K44YnsDe4cKB5FGIEQw7zoCIiD1yydbmJ BvGDnp62TAI/LKrVbUy5JeM9kb/6g2Gnn8o0nMUWJbsePL07GatWThvkOJOnxTqZ ZDAOW/y5/J6/mTzw9ik1Jig/8iHd6KPp0MVUVHTlUWJe0/f9wZo= =Rlqe -----END PGP SIGNATURE----- --lgjqzksp5zzrqfpo--