mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
charger:adaptive charger tolerance optimization
Adaptive charger tolerance optimization from 1 to 2 for more stable state switching. Change-Id: I60a0c5501605ac060919d340a07b2f54faa0907c Signed-off-by: xuwei9 <xuwei9@lenovo.com> Reviewed-on: https://gerrit.mot.com/2023609 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
61f8bb0bb7
commit
f3ee031477
3 changed files with 13 additions and 1 deletions
|
|
@ -10,6 +10,10 @@ ifeq ($(USE_MMI_CHARGER), true)
|
|||
LOCAL_ADDITIONAL_DEPENDENCIES := $(KERNEL_MODULES_OUT)/mmi_charger.ko
|
||||
endif
|
||||
|
||||
ifeq ($(ADAPTIVE_TOLERANCE_OPTIMIZATION),true)
|
||||
KERNEL_CFLAGS += ADAPTIVE_TOLERANCE_OPTIMIZATION=y
|
||||
endif
|
||||
|
||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||
include $(DLKM_DIR)/AndroidKernelModule.mk
|
||||
|
||||
|
|
|
|||
|
|
@ -8,4 +8,8 @@ ifneq ($(filter m y,$(CONFIG_USE_MMI_CHARGER)),)
|
|||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../mmi_charger/$(GKI_OBJ_MODULE_DIR)/Module.symvers
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y, $(ADAPTIVE_TOLERANCE_OPTIMIZATION)),)
|
||||
EXTRA_CFLAGS += -DADAPTIVE_TOLERANCE_OPTIMIZATION
|
||||
endif
|
||||
|
||||
obj-m += qpnp_adaptive_charge.o
|
||||
|
|
|
|||
|
|
@ -158,7 +158,11 @@ static void update(struct adap_chg_data *data)
|
|||
if (upper_limit != -1) {
|
||||
/* If no lower limit is defined, we are in Auto Mode */
|
||||
if (lower_limit == -1) {
|
||||
if (data->batt_capacity > (upper_limit + 1)) {
|
||||
#ifdef ADAPTIVE_TOLERANCE_OPTIMIZATION
|
||||
if (data->batt_capacity > (upper_limit + 2)) {
|
||||
#else
|
||||
if (data->batt_capacity > (upper_limit + 1)) {
|
||||
#endif
|
||||
suspend_charging(true);
|
||||
stop_charging(false);
|
||||
} else if (data->batt_capacity == (upper_limit + 1)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue