Recent kernel commit breaks battery sensing

Neil Brown neilb at
Wed Mar 4 06:07:51 CET 2009

 the recent kernel commit

   commit b9de904e7aadd7b37c4035fd5d6f59e5f80089b6

removes the line

-#define HDQ_SAMPLE_PERIOD_US   20

from drivers/power/hdq.c
So HDQ_SAMPLE_PERIOD_US gets the value '10' from include/linux/hdq.h

In hdq.c there is a line

		hdq_priv.hdq_ctr = 3000 / HDQ_SAMPLE_PERIOD_US;

which previously resulted in 150, and now results in 300.

As hdq_ctr is an 8 bit value we lose something, and the compiler
Also I cannot read most values from /sys/class/power_supply/battery
I get an error Timer expired.

Restoring the #define makes my battery status visible again, but I
don't know if that is the right fix...

This is on a GTA02.


More information about the openmoko-kernel mailing list