sysfs attribute current_now is removed in 2.6.36 (upower)

Richard Hughes hughsient at
Tue Jan 4 01:29:15 PST 2011

On 28 December 2010 00:50, Florian Eitel <feitel at> wrote:
> 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.

Cool. I guess we can drop current_now from upower sometime in 2012.

> 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.

The problem with current_now was that the units were undefined.
Depending on whether the battery was reporting in mWh or mAh it could
have different units. The second hunk detects if energy_now is zero
(i.e. no mWh reporting) and instead uses charge_now and converts it to
mWh using the voltage. If we're doing this, we also need to scale the
rate to also be in mWh, hence using the voltage.

I've pushed my patch to master. Many thanks.


More information about the devkit-devel mailing list