Loading drivers/power/supply/qcom/qpnp-smb5.c +2 −3 Original line number Diff line number Diff line Loading @@ -1218,8 +1218,7 @@ static int smb5_batt_get_prop(struct power_supply *psy, rc = smblib_get_prop_batt_present(chg, pval); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: /* For battery, INPUT_CURRENT_LIMIT equates to INPUT_SUSPEND */ rc = smblib_get_prop_input_current_limit_usb(chg, pval); rc = smblib_get_prop_input_suspend(chg, pval); break; case POWER_SUPPLY_PROP_CHARGE_TYPE: rc = smblib_get_prop_batt_charge_type(chg, pval); Loading Loading @@ -1313,7 +1312,7 @@ static int smb5_batt_set_prop(struct power_supply *psy, rc = smblib_set_prop_batt_status(chg, val); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: rc = smblib_set_prop_input_current_limit_usb(chg, val); rc = smblib_set_prop_input_suspend(chg, val); break; case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT: rc = smblib_set_prop_system_temp_level(chg, val); Loading drivers/power/supply/qcom/smb5-lib.c +21 −13 Original line number Diff line number Diff line Loading @@ -1971,10 +1971,12 @@ int smblib_vbus_regulator_is_enabled(struct regulator_dev *rdev) /******************** * BATT PSY GETTERS * ********************/ int smblib_get_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_get_prop_input_suspend(struct smb_charger *chg, union power_supply_propval *val) { val->intval = get_client_vote(chg->usb_icl_votable, USER_VOTER); val->intval = (get_client_vote(chg->usb_icl_votable, USER_VOTER) == 0) && get_client_vote(chg->dc_suspend_votable, USER_VOTER); return 0; } Loading Loading @@ -2414,21 +2416,27 @@ int smblib_get_batt_current_now(struct smb_charger *chg, /*********************** * BATTERY PSY SETTERS * ***********************/ int smblib_set_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_set_prop_input_suspend(struct smb_charger *chg, const union power_supply_propval *val) { int rc; if (val->intval == 0) rc = vote(chg->usb_icl_votable, USER_VOTER, true, 0); else if (val->intval < 0) rc = vote(chg->usb_icl_votable, USER_VOTER, false, 0); else rc = vote(chg->usb_icl_votable, USER_VOTER, true, val->intval); /* vote 0mA when suspended */ rc = vote(chg->usb_icl_votable, USER_VOTER, (bool)val->intval, 0); if (rc < 0) { smblib_err(chg, "Couldn't vote to %s USB rc=%d\n", (bool)val->intval ? "suspend" : "resume", rc); return rc; } if (rc < 0) smblib_err(chg, "Couldn't vote to set USB ICL to %d rc=%d\n", val->intval, rc); rc = vote(chg->dc_suspend_votable, USER_VOTER, (bool)val->intval, 0); if (rc < 0) { smblib_err(chg, "Couldn't vote to %s DC rc=%d\n", (bool)val->intval ? "suspend" : "resume", rc); return rc; } power_supply_changed(chg->batt_psy); return rc; } Loading drivers/power/supply/qcom/smb5-lib.h +2 −2 Original line number Diff line number Diff line Loading @@ -673,7 +673,7 @@ irqreturn_t smb5_typec_or_rid_detection_change_irq_handler(int irq, void *data); irqreturn_t smb5_temp_change_irq_handler(int irq, void *data); irqreturn_t smb5_usbin_ov_irq_handler(int irq, void *data); irqreturn_t smb5_sdam_sts_change_irq_handler(int irq, void *data); int smblib_get_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_get_prop_input_suspend(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_present(struct smb_charger *chg, union power_supply_propval *val); Loading @@ -697,7 +697,7 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, int *val); int smblib_get_prop_batt_iterm(struct smb_charger *chg, union power_supply_propval *val); int smblib_set_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_set_prop_input_suspend(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_batt_capacity(struct smb_charger *chg, const union power_supply_propval *val); Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +2 −3 Original line number Diff line number Diff line Loading @@ -1218,8 +1218,7 @@ static int smb5_batt_get_prop(struct power_supply *psy, rc = smblib_get_prop_batt_present(chg, pval); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: /* For battery, INPUT_CURRENT_LIMIT equates to INPUT_SUSPEND */ rc = smblib_get_prop_input_current_limit_usb(chg, pval); rc = smblib_get_prop_input_suspend(chg, pval); break; case POWER_SUPPLY_PROP_CHARGE_TYPE: rc = smblib_get_prop_batt_charge_type(chg, pval); Loading Loading @@ -1313,7 +1312,7 @@ static int smb5_batt_set_prop(struct power_supply *psy, rc = smblib_set_prop_batt_status(chg, val); break; case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: rc = smblib_set_prop_input_current_limit_usb(chg, val); rc = smblib_set_prop_input_suspend(chg, val); break; case POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT: rc = smblib_set_prop_system_temp_level(chg, val); Loading
drivers/power/supply/qcom/smb5-lib.c +21 −13 Original line number Diff line number Diff line Loading @@ -1971,10 +1971,12 @@ int smblib_vbus_regulator_is_enabled(struct regulator_dev *rdev) /******************** * BATT PSY GETTERS * ********************/ int smblib_get_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_get_prop_input_suspend(struct smb_charger *chg, union power_supply_propval *val) { val->intval = get_client_vote(chg->usb_icl_votable, USER_VOTER); val->intval = (get_client_vote(chg->usb_icl_votable, USER_VOTER) == 0) && get_client_vote(chg->dc_suspend_votable, USER_VOTER); return 0; } Loading Loading @@ -2414,21 +2416,27 @@ int smblib_get_batt_current_now(struct smb_charger *chg, /*********************** * BATTERY PSY SETTERS * ***********************/ int smblib_set_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_set_prop_input_suspend(struct smb_charger *chg, const union power_supply_propval *val) { int rc; if (val->intval == 0) rc = vote(chg->usb_icl_votable, USER_VOTER, true, 0); else if (val->intval < 0) rc = vote(chg->usb_icl_votable, USER_VOTER, false, 0); else rc = vote(chg->usb_icl_votable, USER_VOTER, true, val->intval); /* vote 0mA when suspended */ rc = vote(chg->usb_icl_votable, USER_VOTER, (bool)val->intval, 0); if (rc < 0) { smblib_err(chg, "Couldn't vote to %s USB rc=%d\n", (bool)val->intval ? "suspend" : "resume", rc); return rc; } if (rc < 0) smblib_err(chg, "Couldn't vote to set USB ICL to %d rc=%d\n", val->intval, rc); rc = vote(chg->dc_suspend_votable, USER_VOTER, (bool)val->intval, 0); if (rc < 0) { smblib_err(chg, "Couldn't vote to %s DC rc=%d\n", (bool)val->intval ? "suspend" : "resume", rc); return rc; } power_supply_changed(chg->batt_psy); return rc; } Loading
drivers/power/supply/qcom/smb5-lib.h +2 −2 Original line number Diff line number Diff line Loading @@ -673,7 +673,7 @@ irqreturn_t smb5_typec_or_rid_detection_change_irq_handler(int irq, void *data); irqreturn_t smb5_temp_change_irq_handler(int irq, void *data); irqreturn_t smb5_usbin_ov_irq_handler(int irq, void *data); irqreturn_t smb5_sdam_sts_change_irq_handler(int irq, void *data); int smblib_get_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_get_prop_input_suspend(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_present(struct smb_charger *chg, union power_supply_propval *val); Loading @@ -697,7 +697,7 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, int *val); int smblib_get_prop_batt_iterm(struct smb_charger *chg, union power_supply_propval *val); int smblib_set_prop_input_current_limit_usb(struct smb_charger *chg, int smblib_set_prop_input_suspend(struct smb_charger *chg, const union power_supply_propval *val); int smblib_set_prop_batt_capacity(struct smb_charger *chg, const union power_supply_propval *val); Loading