From: Daniel Mack Date: Thu, 23 Jul 2009 18:35:54 +0000 (+0200) Subject: ds2760_battery: implement set_charged() feature X-Git-Tag: v2.6.32-rc1~158^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d631ccff8d90fce77b42f01b3872595c599cbf9;p=pandora-kernel.git ds2760_battery: implement set_charged() feature The ds2760's internal current meter is not reliable enough as it has an inacurracy of around ~15%. Without any correction for that error, the current accumulator is couting up all the time, even though the battery is already fully charged and hence destroys the static information. The longer it is connected, the worse is the aberration. Fortunately, this can be corrected by the DS2760_CURRENT_OFFSET_BIAS register. Using the external power_supply_set_battery_charged() function, this register is now gauging the measurement. A delayed work is used to debounce flaky GPIO signals and to let the current value settle. Also see Maxim's application note AN4188. Signed-off-by: Daniel Mack Cc: Szabolcs Gyurko Cc: Matt Reimer Cc: Anton Vorontsov Signed-off-by: Anton Vorontsov --- Reading git-diff-tree failed