Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3237624imm; Sun, 16 Sep 2018 13:05:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbnWE0KEiblvOAhtfIEjLnRawKENjzNhreyYdfjy8jb77E2VjoRgWU6/eauvTM9svxDFssZ X-Received: by 2002:a62:cd3:: with SMTP id 80-v6mr23176626pfm.184.1537128309526; Sun, 16 Sep 2018 13:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537128309; cv=none; d=google.com; s=arc-20160816; b=nnsQNYDB22u4YJbhN7Et+JPnVzEgEbZgpUg/77HNYm433iyCyjwDsr/MLdGhpYaQHA O21nfnFhwbc9YlS1Bf//2fR+UOdwfJ+fP0EHqcIVFRYcf9slfAhFWQBRw9C2M+8e08Jp iRZLfBmEOmJFciUZVooafr5F+HsUrNJCOD2mfetn5dUIA7Pc1ROUp4lOTe6hpFV0T2aZ FYFrap3IQgqebk7gd90sskvgcHRbrG2URwRmAlXJs572Pv9zdd5eXf0dm9FQybMHhANa 9g6GNgx1bvdao70b6+qEuSQwAkVabqm+VPf3yq9epsopJs1YHJQjBxu3Kl8ei+BhjuRt a+yA== 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; bh=j9o0jw6D2B/3JGJsV9SJ9Hn8NglYiukFfsSurODfbmA=; b=m4+G7nSm0CD7SpZM4gaJgEZ7j8Qk/EwTWoEICHNgz1KUVmMv/wSAPMSduTBa/1l2Nr /dq9OVzOfMxhYl4uKRGrCEdesYAwz+F7SYEz5yUTtdETZ6/IIR3kcbK4V5lWHCduv92P ldf0Gws+prYXb3aRoLrB4yImg6yhNzRlc1czHjgOPFbFwdMBzHXhATwQkZBtC0HAJ+kc sWJgwaU7p/qklsWOGe3G0sY/xsjIcVMf347NGQZ8BwHN9Ri+NpRO0A8AQxtgImhCp9xt pGpz1helFyVI9pq9EDsaM7ZhjJy7ofJQYAqvzL9VUie8ND63n4aoHlm8UdIiEcDEtwLw GFfQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g92-v6si13740186plg.11.2018.09.16.13.04.54; Sun, 16 Sep 2018 13:05:09 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbeIQB1R (ORCPT + 99 others); Sun, 16 Sep 2018 21:27:17 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47032 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728603AbeIQB0p (ORCPT ); Sun, 16 Sep 2018 21:26:45 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 9DD5B27DAE5 Received: by earth.universe (Postfix, from userid 1000) id 6F1A53C0C52; Sun, 16 Sep 2018 15:57:21 +0200 (CEST) Date: Sun, 16 Sep 2018 15:57:21 +0200 From: Sebastian Reichel To: Baolin Wang , Craig Tatlor 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 Subject: Re: [PATCH 1/2] dt-bindings: power: Add Spreadtrum SC27XX fuel gauge unit documentation Message-ID: <20180916135721.rhu3rn4fsrmmgnbf@earth.universe> References: <1b3f165e2a806dd3d4b7712160ee3bda72f7d675.1536736399.git.baolin.wang@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d2rtcggg5cqwck6e" Content-Disposition: inline In-Reply-To: <1b3f165e2a806dd3d4b7712160ee3bda72f7d675.1536736399.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 --d2rtcggg5cqwck6e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Sep 12, 2018 at 03:29:38PM +0800, Baolin Wang wrote: > This patch adds the binding documentation for Spreadtrum SC27XX series PM= ICs > fuel gauge unit device, which is used to calculate the battery capacity. >=20 > Signed-off-by: Baolin Wang > --- > .../devicetree/bindings/power/supply/sc27xx-fg.txt | 55 ++++++++++++++= ++++++ > 1 file changed, 55 insertions(+) > create mode 100644 Documentation/devicetree/bindings/power/supply/sc27xx= -fg.txt >=20 > diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt= b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt > new file mode 100644 > index 0000000..7447bae > --- /dev/null > +++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.txt > @@ -0,0 +1,55 @@ > +Spreadtrum SC27XX PMICs Fuel Gauge Unit Power Supply Bindings > + > +Required properties: > +- compatible: Should be one of the following: > + "sprd,sc2720-fgu", > + "sprd,sc2721-fgu", > + "sprd,sc2723-fgu", > + "sprd,sc2730-fgu", > + "sprd,sc2731-fgu". > +- reg: The address offset of fuel gauge unit. > +- bat-detect-gpio: GPIO for battery detection. > +- io-channels: Specify the IIO ADC channel to get temperature. > +- io-channel-names: Should be "bat-temp". > +- sprd,inner-resist: Specify the the battery inner resistance (mOhm). This should be a property of the battery.without the sprd, prefix. > +- sprd,ocv-cap-table: Provide the battery capacity percent with correspo= nding > + open circuit voltage (ocv) of the battery, which is used to look up cu= rrent > + battery capacity according to current baterry ocv values. This should also be part of the battery binding. I just reviewed a patchset for the Qualcomm Battery Monitoring System, which needs the same functionality. The Qualcomm binding is more advanced, but should also support this simpler case. Thus I think it makes sense to use its description as base for adding support for this feature to Documentation/devicetree/bindings/power/supply/battery.txt -- Sebastian > +- monitored-battery: Phandle of battery characteristics devicetree node. > + The fuel gauge uses the following battery properties: > +- charge-full-design-microamp-hours: battery design capacity. > +- constant-charge-voltage-max-microvolt: maximum constant input voltage. > + See Documentation/devicetree/bindings/power/supply/battery.txt > + > +Example: > + > + bat: battery { > + compatible =3D "simple-battery"; > + charge-full-design-microamp-hours =3D <1900000>; > + constant-charge-voltage-max-microvolt =3D <4350000>; > + ...... > + }; > + > + sc2731_pmic: pmic@0 { > + compatible =3D "sprd,sc2731"; > + reg =3D <0>; > + spi-max-frequency =3D <26000000>; > + interrupts =3D ; > + interrupt-controller; > + #interrupt-cells =3D <2>; > + #address-cells =3D <1>; > + #size-cells =3D <0>; > + > + fgu@a00 { > + compatible =3D "sprd,sc2731-fgu"; > + reg =3D <0xa00>; > + bat-detect-gpio =3D <&pmic_eic 9 GPIO_ACTIVE_HIGH>; > + io-channels =3D <&pmic_adc 5>; > + io-channel-names =3D "bat-temp"; > + sprd,inner-resist =3D <250>; > + sprd,ocv-cap-table =3D <4185 100>, <4113 95>, <4066 90>, <4022 85>, <= 3983 80>, <3949 75>, <3917 70>, > + <3889 65>, <3864 60>, <3835 55>, <3805 50>, <3787 45>, <3777 40>, <3= 773 35>, <3770 30>, > + <3765 25>, <3752 20>, <3724 15>, <3680 10>, <3605 5>, <3400 0>; > + monitored-battery =3D <&bat>; > + }; > + }; > --=20 > 1.7.9.5 >=20 --d2rtcggg5cqwck6e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlueYUEACgkQ2O7X88g7 +prBpA/+L4vfCccaNDqookIw9lLx8g654kCwWqFEMlyu6kGJ5NxPKW7bp5pgYbLr IFjWqntkQg816WJUYz1Bz7eV3XJYTn7uSufIKz5pee5f45RZsa5NcNHOSqWDaBka kgbJZSs3tQDksaIv1wTQWH18T/mE2rpoIszvtnrbIBUDL9QDqwLQXhXHJKsq9e0S SgIMAFMIwZ9sP9HN1hn4NHj5SUv0ZHNR5JK1wL9WWpvWxfYuGd6Zz+Ekz2x6IZvh aMTkcngN9eV/DfPUagBZZmiAYrMTQ4JrOeHj1AQWuZra0/6/D+zVg/ES093JN0LH F8u7jB7X0b5V0MPSFDmDsSXgrPLLki/upHl79oDLEjTBtq6TyU30/dU1MJN3lo0R nkCgiHe3uscelpWVkSDRxk806CpPUNPFxh6VcXLY01JCEPyAaDiU/Y2qC4+e3Gvn 3Y0Xg3SiakKCEnkPbpxJ0xco8QsCR4ErGu5qWQUVNALD1XLAaCUapTIiSgd0IBIk 4Hlq4Hi24m1Ox42B0sPrh55BRgyfICW5pllnPqPkhTS9z1qvBaYlhO8B1GMmuqSH FtUTPc9QriOHGICK6W9bWs93NO2hw+jnx0Su3s05+RRR6nO9MujLIWrETIA22fC0 CFZNDdopuVuTrCnqhu3jD8T4AcP/WLkZpuCeYjJFmdUjhXxYGCM= =qeQf -----END PGP SIGNATURE----- --d2rtcggg5cqwck6e--