Loading drivers/power/supply/qcom/qpnp-smb2.c +4 −0 Original line number Diff line number Diff line Loading @@ -1170,6 +1170,9 @@ static int smb2_batt_set_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_DP_DM: rc = smblib_dp_dm(chg, val->intval); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: rc = smblib_set_prop_input_current_limited(chg, val); break; default: rc = -EINVAL; } Loading @@ -1187,6 +1190,7 @@ static int smb2_batt_prop_is_writeable(struct power_supply *psy, case POWER_SUPPLY_PROP_PARALLEL_DISABLE: case POWER_SUPPLY_PROP_DP_DM: case POWER_SUPPLY_PROP_RERUN_AICL: case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: return 1; default: break; Loading drivers/power/supply/qcom/smb-lib.c +13 −0 Original line number Diff line number Diff line Loading @@ -1713,6 +1713,11 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, u8 stat; int rc; if (chg->fake_input_current_limited >= 0) { val->intval = chg->fake_input_current_limited; return 0; } rc = smblib_read(chg, AICL_STATUS_REG, &stat); if (rc < 0) { smblib_err(chg, "Couldn't read AICL_STATUS rc=%d\n", rc); Loading Loading @@ -1904,6 +1909,13 @@ int smblib_set_prop_charge_qnovo_enable(struct smb_charger *chg, return rc; } int smblib_set_prop_input_current_limited(struct smb_charger *chg, const union power_supply_propval *val) { chg->fake_input_current_limited = val->intval; return 0; } int smblib_rerun_aicl(struct smb_charger *chg) { int rc, settled_icl_ua; Loading Loading @@ -4481,6 +4493,7 @@ int smblib_init(struct smb_charger *chg) INIT_DELAYED_WORK(&chg->pl_enable_work, smblib_pl_enable_work); INIT_WORK(&chg->legacy_detection_work, smblib_legacy_detection_work); chg->fake_capacity = -EINVAL; chg->fake_input_current_limited = -EINVAL; switch (chg->mode) { case PARALLEL_MASTER: Loading drivers/power/supply/qcom/smb-lib.h +3 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,7 @@ struct smb_charger { bool typec_present; u8 typec_status[5]; bool typec_legacy_valid; int fake_input_current_limited; /* workaround flag */ u32 wa_flags; Loading Loading @@ -423,6 +424,8 @@ int smblib_set_prop_batt_capacity(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_system_temp_level(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_input_current_limited(struct smb_charger *chg, const union power_supply_propval *val); int smblib_get_prop_dc_present(struct smb_charger *chg, union power_supply_propval *val); Loading Loading
drivers/power/supply/qcom/qpnp-smb2.c +4 −0 Original line number Diff line number Diff line Loading @@ -1170,6 +1170,9 @@ static int smb2_batt_set_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_DP_DM: rc = smblib_dp_dm(chg, val->intval); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: rc = smblib_set_prop_input_current_limited(chg, val); break; default: rc = -EINVAL; } Loading @@ -1187,6 +1190,7 @@ static int smb2_batt_prop_is_writeable(struct power_supply *psy, case POWER_SUPPLY_PROP_PARALLEL_DISABLE: case POWER_SUPPLY_PROP_DP_DM: case POWER_SUPPLY_PROP_RERUN_AICL: case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: return 1; default: break; Loading
drivers/power/supply/qcom/smb-lib.c +13 −0 Original line number Diff line number Diff line Loading @@ -1713,6 +1713,11 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, u8 stat; int rc; if (chg->fake_input_current_limited >= 0) { val->intval = chg->fake_input_current_limited; return 0; } rc = smblib_read(chg, AICL_STATUS_REG, &stat); if (rc < 0) { smblib_err(chg, "Couldn't read AICL_STATUS rc=%d\n", rc); Loading Loading @@ -1904,6 +1909,13 @@ int smblib_set_prop_charge_qnovo_enable(struct smb_charger *chg, return rc; } int smblib_set_prop_input_current_limited(struct smb_charger *chg, const union power_supply_propval *val) { chg->fake_input_current_limited = val->intval; return 0; } int smblib_rerun_aicl(struct smb_charger *chg) { int rc, settled_icl_ua; Loading Loading @@ -4481,6 +4493,7 @@ int smblib_init(struct smb_charger *chg) INIT_DELAYED_WORK(&chg->pl_enable_work, smblib_pl_enable_work); INIT_WORK(&chg->legacy_detection_work, smblib_legacy_detection_work); chg->fake_capacity = -EINVAL; chg->fake_input_current_limited = -EINVAL; switch (chg->mode) { case PARALLEL_MASTER: Loading
drivers/power/supply/qcom/smb-lib.h +3 −0 Original line number Diff line number Diff line Loading @@ -318,6 +318,7 @@ struct smb_charger { bool typec_present; u8 typec_status[5]; bool typec_legacy_valid; int fake_input_current_limited; /* workaround flag */ u32 wa_flags; Loading Loading @@ -423,6 +424,8 @@ int smblib_set_prop_batt_capacity(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_system_temp_level(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_input_current_limited(struct smb_charger *chg, const union power_supply_propval *val); int smblib_get_prop_dc_present(struct smb_charger *chg, union power_supply_propval *val); Loading