Loading drivers/power/supply/qcom/battery.c +14 −3 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ struct pl_data { struct class qcom_batt_class; struct wakeup_source *pl_ws; struct notifier_block nb; bool pl_disable; }; struct pl_data *the_chip; Loading @@ -88,6 +89,7 @@ enum print_reason { enum { AICL_RERUN_WA_BIT = BIT(0), FORCE_INOV_DISABLE_BIT = BIT(1), }; static int debug_mask; Loading Loading @@ -848,6 +850,12 @@ static int pl_disable_vote_callback(struct votable *votable, chip->pl_settled_ua = 0; } /* notify parallel state change */ if (chip->pl_psy && (chip->pl_disable != pl_disable)) { power_supply_changed(chip->pl_psy); chip->pl_disable = (bool)pl_disable; } pl_dbg(chip, PR_PARALLEL, "parallel charging %s\n", pl_disable ? "disabled" : "enabled"); Loading Loading @@ -916,7 +924,8 @@ static bool is_parallel_available(struct pl_data *chip) chip->pl_mode = pval.intval; /* Disable autonomous votage increments for USBIN-USBIN */ if (IS_USBIN(chip->pl_mode)) { if (IS_USBIN(chip->pl_mode) && (chip->wa_flags & FORCE_INOV_DISABLE_BIT)) { if (!chip->hvdcp_hw_inov_dis_votable) chip->hvdcp_hw_inov_dis_votable = find_votable("HVDCP_HW_INOV_DIS"); Loading Loading @@ -1041,7 +1050,6 @@ static void handle_settled_icl_change(struct pl_data *chip) else vote(chip->pl_enable_votable_indirect, USBIN_I_VOTER, true, 0); rerun_election(chip->fcc_votable); if (IS_USBIN(chip->pl_mode)) { /* Loading Loading @@ -1200,7 +1208,9 @@ static void pl_config_init(struct pl_data *chip, int smb_version) switch (smb_version) { case PMI8998_SUBTYPE: case PM660_SUBTYPE: chip->wa_flags = AICL_RERUN_WA_BIT; chip->wa_flags = AICL_RERUN_WA_BIT | FORCE_INOV_DISABLE_BIT; break; case PMI632_SUBTYPE: break; default: break; Loading Loading @@ -1301,6 +1311,7 @@ int qcom_batt_init(int smb_version) goto unreg_notifier; } chip->pl_disable = true; chip->qcom_batt_class.name = "qcom-battery", chip->qcom_batt_class.owner = THIS_MODULE, chip->qcom_batt_class.class_attrs = pl_attributes; Loading drivers/power/supply/qcom/qpnp-smb5.c +9 −0 Original line number Diff line number Diff line Loading @@ -1594,11 +1594,20 @@ static int smb5_init_hw(struct smb5 *chip) /* * PMI632 based hw init: * - Enable STAT pin function on SMB_EN * - Rerun APSD to ensure proper charger detection if device * boots with charger connected. * - Initialize flash module for PMI632 */ if (chg->smb_version == PMI632_SUBTYPE) { rc = smblib_masked_write(chg, MISC_SMB_EN_CMD_REG, EN_STAT_CMD_BIT, EN_STAT_CMD_BIT); if (rc < 0) { dev_err(chg->dev, "Couldn't configure SMB_EN rc=%d\n", rc); return rc; } schgm_flash_init(chg); smblib_rerun_apsd_if_required(chg); } Loading Loading
drivers/power/supply/qcom/battery.c +14 −3 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ struct pl_data { struct class qcom_batt_class; struct wakeup_source *pl_ws; struct notifier_block nb; bool pl_disable; }; struct pl_data *the_chip; Loading @@ -88,6 +89,7 @@ enum print_reason { enum { AICL_RERUN_WA_BIT = BIT(0), FORCE_INOV_DISABLE_BIT = BIT(1), }; static int debug_mask; Loading Loading @@ -848,6 +850,12 @@ static int pl_disable_vote_callback(struct votable *votable, chip->pl_settled_ua = 0; } /* notify parallel state change */ if (chip->pl_psy && (chip->pl_disable != pl_disable)) { power_supply_changed(chip->pl_psy); chip->pl_disable = (bool)pl_disable; } pl_dbg(chip, PR_PARALLEL, "parallel charging %s\n", pl_disable ? "disabled" : "enabled"); Loading Loading @@ -916,7 +924,8 @@ static bool is_parallel_available(struct pl_data *chip) chip->pl_mode = pval.intval; /* Disable autonomous votage increments for USBIN-USBIN */ if (IS_USBIN(chip->pl_mode)) { if (IS_USBIN(chip->pl_mode) && (chip->wa_flags & FORCE_INOV_DISABLE_BIT)) { if (!chip->hvdcp_hw_inov_dis_votable) chip->hvdcp_hw_inov_dis_votable = find_votable("HVDCP_HW_INOV_DIS"); Loading Loading @@ -1041,7 +1050,6 @@ static void handle_settled_icl_change(struct pl_data *chip) else vote(chip->pl_enable_votable_indirect, USBIN_I_VOTER, true, 0); rerun_election(chip->fcc_votable); if (IS_USBIN(chip->pl_mode)) { /* Loading Loading @@ -1200,7 +1208,9 @@ static void pl_config_init(struct pl_data *chip, int smb_version) switch (smb_version) { case PMI8998_SUBTYPE: case PM660_SUBTYPE: chip->wa_flags = AICL_RERUN_WA_BIT; chip->wa_flags = AICL_RERUN_WA_BIT | FORCE_INOV_DISABLE_BIT; break; case PMI632_SUBTYPE: break; default: break; Loading Loading @@ -1301,6 +1311,7 @@ int qcom_batt_init(int smb_version) goto unreg_notifier; } chip->pl_disable = true; chip->qcom_batt_class.name = "qcom-battery", chip->qcom_batt_class.owner = THIS_MODULE, chip->qcom_batt_class.class_attrs = pl_attributes; Loading
drivers/power/supply/qcom/qpnp-smb5.c +9 −0 Original line number Diff line number Diff line Loading @@ -1594,11 +1594,20 @@ static int smb5_init_hw(struct smb5 *chip) /* * PMI632 based hw init: * - Enable STAT pin function on SMB_EN * - Rerun APSD to ensure proper charger detection if device * boots with charger connected. * - Initialize flash module for PMI632 */ if (chg->smb_version == PMI632_SUBTYPE) { rc = smblib_masked_write(chg, MISC_SMB_EN_CMD_REG, EN_STAT_CMD_BIT, EN_STAT_CMD_BIT); if (rc < 0) { dev_err(chg->dev, "Couldn't configure SMB_EN rc=%d\n", rc); return rc; } schgm_flash_init(chg); smblib_rerun_apsd_if_required(chg); } Loading