Skip to content

Commit

Permalink
power_supply: add few more values and props
Browse files Browse the repository at this point in the history
Add LiMn (one of the most common for small non-rechargable batteries)
battery technology and voltage_min/_max properties support.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
  • Loading branch information
lumag authored and enomsg committed Feb 1, 2008
1 parent 9ef4510 commit c7cc930
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Documentation/power_supply_class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ batteries use voltage for very approximated calculation of capacity.
Battery driver also can use this attribute just to inform userspace
about maximal and minimal voltage thresholds of a given battery.

VOLTAGE_MAX, VOLTAGE_MIN - same as _DESIGN voltage values except that
these ones should be used if hardware could only guess (measure and
retain) the thresholds of a given power supply.

CHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGN - design charge values, when
battery considered full/empty.

Expand Down
5 changes: 4 additions & 1 deletion drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ static ssize_t power_supply_show_property(struct device *dev,
"Unspecified failure"
};
static char *technology_text[] = {
"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd"
"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd",
"LiMn"
};
ssize_t ret;
struct power_supply *psy = dev_get_drvdata(dev);
Expand Down Expand Up @@ -84,6 +85,8 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(present),
POWER_SUPPLY_ATTR(online),
POWER_SUPPLY_ATTR(technology),
POWER_SUPPLY_ATTR(voltage_max),
POWER_SUPPLY_ATTR(voltage_min),
POWER_SUPPLY_ATTR(voltage_max_design),
POWER_SUPPLY_ATTR(voltage_min_design),
POWER_SUPPLY_ATTR(voltage_now),
Expand Down
3 changes: 3 additions & 0 deletions include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum {
POWER_SUPPLY_TECHNOLOGY_LIPO,
POWER_SUPPLY_TECHNOLOGY_LiFe,
POWER_SUPPLY_TECHNOLOGY_NiCd,
POWER_SUPPLY_TECHNOLOGY_LiMn,
};

enum power_supply_property {
Expand All @@ -63,6 +64,8 @@ enum power_supply_property {
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_ONLINE,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_VOLTAGE_MIN,
POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
Expand Down

0 comments on commit c7cc930

Please sign in to comment.