ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_CHARGE_DISABLE
Partially taken from commit7c4bd0cdf4("power_supply: support for CHARGE_DISABLE") Change-Id: Icd7574696ada4ea5c7d8811787461bc04c922b3c Signed-off-by: AleX Pelosi <apelosi@google.com> Signed-off-by: Jack Wu <wjack@google.com> Bug: 139264914 Bug: 141347448 (cherry picked from commit7c4bd0cdf4) Signed-off-by: Mark Salyzyn <salyzyn@google.com> Bug: 150789066 Change-Id: I178c16fe01fb262e7d9cca777c49e8ad586e8eba
This commit is contained in:
@@ -464,6 +464,7 @@ static struct device_attribute power_supply_attrs[] = {
|
||||
POWER_SUPPLY_ATTR(comp_clamp_level),
|
||||
POWER_SUPPLY_ATTR(adapter_cc_mode),
|
||||
POWER_SUPPLY_ATTR(skin_health),
|
||||
POWER_SUPPLY_ATTR(charge_disable),
|
||||
/* Charge pump properties */
|
||||
POWER_SUPPLY_ATTR(cp_status1),
|
||||
POWER_SUPPLY_ATTR(cp_status2),
|
||||
@@ -577,6 +578,12 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env)
|
||||
|
||||
attr = &power_supply_attrs[psy->desc->properties[j]];
|
||||
|
||||
if (!attr->attr.name) {
|
||||
dev_info(dev, "%s:%d FAKE attr.name=NULL skip\n",
|
||||
__FILE__, __LINE__, __func__);
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = power_supply_show_property(dev, attr, prop_buf);
|
||||
if (ret == -ENODEV || ret == -ENODATA) {
|
||||
/* When a battery is absent, we expect -ENODEV. Don't abort;
|
||||
|
||||
@@ -335,6 +335,7 @@ enum power_supply_property {
|
||||
POWER_SUPPLY_PROP_COMP_CLAMP_LEVEL,
|
||||
POWER_SUPPLY_PROP_ADAPTER_CC_MODE,
|
||||
POWER_SUPPLY_PROP_SKIN_HEALTH,
|
||||
POWER_SUPPLY_PROP_CHARGE_DISABLE,
|
||||
/* Charge pump properties */
|
||||
POWER_SUPPLY_PROP_CP_STATUS1,
|
||||
POWER_SUPPLY_PROP_CP_STATUS2,
|
||||
|
||||
Reference in New Issue
Block a user