Recent kernel commit breaks battery sensing
neilb at suse.de
Wed Mar 4 11:52:38 CET 2009
On Wednesday March 4, andy at openmoko.com wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Somebody in the thread at some point said:
> | Hi,
> | 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
> | complains.
> | 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 my fault, I fixed it on andy-tracking by reducing the 3ms
> timeout to 2.5ms with a reported-by for yourself.
Thanks... only that doesn't fix it.
I couldn't actually try the patch in-situ as
breaks all sorts of things.
The accelerometers don't work:
lis302dl spi3.0: unknown who_am_i signature 0xff
The FIQ (??) doesn't work
Count not initialize FIQ for GTA02
and the battery doesn't appear at all:
# ls -l /sys/class/power_supply/
drwxr-xr-x 3 root root 0 Mar 4 21:33 ac
drwxr-xr-x 3 root root 0 Mar 4 21:33 adapter
drwxr-xr-x 3 root root 0 Mar 4 21:33 usb
So I applied your one-line change to the previous commit.
It got rid of the compiler warning, but not the error when reading the
I only have success if I restore the #define.
Is this 20usec or 10usec timer the one set up by
gta02_fiq_enable in mach-gta02.c??? That says something about 32usec.
I think I'm totally confused.
More information about the openmoko-kernel