From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ojeda Subject: Re: [PATCH] battery: Fix charge_now returned by broken batteries Date: Sat, 10 Oct 2009 22:53:39 +0200 Message-ID: References: <1254669853.26496.0.camel@carter> <4AC8F02B.6080209@suse.de> <200910042246.23712.rjw@sisk.pl> <4AC91578.2020807@suse.de> <4AC923F4.9050100@suse.de> <4AC93B45.8090707@suse.de> <20091010120448.GB1811@ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20091010120448.GB1811@ucw.cz> Sender: linux-kernel-owner@vger.kernel.org To: Pavel Machek Cc: Alexey Starikovskiy , "Rafael J. Wysocki" , Henrique de Moraes Holschuh , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-acpi@vger.kernel.org On Sat, Oct 10, 2009 at 2:04 PM, Pavel Machek wrote: > Hi! > >> > current full charge, when the charging is complete. It may end up = lower or >> > greater than >> > previous value. >> > Comparing current charge with the last full charge may correctly g= ive you >> >>100%. >> >> Then maybe we can write something like... >> >> val->intval =3D acpi_battery_is_charged(battery) >> =A0 =A0 =A0 ? min(battery->capacity_now, battery->full_charge_capaci= ty) * 1000 >> =A0 =A0 =A0 : battery->capacity_now * 1000; >> >> So we only use the min() operation when it is fully charged (returni= ng >> to 100%) without losing information when charging. >> >> The problem is that percentage may jump from >100% to 100% in >> batteries whose full capacity increase, but I think that is OK, sinc= e >> when completely charged, the >100% is the new 100%. >> >> In "broken" batteries (is it broken finally? or is it expected >> behaviour?) like mine the old problem will be corrected, as it was >> only present in the charged state. > > I believe you better work around this in userspace... or agree that >>100% charge is possible. I agree that >100% charge is possible while charging (because that would mean the battery is over the last charged level); however, what does it mean when charged? In any case, my laptop's battery is not charging over 100% its original capacity anyway, just reporting a wrong value. > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/hors= es/blog.html >