From 48c932ac02847b07726b5979502895751b65dd85 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 24 Feb 2020 14:40:49 -0800 Subject: [PATCH] ANDROID: GKI: power_supply: add property to disable QC userspace optimizations Add power_supply property to configure quick-charge(QC) userspace optimization mode(hardware/software controlled), user-space daemon will read the property and disable quick-charge optimization algorithms. Signed-off-by: Ashay Jaiswal Signed-off-by: Umang Agrawal (cherry picked from commit 18f6e9d843b517eaee5659c3a74c3e6f7c15fa41) Signed-off-by: Mark Salyzyn Bug: 150789066 Change-Id: I3100e129ceeeeb8c83ba4b6fcf761b59a5a4ab75 --- drivers/power/supply/power_supply_sysfs.c | 1 + include/linux/power_supply.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index a37a18916d5b..0da4e4f2bb0f 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -448,6 +448,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(toggle_stat), POWER_SUPPLY_ATTR(main_fcc_max), POWER_SUPPLY_ATTR(fg_reset), + POWER_SUPPLY_ATTR(qc_opti_disable), /* 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 67347792d592..3e53536c9ecc 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -145,6 +145,12 @@ enum { POWER_SUPPLY_PD_PPS_ACTIVE, }; +enum { + POWER_SUPPLY_QC_CTM_DISABLE = BIT(0), + POWER_SUPPLY_QC_THERMAL_BALANCE_DISABLE = BIT(1), + POWER_SUPPLY_QC_INOV_THERMAL_DISABLE = BIT(2), +}; + enum power_supply_property { /* Properties of type `int' */ POWER_SUPPLY_PROP_STATUS = 0, @@ -314,6 +320,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_TOGGLE_STAT, POWER_SUPPLY_PROP_MAIN_FCC_MAX, POWER_SUPPLY_PROP_FG_RESET, + POWER_SUPPLY_PROP_QC_OPTI_DISABLE, /* Charge pump properties */ POWER_SUPPLY_PROP_CP_STATUS1, POWER_SUPPLY_PROP_CP_STATUS2,