[Gta04-owner] bq27x00 driver for Replicant

Dr. H. Nikolaus Schaller hns at goldelico.com
Mon Mar 31 20:57:12 CEST 2014


Am 31.03.2014 um 17:02 schrieb Lukas Maerdian:

> 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

yes, charging/not charging status comes from the usb charger driver and not the hdq battery.

how does replicant wait/look for events? Are there udev rules/triggers for battery monitoring?

> 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
> _______________________________________________
> Gta04-owner mailing list
> Gta04-owner at goldelico.com
> http://lists.goldelico.com/mailman/listinfo/gta04-owner



More information about the Gta04-owner mailing list