Loading Documentation/devicetree/bindings/power/qpnp-smbcharger.txt +6 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,12 @@ Optional Properties: driver automatically readjust vfloat using the fuel gauge ADC readings to make charging more accurate. - qcom,jeita-temp-hard-limit property when present will enable or disable the jeita temperature hard limit based on the value 1 or 0. Specify 0 if the jeita temp hard limit needs to be disabled. If it is not present, jeita temperature hard limit will be based on what the bootloader had set earlier. - qcom,soft-vfloat-comp-disabled Set this property when the battery is powered via external source and could go above the float voltage. Loading drivers/power/qpnp-smbcharger.c +20 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ struct smbchg_chip { int safety_time; int prechg_safety_time; int bmd_pin_src; int jeita_temp_hard_limit; bool use_vfloat_adjustments; bool iterm_disabled; bool bmd_algo_disabled; Loading Loading @@ -3821,6 +3822,8 @@ static inline int get_bpd(const char *name) #define AICL_WL_SEL_CFG 0xF5 #define AICL_WL_SEL_MASK SMB_MASK(1, 0) #define AICL_WL_SEL_45S 0 #define CHGR_CCMP_CFG 0xFA #define JEITA_TEMP_HARD_LIMIT_BIT BIT(5) static int smbchg_hw_init(struct smbchg_chip *chip) { int rc, i; Loading Loading @@ -4036,6 +4039,21 @@ static int smbchg_hw_init(struct smbchg_chip *chip) chip->safety_timer_en = true; } /* configure jeita temperature hard limit */ if (chip->jeita_temp_hard_limit >= 0) { rc = smbchg_sec_masked_write(chip, chip->chgr_base + CHGR_CCMP_CFG, JEITA_TEMP_HARD_LIMIT_BIT, chip->jeita_temp_hard_limit ? 0 : JEITA_TEMP_HARD_LIMIT_BIT); if (rc < 0) { dev_err(chip->dev, "Couldn't set jeita temp hard limit rc = %d\n", rc); return rc; } } /* make the buck switch faster to prevent some vbus oscillation */ rc = smbchg_sec_masked_write(chip, chip->usb_chgpth_base + TR_8OR32B, Loading Loading @@ -4332,6 +4350,8 @@ static int smb_parse_dt(struct smbchg_chip *chip) pr_smb(PR_STATUS, "parallel usb thr: %d, 9v thr: %d\n", chip->parallel.min_current_thr_ma, chip->parallel.min_9v_current_thr_ma); OF_PROP_READ(chip, chip->jeita_temp_hard_limit, "jeita-temp-hard-limit", rc, 1); /* read boolean configuration properties */ chip->use_vfloat_adjustments = of_property_read_bool(node, Loading Loading
Documentation/devicetree/bindings/power/qpnp-smbcharger.txt +6 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,12 @@ Optional Properties: driver automatically readjust vfloat using the fuel gauge ADC readings to make charging more accurate. - qcom,jeita-temp-hard-limit property when present will enable or disable the jeita temperature hard limit based on the value 1 or 0. Specify 0 if the jeita temp hard limit needs to be disabled. If it is not present, jeita temperature hard limit will be based on what the bootloader had set earlier. - qcom,soft-vfloat-comp-disabled Set this property when the battery is powered via external source and could go above the float voltage. Loading
drivers/power/qpnp-smbcharger.c +20 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ struct smbchg_chip { int safety_time; int prechg_safety_time; int bmd_pin_src; int jeita_temp_hard_limit; bool use_vfloat_adjustments; bool iterm_disabled; bool bmd_algo_disabled; Loading Loading @@ -3821,6 +3822,8 @@ static inline int get_bpd(const char *name) #define AICL_WL_SEL_CFG 0xF5 #define AICL_WL_SEL_MASK SMB_MASK(1, 0) #define AICL_WL_SEL_45S 0 #define CHGR_CCMP_CFG 0xFA #define JEITA_TEMP_HARD_LIMIT_BIT BIT(5) static int smbchg_hw_init(struct smbchg_chip *chip) { int rc, i; Loading Loading @@ -4036,6 +4039,21 @@ static int smbchg_hw_init(struct smbchg_chip *chip) chip->safety_timer_en = true; } /* configure jeita temperature hard limit */ if (chip->jeita_temp_hard_limit >= 0) { rc = smbchg_sec_masked_write(chip, chip->chgr_base + CHGR_CCMP_CFG, JEITA_TEMP_HARD_LIMIT_BIT, chip->jeita_temp_hard_limit ? 0 : JEITA_TEMP_HARD_LIMIT_BIT); if (rc < 0) { dev_err(chip->dev, "Couldn't set jeita temp hard limit rc = %d\n", rc); return rc; } } /* make the buck switch faster to prevent some vbus oscillation */ rc = smbchg_sec_masked_write(chip, chip->usb_chgpth_base + TR_8OR32B, Loading Loading @@ -4332,6 +4350,8 @@ static int smb_parse_dt(struct smbchg_chip *chip) pr_smb(PR_STATUS, "parallel usb thr: %d, 9v thr: %d\n", chip->parallel.min_current_thr_ma, chip->parallel.min_9v_current_thr_ma); OF_PROP_READ(chip, chip->jeita_temp_hard_limit, "jeita-temp-hard-limit", rc, 1); /* read boolean configuration properties */ chip->use_vfloat_adjustments = of_property_read_bool(node, Loading