[Gta04-owner] bq27x00 driver for Replicant

Lukas Maerdian luk at slyon.de
Mon Mar 31 17:02:08 CEST 2014


Hi!

2014-03-27 19:07 GMT+01:00 Dr. H. Nikolaus Schaller <hns at goldelico.com>:
>>> And, the battery poll interval can be set from user space when modprobing the module.
>>> Simply give the module a parameter "poll_interval=60" but leave the kernel driver as it is.
>>
>> I agree that it possible to do as module parameter.
>
> That is the way it should be done. Otherwise it will boomerang back to us as soon as we
> want to get something upstream.

I agree, too. It can also be done through sysfs, by writing the interval to:
/sys/module/bq27x00_battery/parameters/poll_interval

Maybe that can be done in the init.gta04.rc file?

>>> b) you disable the caching mechanism (which checks for relevant bits) and always notify power_supply_changed()
>>>
>>> I doubt this is acceptable because I don't see what this has to do with battery status in real time.
>>> If there is no change reported from the battery there is no change to be reported to user space...
>>>
>>> So if you are missing updates, there might be something wrong with the bits reported by the bq27000
>>> and that should be fixed.
>>
>> I think so, but I repeat that battery technical detail is new for me and I would like that
>> somebody, who knows technical well give explanation.
>
> I assume that the battery driver has gone through a lot of reviews since it is part of the
> official kernel.org tree. Therefore it must be quite correct and has not been changed recently.
>
> We can also look into the data sheet to better understand how it works.
>
> BTW: git blame drivers//power/bq27x00_battery.c
>
> tells that Neil Brown has added this caching. I hope he is still reading this list
> and can comment.
>
>> I only can tell, that according my testing only both changes together give a result
>> ( could see battery status in real time ).
>
> I don't doubt that it solves the problem.
>
> The question is if it is the right way to solve it or if it just interacts with some other bug
> in a positive way.
>
> But I think now since we know that disabling the battery driver caching solves the
> problem it may help to understand why the user space is not getting regular updates
> without the patch.

I can confirm that there are no updates coming from the
bq27x00_battery.c driver. My assumption even is that the
charging/not-charging/full events (which are recognized) are coming
directly from the TWL4030 and not from the BQ27000. In this case the
BQ27000 wouldn't send any updates.

I've CCed Neil Brown, maybe he knows what's going wrong in the
bq27x00_battery.c code in our 3.12-replicant4 kernel?

BR,
  Lukas


More information about the Gta04-owner mailing list