Commit c7cc930f9a5c26385a08cd7dc28cb5e3ed186d72

Authored by Dmitry Baryshkov
Committed by Anton Vorontsov
1 parent 9ef4510626

power_supply: add few more values and props

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 <dbaryshkov@gmail.com>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>

Showing 3 changed files with 11 additions and 1 deletions Side-by-side Diff

Documentation/power_supply_class.txt
... ... @@ -87,6 +87,10 @@
87 87 Battery driver also can use this attribute just to inform userspace
88 88 about maximal and minimal voltage thresholds of a given battery.
89 89  
  90 +VOLTAGE_MAX, VOLTAGE_MIN - same as _DESIGN voltage values except that
  91 +these ones should be used if hardware could only guess (measure and
  92 +retain) the thresholds of a given power supply.
  93 +
90 94 CHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGN - design charge values, when
91 95 battery considered full/empty.
92 96  
drivers/power/power_supply_sysfs.c
... ... @@ -48,7 +48,8 @@
48 48 "Unspecified failure"
49 49 };
50 50 static char *technology_text[] = {
51   - "Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd"
  51 + "Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd",
  52 + "LiMn"
52 53 };
53 54 ssize_t ret;
54 55 struct power_supply *psy = dev_get_drvdata(dev);
... ... @@ -84,6 +85,8 @@
84 85 POWER_SUPPLY_ATTR(present),
85 86 POWER_SUPPLY_ATTR(online),
86 87 POWER_SUPPLY_ATTR(technology),
  88 + POWER_SUPPLY_ATTR(voltage_max),
  89 + POWER_SUPPLY_ATTR(voltage_min),
87 90 POWER_SUPPLY_ATTR(voltage_max_design),
88 91 POWER_SUPPLY_ATTR(voltage_min_design),
89 92 POWER_SUPPLY_ATTR(voltage_now),
include/linux/power_supply.h
... ... @@ -54,6 +54,7 @@
54 54 POWER_SUPPLY_TECHNOLOGY_LIPO,
55 55 POWER_SUPPLY_TECHNOLOGY_LiFe,
56 56 POWER_SUPPLY_TECHNOLOGY_NiCd,
  57 + POWER_SUPPLY_TECHNOLOGY_LiMn,
57 58 };
58 59  
59 60 enum power_supply_property {
... ... @@ -63,6 +64,8 @@
63 64 POWER_SUPPLY_PROP_PRESENT,
64 65 POWER_SUPPLY_PROP_ONLINE,
65 66 POWER_SUPPLY_PROP_TECHNOLOGY,
  67 + POWER_SUPPLY_PROP_VOLTAGE_MAX,
  68 + POWER_SUPPLY_PROP_VOLTAGE_MIN,
66 69 POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
67 70 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
68 71 POWER_SUPPLY_PROP_VOLTAGE_NOW,