These patches allow reasonably accurate voltage, current and power
consumption measurements on at least some of the Allwinner A10/A20 based
development boards using lm-sensors or by directly reading from sysfs.

So that some basic power consumption measurements can be done even by ordinary
users. Without access to lab power supplies, multimeters, cutting wires
and/or soldering :-)

These patches are also available here:
    https://github.com/ssvb/linux-sunxi/commits/20140401-axp209-hwmon-v2

Example of a Cubietruck running under heavy load:

    $ sensors
    axp20_mfd-i2c-0-34
    Adapter: sunxi-i2c.0
    ACIN voltage:        +5.03 V  (avg =  +5.01 V)
    AXP20X temperature:  +57.6 C  (low  = -144.7 C, high = +264.8 C)
    ACIN power:           3.02 W  (avg =   3.50 W)
    ACIN current:        +0.60 A  (avg =  +0.70 A)

For testing it is possible to run something like:

    $ while sleep 5; do sensors; done;

And then try different CPU / GPU workloads. The reported 'avg' numbers
on the Cubietruck and on the A10-LIME should be pretty close to the numbers
measured by other methods (no more than 10% difference observed in my
tests). However there are some limitations. For example, USB peripherals
are apparently bypassing AXP209 on the Cubietruck and are not accounted
for. There is no such problem with the A10-LIME.

Some other devices (such as Cubieboard2 and Mele A2000) are showing
unrealistically low current draw. Apparently even more stuff is bypassing
AXP209 there. Or maybe just the calibration is off.

If anyone also has some means to measure voltage/current on some sunxi
hardware, please compare it with the information reported by the 'sensors'
tool after applying these patches and report your findings. Thanks.


v2: The decision whether to run periodic sampling is now fully
    automatic. No configuration is needed. And no parasitic background
    activity is expected when nobody is interested in axp20x hwmon
    sysfs data.

Siarhei Siamashka (4):
  sunxi: axp20x: Fix misuse of the lowest 4-bits of temperature ADC
  sunxi: axp20x: Human readable label for the temperature sensor
  sunxi: axp20x: Report voltage, current and power for ACIN connector
  sunxi: axp20x: Calculate moving average for ACIN voltage/current/power

 drivers/power/axp_power/axp-mfd.c   |   4 +
 drivers/power/axp_power/axp20-mfd.h | 156 ++++++++++++++++++++++++++++++++----
 include/linux/mfd/axp-mfd.h         |   6 ++
 3 files changed, 149 insertions(+), 17 deletions(-)

-- 
1.8.3.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to