diff options
author | Fenglin Wu <fenglinw@codeaurora.org> | 2017-04-25 20:51:06 +0800 |
---|---|---|
committer | Abhijeet Dharmapurikar <adharmap@codeaurora.org> | 2017-05-01 19:37:08 -0700 |
commit | 2fc978c8b7b8cbd66a578b02a43e365d1ad3746c (patch) | |
tree | 21d4b235b42ed7adb11594b5d3b196fbb0ce3c8e | |
parent | 38d7ef50d6698748b49200363de70c97325fc098 (diff) |
power_supply: Add REAL_TYPE power_supply_property
Add REAL_TYPE power_supply property to record the real time charger
type.
Change-Id: I5fb2e3e3e782bcac0f8dd6071a830bcf370ebbd4
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 4 | ||||
-rw-r--r-- | include/linux/power_supply.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 723b9eaf658a..8d7322a325de 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -114,7 +114,8 @@ static ssize_t power_supply_show_property(struct device *dev, return sprintf(buf, "%s\n", technology_text[value.intval]); else if (off == POWER_SUPPLY_PROP_CAPACITY_LEVEL) return sprintf(buf, "%s\n", capacity_level_text[value.intval]); - else if (off == POWER_SUPPLY_PROP_TYPE) + else if (off == POWER_SUPPLY_PROP_TYPE || + off == POWER_SUPPLY_PROP_REAL_TYPE) return sprintf(buf, "%s\n", type_text[value.intval]); else if (off == POWER_SUPPLY_PROP_SCOPE) return sprintf(buf, "%s\n", scope_text[value.intval]); @@ -294,6 +295,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(connector_health), POWER_SUPPLY_ATTR(ctm_current_max), POWER_SUPPLY_ATTR(hw_current_max), + POWER_SUPPLY_ATTR(real_type), /* Local extensions of type int64_t */ POWER_SUPPLY_ATTR(charge_counter_ext), /* Properties of type `const char *' */ diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 7488bb993d7a..aa8edf9928eb 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -247,6 +247,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_CONNECTOR_HEALTH, POWER_SUPPLY_PROP_CTM_CURRENT_MAX, POWER_SUPPLY_PROP_HW_CURRENT_MAX, + POWER_SUPPLY_PROP_REAL_TYPE, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ |