From 243b09b0901380933ff707c49c4997febddbd030 Mon Sep 17 00:00:00 2001 From: "[A" Date: Thu, 1 Sep 2022 11:00:42 +0800 Subject: [PATCH] 18W charging set sgm4154x iindpm comp 100mA Modify: 18W charging set sgm4154x iindpm comp 100mA Change-Id: I06cfb2e202cc0c84d7eda44abfe93ad2a42f8942 Signed-off-by: Reviewed-on: https://gerrit.mot.com/2375935 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Xu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c | 4 ++++ drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c index 2761fdc40396..35616be7d0c7 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.c @@ -761,6 +761,8 @@ static int sgm4154x_set_input_curr_lim(struct sgm4154x_device *sgm, int iindpm) reg_val = (iindpm-SGM4154x_IINDPM_I_MIN_uA) / SGM4154x_IINDPM_STEP_uA; else if (iindpm > 3100000 && iindpm < SGM4154x_IINDPM_I_MAX_uA) reg_val = 0x1E; + if(sgm->sgm_18W_iindpm_comp && iindpm == 3000000) + reg_val = 0x1E; #endif ret = mmi_regmap_update_bits(sgm, SGM4154x_CHRG_CTRL_0, @@ -2604,6 +2606,8 @@ static int sgm4154x_parse_dt(struct sgm4154x_device *sgm) gpio_direction_output(sgm->wls_en_gpio, 0);//default enable wls charge } + /* 18W iindpm comp */ + sgm->sgm_18W_iindpm_comp = of_property_read_bool(sgm->dev->of_node, "sgm,18w_iindpm_comp"); /* sw jeita */ sgm->enable_sw_jeita = of_property_read_bool(sgm->dev->of_node, "enable_sw_jeita"); /* enable dynamic adjust battery voltage */ diff --git a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h index 5bb9db681fd3..c5ade417bd72 100644 --- a/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h +++ b/drivers/power/sgm4154x_chg_mmi/sgm4154x_charger.h @@ -386,6 +386,7 @@ struct sgm4154x_device { int wls_max_icl; bool i2c_err_wa_dis; + bool sgm_18W_iindpm_comp; }; #ifdef CONFIG_MMI_QC3P_WT6670_DETECTED