@@ -217,6 +217,9 @@ static struct power_supply_attr power_supply_attrs[] __ro_after_init = {
POWER_SUPPLY_ATTR(MANUFACTURE_YEAR),
POWER_SUPPLY_ATTR(MANUFACTURE_MONTH),
POWER_SUPPLY_ATTR(MANUFACTURE_DAY),
+ POWER_SUPPLY_ATTR(MANUFACTURING_DATE),
+ POWER_SUPPLY_ATTR(FIRST_USAGE_DATE),
+ POWER_SUPPLY_ATTR(STATE_OF_HEALTH),
/* Properties of type `const char *' */
POWER_SUPPLY_ATTR(MODEL_NAME),
POWER_SUPPLY_ATTR(MANUFACTURER),
@@ -170,6 +170,9 @@ enum power_supply_property {
POWER_SUPPLY_PROP_MANUFACTURE_YEAR,
POWER_SUPPLY_PROP_MANUFACTURE_MONTH,
POWER_SUPPLY_PROP_MANUFACTURE_DAY,
+ POWER_SUPPLY_PROP_MANUFACTURING_DATE,
+ POWER_SUPPLY_PROP_FIRST_USAGE_DATE,
+ POWER_SUPPLY_PROP_STATE_OF_HEALTH,
/* Properties of type `const char *' */
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
manufacturing_date/first_usage_date/state_of_health are the battery data required by EU regulations that are accessible for end-users. manufacturing_date is the date of manufacturing of the battery. first_usage_date is the date of first use of the battery after the set-up of the device by the first user. Both dates are the seconds since the epoch (1970-01-01 UTC). state_of_health(SoH) is a figure of merit of the condition of a battery, compared to its ideal conditions. The unit of SoH is percent (100% = the battery's conditions match the battery's specifications). Signed-off-by: ShiChunyong <shichunyong@honor.com> --- drivers/power/supply/power_supply_sysfs.c | 3 +++ include/linux/power_supply.h | 3 +++ 2 files changed, 6 insertions(+)