From 55d9887cf9debaf3db2a8d37fe71653debd41e65 Mon Sep 17 00:00:00 2001 From: Sahil Chandna Date: Wed, 24 Apr 2019 19:07:16 +0530 Subject: [PATCH] ANDROID: GKI: power_supply: Add properties to support PPS constant current(CC) mode Add power supply properties to support PPS CC mode charging for dual charge pumps with MID-VBAT configuration, these properties are set from user space. Signed-off-by: Sahil Chandna (cherry picked from commit 04e367f45dbd8ecd4a67ce1cc7d5cd11bb8a49e9) Signed-off-by: Mark Salyzyn Bug: 150789066 Change-Id: Ia2d467255818dbaaf2d87f56aae39584368772ce --- drivers/power/supply/power_supply_sysfs.c | 4 ++++ include/linux/power_supply.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index ed71c35342c9..6028674487be 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -458,6 +458,10 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(dc_reset), POWER_SUPPLY_ATTR(voltage_max_limit), POWER_SUPPLY_ATTR(real_capacity), + POWER_SUPPLY_ATTR(force_main_icl), + POWER_SUPPLY_ATTR(force_main_fcc), + POWER_SUPPLY_ATTR(comp_clamp_level), + POWER_SUPPLY_ATTR(adapter_cc_mode), /* Charge pump properties */ POWER_SUPPLY_ATTR(cp_status1), POWER_SUPPLY_ATTR(cp_status2), diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index dd1924e08624..30c49b7dfdea 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -330,6 +330,10 @@ enum power_supply_property { POWER_SUPPLY_PROP_DC_RESET, POWER_SUPPLY_PROP_VOLTAGE_MAX_LIMIT, POWER_SUPPLY_PROP_REAL_CAPACITY, + POWER_SUPPLY_PROP_FORCE_MAIN_ICL, + POWER_SUPPLY_PROP_FORCE_MAIN_FCC, + POWER_SUPPLY_PROP_COMP_CLAMP_LEVEL, + POWER_SUPPLY_PROP_ADAPTER_CC_MODE, /* Charge pump properties */ POWER_SUPPLY_PROP_CP_STATUS1, POWER_SUPPLY_PROP_CP_STATUS2,