sysfs attribute current_now is removed in 2.6.36 (upower)

Florian Eitel feitel at indeedgeek.de
Mon Dec 27 16:50:40 PST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am Mon, 27 Dec 2010 19:23:44 +0000
schrieb Richard Hughes <hughsient at gmail.com>:
> Sorry for the delay. I've been dealing with a family death and then
> Christmas got in the way. I think the attached patch is better, as it
> supports the fallback to old kernels and also deals with mAh reporting
> systems. Can you please test this. Thanks.

Fist of all: Your patch works for me as well.

But something I doesn't understand. I missunderstood my links to kernel
commits. In my opinion current_now is removed completely. But you are
right: power_now replaces current_now only if the value is reported in
uWh. So since 2.6.30 either current_now (reporting uWh) or power_now
(reporting uVh) exists. Both files must be handled and my patch is
incorrect.

But however I doesn't understand your patch fully. In my opinion it
should be:

(voltage = present voltage calculated line 580)
energy_rate = (power_now exists) ? power_now : (current_now * voltage)
energy      = voltage * ((charge_now exists)? charge_now : charge_avg)

But you uses voltage_design instead of voltage mixed up energy and
energy_rate. "energy_rate *= voltage_design" should be independent of
charge_{now,avg} and not mixed in if conditions.

Sorry, I doesn't tried to understand the whole function so if I'm wrong
please ignore me ;-). As far as I can test it, it works for me. But my
battery uses energy_battery_props.

Thanks,
Florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)

iQIcBAEBCAAGBQJNGTRhAAoJEDG1ZAdA+6K+i5QQAMhRsV1rbUouYPbAk4toizn6
Rk15ivwckjmiXGt4fzb1t43kqiuSi4VrXInJ7EtX5dwt9QbWgxeMlZbpeY7ZWbS5
YdIeX8pSZTQWwfD2LDZCU/PjTgadgZOwAKhdECGNUnryKxUvDF9Kg+AZSnRsXi9N
UnBIm8MuhpY7ESQQxBkBY13LWJIYX2DfBQG2gUXgqb2Pt0zWRu7i5uE0SJUDBiJi
VaJI+RLapC/Ud07/sHdtCxmGa1qHs6TMFRrO9ZMWKFB38Rs+CJzk3FV2m23U3dBO
0X0yYwG553pCz7QeKk3bQq8/Fr/oY+vgtWJN+3IZSeIIUD0pQIGsnMF/oUoaqdFA
QDvlIW9rQhYyveqIR94xuOuzN3q36droZPWFp1MlsYEL0gld/XES5+SOj2qR7MF0
o2ID38Gier2lE14X4Kd33bjbE8TIXHTH/7AENRGZtVDTDKG54djOyr+3vGK2haUE
OsR8Y4xhchk2NVORk7WQ8ahEnmZfoKCvEn3hFlQul47TxFqSrTnsDYlPv1a6rJxa
NU+nm4+Sd3sQXdTvCE7RQOzhmruzXUj9nx7fZ4TY5wZTKZagacl6rBikOLpKX1WE
FxMmH7JJm+8dA4wPnOZlpo06rFELa9bvBFc7CHj4X+NNTNBziDPu2d395jRGkOiy
o6w9R7rBXFys8ZhMeDCC
=v49F
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PATCH-Support-the-power_now-sysfs-attribute-to-get-t.patch
Type: text/x-patch
Size: 2598 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/devkit-devel/attachments/20101228/0549ca22/attachment.bin>


More information about the devkit-devel mailing list