Re: [PATCH] hwmon: Add power meters to Documentation/hwmon/sysfs-interface

From: Shem Multinymous
Date: Sat Sep 01 2007 - 14:05:52 EST


On 9/1/07, Pavel Machek <pavel@xxxxxx> wrote:
> > diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface
> > index b3a9e1b..da546ce 100644
> > --- a/Documentation/hwmon/sysfs-interface
> > +++ b/Documentation/hwmon/sysfs-interface
> > @@ -304,6 +304,21 @@ curr[1-*]_input Current input value
> > Unit: milliampere
> > RO
> >
> > +*********
> > +* Power *
> > +*********
> > +
> > +power[1-*]_input Current power use
> > + Unit: milliWatt
> > + RO
> > +
> > +power[1-*]_max_input Historical maximum power use
> > + Unit: milliWatt
> > + RO
> > +
> > +power[1-*]_min_input Historical minimum power use
> > + Unit: milliWatt
> > + RO
>
> Should we add power?_10sec_avg_input? IIRC thinkpads export that,
> too.

Indeed, ThinkPads report both instantaneous power/current and a
rolling average (exponentially decaying, I think) over the last ~10
seconds. ACPI provides only the rolling average, and the out-of-tree
tp_smapi driver provides both.

More generally, linux/power_supply.h defines these attributes:

POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_VOLTAGE_AVG,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_CURRENT_AVG,

It would be nice if the power meter interface uses the same
conventions as the power supply interface, since the former is
essentially a subset of the latter. Userspace app that read power
meters via sysfs should work for power supplies too.

Shem
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/