Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbdIHLce (ORCPT ); Fri, 8 Sep 2017 07:32:34 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:38433 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752549AbdIHLcd (ORCPT ); Fri, 8 Sep 2017 07:32:33 -0400 Date: Fri, 8 Sep 2017 13:32:31 +0200 From: Pavel Machek To: Sebastian Reichel Cc: Marek Belisko , robh+dt@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, hns@goldelico.com, Marek Belisko Subject: libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling Message-ID: <20170908113231.GJ18365@amd> References: <1501620926-22669-1-git-send-email-marek.belisko@open-nandra.com> <1501620926-22669-6-git-send-email-marek.belisko@open-nandra.com> <20170829101147.debhadzyfrxhkrvt@earth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9pltayyoy9lWEMH" Content-Disposition: inline In-Reply-To: <20170829101147.debhadzyfrxhkrvt@earth> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 56 --M9pltayyoy9lWEMH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > + case POWER_SUPPLY_PROP_CAPACITY: > > + { > > + int ret, curr, voltage; > > + > > + ret =3D read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, &curr); > > + ret |=3D read_channel(adc_bat, POWER_SUPPLY_PROP_VOLTAGE_NOW, &volta= ge); > > + if (ret < 0) > > + goto err; > > + > > + val->intval =3D fuel_level_LiIon(voltage, curr, 10); > > + } > > + break; > > default: > > return -EINVAL; > > } >=20 > Without patch description: See Last Question in >=20 > Documentation/power/power_supply_class.txt =2E..should be done in libbattery, yet to be written. :-). Do you have specific guidance what you'd like to see in libbattery? I was thinking about creating lib_pocket_hardware -- that would hide battery details, plus other phone-related stuff such as LEDs, backlights, temperatures, ... Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --M9pltayyoy9lWEMH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlmyf88ACgkQMOfwapXb+vLoFwCguazvtEGTH+GyeBeH0AEp1qw/ LFEAoJ3ETBktPxp4mdaKaSfPFh+ZSbs4 =96kB -----END PGP SIGNATURE----- --M9pltayyoy9lWEMH--