Add four new members to the POWER_SUPPLY_TECHNOLOGY
enum and sysfs interface to represent the Smart Battery
Data Specification v1.1 (Section 5.1.30 DeviceChemistry) battery types:

 - Lead Acid (PbAc)
 - Nickel Zinc (NiZn)
 - Rechargeable Alkaline-Manganese (RAM)
 - Zinc Air (ZnAr)

Update documentation to express these types.
Update ABI testing for these types.

Link: https://sbs-forum.org/specs/sbdat110.pdf
Signed-off-by: Boris Shtrasman <[email protected]>
---
 Documentation/ABI/testing/sysfs-class-power                   | 2 +-
 drivers/power/supply/power_supply_sysfs.c                     | 4 ++++
 include/linux/power_supply.h                                  | 4 ++++
 .../selftests/power_supply/test_power_supply_properties.sh    | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-class-power 
b/Documentation/ABI/testing/sysfs-class-power
index 32697b926cc8..5641f1fd5fd6 100644
--- a/Documentation/ABI/testing/sysfs-class-power
+++ b/Documentation/ABI/testing/sysfs-class-power
@@ -525,7 +525,7 @@ Description:
 
                Valid values:
                              "Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe",
-                             "NiCd", "LiMn"
+                             "NiCd", "LiMn", "PbAc", "NiZn", "RAM", "ZnAr"
 
 
 What:          /sys/class/power_supply/<supply_name>/voltage_avg,
diff --git a/drivers/power/supply/power_supply_sysfs.c 
b/drivers/power/supply/power_supply_sysfs.c
index f30a7b9ccd5e..9d6b24856c8b 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -124,6 +124,10 @@ 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_PbAc]          = "PbAc",
+       [POWER_SUPPLY_TECHNOLOGY_NiZn]          = "NiZn",
+       [POWER_SUPPLY_TECHNOLOGY_RAM]           = "RAM",
+       [POWER_SUPPLY_TECHNOLOGY_ZnAr]          = "ZnAr",
 };
 
 static const char * const POWER_SUPPLY_CAPACITY_LEVEL_TEXT[] = {
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 7a5e4c3242a0..034800cd21da 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -83,6 +83,10 @@ enum {
        POWER_SUPPLY_TECHNOLOGY_LiFe,
        POWER_SUPPLY_TECHNOLOGY_NiCd,
        POWER_SUPPLY_TECHNOLOGY_LiMn,
+       POWER_SUPPLY_TECHNOLOGY_PbAc,
+       POWER_SUPPLY_TECHNOLOGY_NiZn,
+       POWER_SUPPLY_TECHNOLOGY_RAM,
+       POWER_SUPPLY_TECHNOLOGY_ZnAr,
 };
 
 enum {
diff --git 
a/tools/testing/selftests/power_supply/test_power_supply_properties.sh 
b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
index a66b1313ed88..1ebac6fe5d23 100755
--- a/tools/testing/selftests/power_supply/test_power_supply_properties.sh
+++ b/tools/testing/selftests/power_supply/test_power_supply_properties.sh
@@ -74,7 +74,8 @@ 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","PbAc","NiZn","RAM","ZnAr"
 
        test_sysfs_prop_optional cycle_count
 
-- 
2.47.3


Reply via email to