From e419098deb39da9a1ce31ce9e1d65c2f665a4638 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Thu, 14 Feb 2019 20:17:18 -0800 Subject: [PATCH] ANDROID: GKI: power_supply: Add local extensions of string property names properly For displaying local extensions of properties in string format, add them between MODEL_NAME and SERIAL_NUMBER. Otherwise, those properties would be represented as integer. Signed-off-by: Subbaraman Narayanamurthy (cherry picked from commit ee0f7c41453f8b9c71f3ffb0c124f6ea5708513e) Signed-off-by: Mark Salyzyn Bug: 150789066 Change-Id: Iddb34d7ee6f520b789bc2e085ada4053343538f0 --- drivers/power/supply/power_supply_sysfs.c | 2 +- include/linux/power_supply.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index 4af318a5f8ed..5917b2636e80 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -466,9 +466,9 @@ static struct device_attribute power_supply_attrs[] = { /* Properties of type `const char *' */ POWER_SUPPLY_ATTR(model_name), POWER_SUPPLY_ATTR(manufacturer), - POWER_SUPPLY_ATTR(serial_number), POWER_SUPPLY_ATTR(battery_type), POWER_SUPPLY_ATTR(cycle_counts), + POWER_SUPPLY_ATTR(serial_number), }; static struct attribute * diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 0a276d4b5b0e..100247cbb605 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -338,9 +338,13 @@ enum power_supply_property { /* Properties of type `const char *' */ POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_MANUFACTURER, - POWER_SUPPLY_PROP_SERIAL_NUMBER, POWER_SUPPLY_PROP_BATTERY_TYPE, POWER_SUPPLY_PROP_CYCLE_COUNTS, + /* + * Add local extensions for properties with string values between + * MODEL_NAME and SERIAL_NUMBER. Don't add below SERIAL_NUMBER. + */ + POWER_SUPPLY_PROP_SERIAL_NUMBER, }; enum power_supply_type {