Skip to contentSkip to conversation

spitz: better voltage-to-percentage conversion

PATCH New Pavel Machek 1 participant 1 message Nov 29, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spitz: better voltage-to-percentage conversion

Old code has two huge tables... unfortunately those tables are simple linear relationships and wrong: li-ions do not behave like that.

Convert physical values to mV,mA,mOhm, add computation that makes sense for physical point of view, and provide tables based on measurements.

To get even better results, we should provide better battery_current estimate (taking backlight into account), and adjust adjust battery_resistance according to its age and temperature.

(Now with fixed spelling).

arch/arm/mach-pxa/corgi_pm.c +0 -1
@@ -215,7 +215,6 @@
 	.fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
 	.bat_levels       = 40,
 	.bat_levels_noac  = sharpsl_battery_levels_noac,
-	.bat_levels_acin  = sharpsl_battery_levels_acin,
 	.status_high_acin = 188,
 	.status_low_acin  = 178,
 	.status_high_noac = 185,
arch/arm/mach-pxa/sharpsl_pm.c +71 -88

177 lines not on this page · raw message

arch/arm/mach-pxa/spitz_pm.c +0 -1
@@ -209,7 +209,6 @@
 	.fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
 	.bat_levels       = 40,
 	.bat_levels_noac  = sharpsl_battery_levels_noac,
-	.bat_levels_acin  = sharpsl_battery_levels_acin,
 	.status_high_acin = 188,
 	.status_low_acin  = 178,
 	.status_high_noac = 185,
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html