@@ -488,7 +488,7 @@ Description:
Valid values:
"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe",
- "NiCd", "LiMn"
+ "NiCd", "LiMn", "Capacitor"
What: /sys/class/power_supply/<supply_name>/voltage_avg,
@@ -686,6 +686,8 @@ int power_supply_get_battery_info(struct power_supply *psy,
info->technology = POWER_SUPPLY_TECHNOLOGY_LiFe;
else if (!strcmp("lithium-ion-manganese-oxide", value))
info->technology = POWER_SUPPLY_TECHNOLOGY_LiMn;
+ else if (!strcmp("capacitor", value))
+ info->technology = POWER_SUPPLY_TECHNOLOGY_CAPACITOR;
else
dev_warn(&psy->dev, "%s unknown battery type\n", value);
}
@@ -119,6 +119,7 @@ static const char * const POWER_SUPPLY_TECHNOLOGY_TEXT[] = {
[POWER_SUPPLY_TECHNOLOGY_LiFe] = "LiFe",
[POWER_SUPPLY_TECHNOLOGY_NiCd] = "NiCd",
[POWER_SUPPLY_TECHNOLOGY_LiMn] = "LiMn",
+ [POWER_SUPPLY_TECHNOLOGY_CAPACITOR] = "Capacitor",
};
static const char * const POWER_SUPPLY_CAPACITY_LEVEL_TEXT[] = {
@@ -78,6 +78,7 @@ enum {
POWER_SUPPLY_TECHNOLOGY_LiFe,
POWER_SUPPLY_TECHNOLOGY_NiCd,
POWER_SUPPLY_TECHNOLOGY_LiMn,
+ POWER_SUPPLY_TECHNOLOGY_CAPACITOR,
};
enum {
@@ -74,7 +74,7 @@ for DEVNAME in $supplies; do
test_sysfs_prop_optional model_name
test_sysfs_prop_optional manufacturer
test_sysfs_prop_optional serial_number
- test_sysfs_prop_optional_list technology "Unknown","NiMH","Li-ion","Li-poly","LiFe","NiCd","LiMn"
+ test_sysfs_prop_optional_list technology "Unknown","NiMH","Li-ion","Li-poly","LiFe","NiCd","LiMn","Capacitor"
test_sysfs_prop_optional cycle_count
Another technology to store energy is a (super)capacitor. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> --- (no changes since v1) Documentation/ABI/testing/sysfs-class-power | 2 +- drivers/power/supply/power_supply_core.c | 2 ++ drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 1 + .../selftests/power_supply/test_power_supply_properties.sh | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-)