Re: [PATCH] ds2760_battery: fix calculation of time_to_empty_now



On Fri, Nov 12, 2010 at 11:36:22AM +0100, Sven Neumann wrote:
A check against division by zero was modified in commit b0525b48.
Since this change time_to_empty_now is always reported as zero
while the battery is discharging and as a negative value while
the battery is charging. This is because current is negative while
the battery is discharging.

Fix the check introduced by commit b0525b48 so that time_to_empty_now
is reported correctly during discharge and as zero while charging.

Signed-off-by: Sven Neumann <s.neumann@xxxxxxxxxxxx>
Acked-by: Daniel Mack <daniel@xxxxxxxx>

Applied (with Cc: stable@xxxxxxxxxx [2.6.32..2.6.36]).

Thanks!

--
Anton Vorontsov
email: cbouatmailru@xxxxxxxxx
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [PATCH] ds2760_battery: fix calculation of time_to_empty_now
    ... A check against division by zero was modified in commit b0525b48. ... while the battery is discharging and as a negative value while ... the battery is charging. ...
    (Linux-Kernel)
  • Re: Best place for replacement laptop batteries
    ... website says you can manually calibrate a battery by charging it ... fully, discharging it fully, then charging it fully again, so I will ... but discharging it further externally after the PC cuts off. ... it's not dying of old age. ...
    (uk.comp.homebuilt)
  • Re: Best place for replacement laptop batteries
    ... website says you can manually calibrate a battery by charging it ... fully, discharging it fully, then charging it fully again, so I will ... but discharging it further externally after the PC cuts off. ... Be aware that doing that may break the battery ...
    (uk.comp.homebuilt)
  • [PATCH 1/1] power: bq20z75: Update return value of CURRENT NOW
    ... The BQ20Z75 will return a negative value for current if the battery is ... discharging and a positive value if charging. ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: What is the perfect propulsion system
    ... electric forklift trucks a battery charge now lasts far longer. ... If one has a diesel charging unit, sound insulated and hospital exhaust system capable of charging the batteries in say 6 hours or boosting electric capacity for cooking, heating etc. ... under regular discharging use (for it to last longer, ... electricity storage technology, then the approach you describe would ...
    (uk.rec.waterways)