Hi,

I am giving a refresh to the GNUstep BatteryMonitor [*] and was checking
its support to PMU. Right now it ignores battery flags and thought of
using them, but they appear to give bad data on my iBook.

I found in the linux kernel doc
https://elixir.bootlin.com/linux/latest/source/drivers/macintosh/via-pmu.c
This explanation of the flags:
        /* format:
         *  [0]    :  flags
         *    0x01 :  AC indicator
         *    0x02 :  charging
         *    0x04 :  battery exist
         *    0x08 :
         *    0x10 :
         *    0x20 :  full charged
         *    0x40 :  pcharge reset
         *    0x80 :  battery exist
         *
         *  [1][2] :  battery voltage
         *  [3]    :  CPU temperature
         *  [4]    :  battery temperature
         *  [5]    :  current
         *  [6][7] :  pcharge
         *              --tkoba

However, if I check the flags exposed, they seem bogus and never updated:

Charging:
cat /proc/pmu/battery_0

flags      : 00000011
charge     : 3819
max_charge : 3819
current    : 0
voltage    : 16739
time rem.  : 0


Discharging:
cat /proc/pmu/battery_0

flags      : 00000011
charge     : 3796
max_charge : 3819
current    : -739
voltage    : 16392
time rem.  : 18492


So I am unable (except checking for current flow) if I am really
connected to mains, if it is charging or not. Anybody has ideas here?
Maybe a bug? I am interestd in 0,1,2 & 7

Riccardo

[*] https://svn.savannah.gnu.org/viewvc/gap/trunk/system-apps/batmon/

Reply via email to