mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
qc3p:Set AICL thres at qc3p pmic charging
At hvdcp more than 15w project. AICL threshold will set to higher than 5V which result pmic charging current unstable. Change-Id: If1a0e9174dbaf5df656442bbdd1247b231636c48 Signed-off-by: xuwei9 <xuwei9@lenovo.com> Reviewed-on: https://gerrit.mot.com/1980875 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
08626d5e9a
commit
1c1bf99fc9
1 changed files with 35 additions and 2 deletions
|
|
@ -367,10 +367,10 @@ void mmi_chrg_enable_all_cp(struct mmi_charger_manager *chip, int val)
|
|||
#define DISABLE_CHRG_LIMIT -1
|
||||
#define CP_CHRG_SOC_LIMIT 90
|
||||
#define PD_CONT_PWR_CNT 5
|
||||
|
||||
#define AICL_DEFALLT_THREHOLD 4500
|
||||
#define QC3P_V_STEP 20000
|
||||
#define CURR_TO_VOLT_STEP 5
|
||||
|
||||
#define DEFAULT_HVDCP_POWER_MAX 15000
|
||||
void mmi_chrg_policy_clear(struct mmi_charger_manager *chip) {
|
||||
struct mmi_cp_policy_dev *chrg_list = &g_chrg_list;
|
||||
chrg_dev_init(chip, &g_chrg_list);
|
||||
|
|
@ -389,6 +389,35 @@ void mmi_chrg_policy_clear(struct mmi_charger_manager *chip) {
|
|||
return;
|
||||
}
|
||||
|
||||
int qc3p_config_aicl_threshold(struct mmi_charger_manager *chip, int threshold)
|
||||
{
|
||||
int rc;
|
||||
union power_supply_propval prop = {0,};
|
||||
int prev_threshold = 0;
|
||||
|
||||
if(threshold < AICL_DEFALLT_THREHOLD)
|
||||
return -1;
|
||||
|
||||
if(!chip->batt_psy) {
|
||||
chip->batt_psy = power_supply_get_by_name("qcom_battery");
|
||||
if(!chip->batt_psy)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
rc = power_supply_get_property(chip->batt_psy,
|
||||
POWER_SUPPLY_PROP_QC3P_AICL_THRESHOLD,&prop);
|
||||
if(!rc)
|
||||
prev_threshold = prop.intval;
|
||||
|
||||
if(threshold != prev_threshold){
|
||||
prop.intval = threshold;
|
||||
rc = power_supply_set_property(chip->batt_psy,
|
||||
POWER_SUPPLY_PROP_QC3P_AICL_THRESHOLD, &prop);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mmi_chrg_sm_work_func(struct work_struct *work)
|
||||
{
|
||||
struct mmi_charger_manager *chip = container_of(work,
|
||||
|
|
@ -717,6 +746,10 @@ static void mmi_chrg_sm_work_func(struct work_struct *work)
|
|||
mmi_chrg_dbg(chip, PR_MOTO, "Continue to SW charging, "
|
||||
"vbatt %d uV, ibatt %d uA\n",
|
||||
vbatt_volt, ibatt_curr);
|
||||
|
||||
if(chip->hvdcp_power_max > DEFAULT_HVDCP_POWER_MAX)
|
||||
qc3p_config_aicl_threshold(chip,AICL_DEFALLT_THREHOLD);
|
||||
|
||||
heartbeat_dely_ms = HEARTBEAT_lOOP_WAIT_MS;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue