Loading drivers/power/qpnp-smb2.c +8 −10 Original line number Diff line number Diff line Loading @@ -567,6 +567,8 @@ static enum power_supply_property smb2_batt_props[] = { POWER_SUPPLY_PROP_RERUN_AICL, POWER_SUPPLY_PROP_DP_DM, POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_CHARGE_FULL, POWER_SUPPLY_PROP_CYCLE_COUNT, }; static int smb2_batt_get_prop(struct power_supply *psy, Loading Loading @@ -616,9 +618,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: rc = smblib_get_prop_input_current_limited(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: rc = smblib_get_prop_batt_voltage_now(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_MAX: val->intval = get_client_vote(chg->fv_votable, BATT_PROFILE_VOTER); Loading @@ -630,9 +629,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote_locked(chg->fv_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_NOW: rc = smblib_get_prop_batt_current_now(chg, val); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: val->intval = get_client_vote_locked(chg->fcc_votable, QNOVO_VOTER); Loading @@ -645,9 +641,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->fcc_votable, FG_ESR_VOTER); break; case POWER_SUPPLY_PROP_TEMP: rc = smblib_get_prop_batt_temp(chg, val); break; case POWER_SUPPLY_PROP_TECHNOLOGY: val->intval = POWER_SUPPLY_TECHNOLOGY_LION; break; Loading @@ -672,7 +665,12 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = 0; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: rc = smblib_get_prop_batt_charge_counter(chg, val); case POWER_SUPPLY_PROP_CHARGE_FULL: case POWER_SUPPLY_PROP_CYCLE_COUNT: case POWER_SUPPLY_PROP_VOLTAGE_NOW: case POWER_SUPPLY_PROP_CURRENT_NOW: case POWER_SUPPLY_PROP_TEMP: rc = smblib_get_prop_from_bms(chg, psp, val); break; default: pr_err("batt power supply prop %d not supported\n", psp); Loading drivers/power/smb-lib.c +7 −44 Original line number Diff line number Diff line Loading @@ -1691,7 +1691,8 @@ int smblib_get_prop_batt_health(struct smb_charger *chg, stat); if (stat & CHARGER_ERROR_STATUS_BAT_OV_BIT) { rc = smblib_get_prop_batt_voltage_now(chg, &pval); rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_VOLTAGE_NOW, &pval); if (!rc) { /* * If Vbatt is within 40mV above Vfloat, then don't Loading Loading @@ -1749,45 +1750,6 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, return 0; } int smblib_get_prop_batt_voltage_now(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, val); return rc; } int smblib_get_prop_batt_current_now(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_CURRENT_NOW, val); return rc; } int smblib_get_prop_batt_temp(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_TEMP, val); return rc; } int smblib_get_prop_batt_charge_done(struct smb_charger *chg, union power_supply_propval *val) { Loading Loading @@ -1823,7 +1785,8 @@ int smblib_get_prop_charge_qnovo_enable(struct smb_charger *chg, return 0; } int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, int smblib_get_prop_from_bms(struct smb_charger *chg, enum power_supply_property psp, union power_supply_propval *val) { int rc; Loading @@ -1831,8 +1794,8 @@ int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_CHARGE_COUNTER, val); rc = power_supply_get_property(chg->bms_psy, psp, val); return rc; } Loading drivers/power/smb-lib.h +3 −8 Original line number Diff line number Diff line Loading @@ -404,14 +404,6 @@ int smblib_get_prop_system_temp_level(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_input_current_limited(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_voltage_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_current_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_temp(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, union power_supply_propval *val); 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, Loading Loading @@ -500,6 +492,9 @@ int smblib_get_icl_current(struct smb_charger *chg, int *icl_ua); int smblib_get_charge_current(struct smb_charger *chg, int *total_current_ua); int smblib_get_prop_pr_swap_in_progress(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_from_bms(struct smb_charger *chg, enum power_supply_property psp, union power_supply_propval *val); int smblib_set_prop_pr_swap_in_progress(struct smb_charger *chg, const union power_supply_propval *val); Loading Loading
drivers/power/qpnp-smb2.c +8 −10 Original line number Diff line number Diff line Loading @@ -567,6 +567,8 @@ static enum power_supply_property smb2_batt_props[] = { POWER_SUPPLY_PROP_RERUN_AICL, POWER_SUPPLY_PROP_DP_DM, POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_CHARGE_FULL, POWER_SUPPLY_PROP_CYCLE_COUNT, }; static int smb2_batt_get_prop(struct power_supply *psy, Loading Loading @@ -616,9 +618,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED: rc = smblib_get_prop_input_current_limited(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_NOW: rc = smblib_get_prop_batt_voltage_now(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_MAX: val->intval = get_client_vote(chg->fv_votable, BATT_PROFILE_VOTER); Loading @@ -630,9 +629,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote_locked(chg->fv_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_NOW: rc = smblib_get_prop_batt_current_now(chg, val); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: val->intval = get_client_vote_locked(chg->fcc_votable, QNOVO_VOTER); Loading @@ -645,9 +641,6 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->fcc_votable, FG_ESR_VOTER); break; case POWER_SUPPLY_PROP_TEMP: rc = smblib_get_prop_batt_temp(chg, val); break; case POWER_SUPPLY_PROP_TECHNOLOGY: val->intval = POWER_SUPPLY_TECHNOLOGY_LION; break; Loading @@ -672,7 +665,12 @@ static int smb2_batt_get_prop(struct power_supply *psy, val->intval = 0; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: rc = smblib_get_prop_batt_charge_counter(chg, val); case POWER_SUPPLY_PROP_CHARGE_FULL: case POWER_SUPPLY_PROP_CYCLE_COUNT: case POWER_SUPPLY_PROP_VOLTAGE_NOW: case POWER_SUPPLY_PROP_CURRENT_NOW: case POWER_SUPPLY_PROP_TEMP: rc = smblib_get_prop_from_bms(chg, psp, val); break; default: pr_err("batt power supply prop %d not supported\n", psp); Loading
drivers/power/smb-lib.c +7 −44 Original line number Diff line number Diff line Loading @@ -1691,7 +1691,8 @@ int smblib_get_prop_batt_health(struct smb_charger *chg, stat); if (stat & CHARGER_ERROR_STATUS_BAT_OV_BIT) { rc = smblib_get_prop_batt_voltage_now(chg, &pval); rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_VOLTAGE_NOW, &pval); if (!rc) { /* * If Vbatt is within 40mV above Vfloat, then don't Loading Loading @@ -1749,45 +1750,6 @@ int smblib_get_prop_input_current_limited(struct smb_charger *chg, return 0; } int smblib_get_prop_batt_voltage_now(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, val); return rc; } int smblib_get_prop_batt_current_now(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_CURRENT_NOW, val); return rc; } int smblib_get_prop_batt_temp(struct smb_charger *chg, union power_supply_propval *val) { int rc; if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_TEMP, val); return rc; } int smblib_get_prop_batt_charge_done(struct smb_charger *chg, union power_supply_propval *val) { Loading Loading @@ -1823,7 +1785,8 @@ int smblib_get_prop_charge_qnovo_enable(struct smb_charger *chg, return 0; } int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, int smblib_get_prop_from_bms(struct smb_charger *chg, enum power_supply_property psp, union power_supply_propval *val) { int rc; Loading @@ -1831,8 +1794,8 @@ int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, if (!chg->bms_psy) return -EINVAL; rc = power_supply_get_property(chg->bms_psy, POWER_SUPPLY_PROP_CHARGE_COUNTER, val); rc = power_supply_get_property(chg->bms_psy, psp, val); return rc; } Loading
drivers/power/smb-lib.h +3 −8 Original line number Diff line number Diff line Loading @@ -404,14 +404,6 @@ int smblib_get_prop_system_temp_level(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_input_current_limited(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_voltage_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_current_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_temp(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_batt_charge_counter(struct smb_charger *chg, union power_supply_propval *val); 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, Loading Loading @@ -500,6 +492,9 @@ int smblib_get_icl_current(struct smb_charger *chg, int *icl_ua); int smblib_get_charge_current(struct smb_charger *chg, int *total_current_ua); int smblib_get_prop_pr_swap_in_progress(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_from_bms(struct smb_charger *chg, enum power_supply_property psp, union power_supply_propval *val); int smblib_set_prop_pr_swap_in_progress(struct smb_charger *chg, const union power_supply_propval *val); Loading