2009/11/5 Antonio Ospite <osp...@studenti.unina.it>: > On Thu, 5 Nov 2009 10:21:32 +0100 > Antonio Ospite <osp...@studenti.unina.it> wrote: > >> Hi, >> >> I enabled pcap-battery on a780, just to see what happened and I get >> this: >> >> pgd = c0004000 >> [00000030] *pgd=00000000 >> Internal error: Oops: f5 [#1] PREEMPT >> last sysfs file: >> Modules linked in: >> CPU: 0 Not tainted (2.6.32-rc6-ezxdev #12) >> PC is at regulator_is_enabled+0x8/0x40 >> LR is at pcap_bat_update+0xac/0xf0 > ... >> >> Will look at it later, but if anyone wants to anticipate me... :) >> > > With this change I can use the module: > > diff --git a/drivers/power/pcap_battery.c b/drivers/power/pcap_battery.c > index f90d685..1d42207 100644 > --- a/drivers/power/pcap_battery.c > +++ b/drivers/power/pcap_battery.c > @@ -104,7 +104,7 @@ static void pcap_bat_update(struct pcap_bat_struct *bat) > > old = bat->status; > > - if(IS_ERR(bat->reg)) { > + if(bat->reg == NULL) { > bat->status = POWER_SUPPLY_STATUS_UNKNOWN; > return; > } > > Is this OK?
i`l check it later. maby somethibg should be fixed in probe. > Even if battery status is always unknown it looks like it still reports > voltage and temperature. Is voltage_now the current charge _level_? its unknown, because of missing eoc_regulator. yep, voltage_now is charge_level. btw, native ezx software used some calibration data from bp to convert voltage into charge percents. > Is there a way to read the _instant_ power consumption? I mean, in > order to see if there is some power leakage, or to compare power > consumption with some subsystem powered on or off. yep. there is adc channel for this. look at res[1] in pcap_show_adc_battcurr() from old ezx-pcap [0] >Ilya, can you post the script you used to capture the charge level over time? it was simple: while true do echo $(date +%s) $(cat /sys/blah-blah-blah-blah/voltage_now) sleep 60 done btw, i used raw voltage value without PCAP_ADC_TO_mV to use same values as on ezx. >BTW, what about splitting pcap_battery and eoc_battery (or eoc_charger)? maby its good, but i dunno, how to make cross-references in two modules :) charger should know battery level and battery should know charger state. [0] http://git.openezx.org/openezx.git?a=blob;f=drivers/mfd/ezx-pcap.c;h=836a9ed0cc9024e96fb16ff09772b0845afbc411;hb=f284d7d4a5ab75fb012ebd1274d8a9fa27aec171 btw, can you fix tg branch ezx/eoc_charger. looks like i missed something this time. i created it as child of ezx/eoc but it didnt apper in ezx/current after tg update -- wbr, Ilya ICQ: none, Jabber: ilya.muro...@jabber.ru