[Gta04-owner] gta04-owner at goldelico.com

Dr. H. Nikolaus Schaller hns at goldelico.com
Thu Mar 27 17:03:21 CET 2014


Hi,

Am 27.03.2014 um 16:48 schrieb Alexandre Roumiantsev:

> Hello, Lukas.
> 
>>> 2) I get some success with bq27x00_battery.c Thank you for pointing.
>> I have played around pointed 
>>> places, but did not collect it together. I am doing testing now and will prepare patch after finish.
>>> Sorry for delay, I have busy week.
>> 
>> No need to rush, I'm glad it is working out :)
>> I'm looking forward to your patch.
> 
> I have tested a patch for bq27x00_battery.c, which allow see battery
> status in real time. Find it in attachment. I really follow the Paul
> Kocialkowski patch for Replicant-2.3
> The build with this patch you can find here:
> https://drive.google.com/file/d/0B-rRgKAzYyoBMmtMLUhlS29VWXc/edit?usp=sharing
> 
> Best regards, Alexandre
> <parch>

Thanks for the patch!

But I wonder why you are doing this?

There appear to be two changes:

a) reducing the default poll interval by factor 6

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.

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.

BR,
Nikolaus


--- replicant-4.2/kernel/goldelico/gta04/drivers/power/bq27x00_battery.c	2014-03-14 11:33:22.409449005 +0400
+++ my/kernel/goldelico/gta04/drivers/power/bq27x00_battery.c	2014-03-26 21:29:05.000000000 +0400
@@ -155,7 +155,7 @@
 	POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
 };
 
-static unsigned int poll_interval = 360;
+static unsigned int poll_interval = 60;
 module_param(poll_interval, uint, 0644);
 MODULE_PARM_DESC(poll_interval, "battery poll interval in seconds - " \
 				"0 disables polling");
@@ -464,11 +464,11 @@
 
 	flags_changed = di->cache.flags ^ cache.flags;
 	di->cache = cache;
-	if (is_bq27500)
+/*	if (is_bq27500)
 		flags_changed &= BQ27500_FLAGS_IMPORTANT;
 	else
-		flags_changed &= BQ27000_FLAGS_IMPORTANT;
-	if (flags_changed)
+		flags_changed &= BQ27000_FLAGS_IMPORTANT; 
+	if (flags_changed) */
 		power_supply_changed(&di->bat);
 
 	di->last_update = jiffies;



More information about the Gta04-owner mailing list