Loading drivers/power/supply/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(batt_age_level), POWER_SUPPLY_ATTR(voltage_vph), POWER_SUPPLY_ATTR(chip_version), POWER_SUPPLY_ATTR(therm_icl_limit), /* Charge pump properties */ POWER_SUPPLY_ATTR(cp_status1), POWER_SUPPLY_ATTR(cp_status2), Loading drivers/power/supply/qcom/qpnp-smb5.c +15 −1 Original line number Diff line number Diff line Loading @@ -649,6 +649,7 @@ static enum power_supply_property smb5_usb_props[] = { POWER_SUPPLY_PROP_HVDCP_OPTI_ALLOWED, POWER_SUPPLY_PROP_QC_OPTI_DISABLE, POWER_SUPPLY_PROP_VOLTAGE_VPH, POWER_SUPPLY_PROP_THERM_ICL_LIMIT, }; static int smb5_usb_get_prop(struct power_supply *psy, Loading Loading @@ -807,6 +808,10 @@ static int smb5_usb_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_VPH: rc = smblib_get_prop_vph_voltage_now(chg, val); break; case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: val->intval = get_client_vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER); break; default: pr_err("get prop %d is not supported in usb\n", psp); rc = -EINVAL; Loading @@ -827,7 +832,7 @@ static int smb5_usb_set_prop(struct power_supply *psy, { struct smb5 *chip = power_supply_get_drvdata(psy); struct smb_charger *chg = &chip->chg; int rc = 0; int icl, rc = 0; switch (psp) { case POWER_SUPPLY_PROP_PD_CURRENT_MAX: Loading Loading @@ -871,6 +876,14 @@ static int smb5_usb_set_prop(struct power_supply *psy, chg->connector_health = val->intval; power_supply_changed(chg->usb_psy); break; case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: icl = get_effective_result(chg->usb_icl_votable); if ((icl + val->intval) > 0) rc = vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, true, icl + val->intval); else rc = -EINVAL; break; default: pr_err("set prop %d is not supported\n", psp); rc = -EINVAL; Loading @@ -886,6 +899,7 @@ static int smb5_usb_prop_is_writeable(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_CTM_CURRENT_MAX: case POWER_SUPPLY_PROP_CONNECTOR_HEALTH: case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: return 1; default: break; Loading drivers/power/supply/qcom/smb5-lib.c +2 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,7 @@ static void smblib_uusb_removal(struct smb_charger *chg) vote(chg->usb_icl_votable, SW_QC3_VOTER, false, 0); vote(chg->usb_icl_votable, HVDCP2_ICL_VOTER, false, 0); vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, false, 0); /* Remove SW thermal regulation WA votes */ vote(chg->usb_icl_votable, SW_THERM_REGULATION_VOTER, false, 0); Loading Loading @@ -5049,6 +5050,7 @@ static void typec_src_removal(struct smb_charger *chg) vote(chg->usb_icl_votable, CTM_VOTER, false, 0); vote(chg->usb_icl_votable, HVDCP2_ICL_VOTER, false, 0); vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, false, 0); /* reset usb irq voters */ vote(chg->usb_irq_enable_votable, PD_VOTER, false, 0); Loading drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ enum print_reason { #define AICL_THRESHOLD_VOTER "AICL_THRESHOLD_VOTER" #define USBOV_DBC_VOTER "USBOV_DBC_VOTER" #define CHG_TERMINATION_VOTER "CHG_TERMINATION_VOTER" #define THERMAL_THROTTLE_VOTER "THERMAL_THROTTLE_VOTER" #define BOOST_BACK_STORM_COUNT 3 #define WEAK_CHG_STORM_COUNT 8 Loading include/linux/power_supply.h +1 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_BATT_AGE_LEVEL, POWER_SUPPLY_PROP_VOLTAGE_VPH, POWER_SUPPLY_PROP_CHIP_VERSION, POWER_SUPPLY_PROP_THERM_ICL_LIMIT, /* Charge pump properties */ POWER_SUPPLY_PROP_CP_STATUS1, POWER_SUPPLY_PROP_CP_STATUS2, Loading Loading
drivers/power/supply/power_supply_sysfs.c +1 −0 Original line number Diff line number Diff line Loading @@ -393,6 +393,7 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(batt_age_level), POWER_SUPPLY_ATTR(voltage_vph), POWER_SUPPLY_ATTR(chip_version), POWER_SUPPLY_ATTR(therm_icl_limit), /* Charge pump properties */ POWER_SUPPLY_ATTR(cp_status1), POWER_SUPPLY_ATTR(cp_status2), Loading
drivers/power/supply/qcom/qpnp-smb5.c +15 −1 Original line number Diff line number Diff line Loading @@ -649,6 +649,7 @@ static enum power_supply_property smb5_usb_props[] = { POWER_SUPPLY_PROP_HVDCP_OPTI_ALLOWED, POWER_SUPPLY_PROP_QC_OPTI_DISABLE, POWER_SUPPLY_PROP_VOLTAGE_VPH, POWER_SUPPLY_PROP_THERM_ICL_LIMIT, }; static int smb5_usb_get_prop(struct power_supply *psy, Loading Loading @@ -807,6 +808,10 @@ static int smb5_usb_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_VPH: rc = smblib_get_prop_vph_voltage_now(chg, val); break; case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: val->intval = get_client_vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER); break; default: pr_err("get prop %d is not supported in usb\n", psp); rc = -EINVAL; Loading @@ -827,7 +832,7 @@ static int smb5_usb_set_prop(struct power_supply *psy, { struct smb5 *chip = power_supply_get_drvdata(psy); struct smb_charger *chg = &chip->chg; int rc = 0; int icl, rc = 0; switch (psp) { case POWER_SUPPLY_PROP_PD_CURRENT_MAX: Loading Loading @@ -871,6 +876,14 @@ static int smb5_usb_set_prop(struct power_supply *psy, chg->connector_health = val->intval; power_supply_changed(chg->usb_psy); break; case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: icl = get_effective_result(chg->usb_icl_votable); if ((icl + val->intval) > 0) rc = vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, true, icl + val->intval); else rc = -EINVAL; break; default: pr_err("set prop %d is not supported\n", psp); rc = -EINVAL; Loading @@ -886,6 +899,7 @@ static int smb5_usb_prop_is_writeable(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_CTM_CURRENT_MAX: case POWER_SUPPLY_PROP_CONNECTOR_HEALTH: case POWER_SUPPLY_PROP_THERM_ICL_LIMIT: return 1; default: break; Loading
drivers/power/supply/qcom/smb5-lib.c +2 −0 Original line number Diff line number Diff line Loading @@ -1110,6 +1110,7 @@ static void smblib_uusb_removal(struct smb_charger *chg) vote(chg->usb_icl_votable, SW_QC3_VOTER, false, 0); vote(chg->usb_icl_votable, HVDCP2_ICL_VOTER, false, 0); vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, false, 0); /* Remove SW thermal regulation WA votes */ vote(chg->usb_icl_votable, SW_THERM_REGULATION_VOTER, false, 0); Loading Loading @@ -5049,6 +5050,7 @@ static void typec_src_removal(struct smb_charger *chg) vote(chg->usb_icl_votable, CTM_VOTER, false, 0); vote(chg->usb_icl_votable, HVDCP2_ICL_VOTER, false, 0); vote(chg->usb_icl_votable, CHG_TERMINATION_VOTER, false, 0); vote(chg->usb_icl_votable, THERMAL_THROTTLE_VOTER, false, 0); /* reset usb irq voters */ vote(chg->usb_irq_enable_votable, PD_VOTER, false, 0); Loading
drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ enum print_reason { #define AICL_THRESHOLD_VOTER "AICL_THRESHOLD_VOTER" #define USBOV_DBC_VOTER "USBOV_DBC_VOTER" #define CHG_TERMINATION_VOTER "CHG_TERMINATION_VOTER" #define THERMAL_THROTTLE_VOTER "THERMAL_THROTTLE_VOTER" #define BOOST_BACK_STORM_COUNT 3 #define WEAK_CHG_STORM_COUNT 8 Loading
include/linux/power_supply.h +1 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_BATT_AGE_LEVEL, POWER_SUPPLY_PROP_VOLTAGE_VPH, POWER_SUPPLY_PROP_CHIP_VERSION, POWER_SUPPLY_PROP_THERM_ICL_LIMIT, /* Charge pump properties */ POWER_SUPPLY_PROP_CP_STATUS1, POWER_SUPPLY_PROP_CP_STATUS2, Loading