[Fwd: Proposed fixes for ACPI backend]

Danny Kukawka danny.kukawka at web.de
Mon Sep 12 04:31:25 PDT 2005


On Sunday 11 September 2005 19:05, Ryan Lortie wrote:
> Hi.  Sorry for the resend.  I just found out that I forgot to attach the
> actual *patch* to my first email :)
>

+       /* Some laptops report current charge much larger than
+        * full charge when at 100%.  Clamp back down to 100%. */
+       if (normalised_current > normalised_lastfull)
+               normalised_current = normalised_lastfull;

This is IMO not correct. Why change the current value to a wrong/other value? 
The battery is first full if the battery is no longer in state charging. And 
if in this case the current is higher than the last full this is normal and 
you should not change the current value. Normalise mean not to _correct_ well 
known values. 

We also never give values for percentage higher than 100 % back. So, I don't 
see a reason why you do this.

See util.c:
if (percentage > 100) {
	HAL_WARNING (("Percentage %i, returning 100!", percentage));
	return 100;
}

With this change the user should ask: Why is my battery full and the battery 
already is in state charging? If the current is higher than last full the 
user know the last full is not correct but in this case he can't see the 
reason.

I would prefer to display simply the with voltage normalised values and not to 
_correct_ to any other value them (note: last full is not a reliable value).

Cheers, 

Danny


More information about the hal mailing list