Loading drivers/power/supply/qcom/qpnp-smb5.c +1 −1 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ static int smb5_usb_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->usb_icl_votable, PD_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_prop_input_current_settled(chg, val); rc = smblib_get_prop_input_current_max(chg, val); break; case POWER_SUPPLY_PROP_TYPE: val->intval = POWER_SUPPLY_TYPE_USB_PD; Loading drivers/power/supply/qcom/smb5-lib.c +19 −0 Original line number Diff line number Diff line Loading @@ -1350,6 +1350,7 @@ static int smblib_get_pulse_cnt(struct smb_charger *chg, int *count) #define USBIN_150MA 150000 #define USBIN_500MA 500000 #define USBIN_900MA 900000 #define USBIN_1000MA 1000000 static int set_sdp_current(struct smb_charger *chg, int icl_ua) { int rc; Loading Loading @@ -3947,6 +3948,24 @@ int smblib_get_prop_input_current_settled(struct smb_charger *chg, return smblib_get_charge_param(chg, &chg->param.icl_stat, &val->intval); } int smblib_get_prop_input_current_max(struct smb_charger *chg, union power_supply_propval *val) { int icl_ua = 0, rc; rc = smblib_get_charge_param(chg, &chg->param.usb_icl, &icl_ua); if (rc < 0) return rc; if (is_override_vote_enabled_locked(chg->usb_icl_votable) && icl_ua < USBIN_1000MA) { val->intval = USBIN_1000MA; return 0; } return smblib_get_charge_param(chg, &chg->param.icl_stat, &val->intval); } int smblib_get_prop_input_voltage_settled(struct smb_charger *chg, union power_supply_propval *val) { Loading drivers/power/supply/qcom/smb5-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,8 @@ int smblib_get_die_health(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_smb_health(struct smb_charger *chg); int smblib_get_prop_connector_health(struct smb_charger *chg); int smblib_get_prop_input_current_max(struct smb_charger *chg, union power_supply_propval *val); int smblib_set_prop_thermal_overheat(struct smb_charger *chg, int therm_overheat); int smblib_get_skin_temp_status(struct smb_charger *chg); Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +1 −1 Original line number Diff line number Diff line Loading @@ -919,7 +919,7 @@ static int smb5_usb_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->usb_icl_votable, PD_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_prop_input_current_settled(chg, val); rc = smblib_get_prop_input_current_max(chg, val); break; case POWER_SUPPLY_PROP_TYPE: val->intval = POWER_SUPPLY_TYPE_USB_PD; Loading
drivers/power/supply/qcom/smb5-lib.c +19 −0 Original line number Diff line number Diff line Loading @@ -1350,6 +1350,7 @@ static int smblib_get_pulse_cnt(struct smb_charger *chg, int *count) #define USBIN_150MA 150000 #define USBIN_500MA 500000 #define USBIN_900MA 900000 #define USBIN_1000MA 1000000 static int set_sdp_current(struct smb_charger *chg, int icl_ua) { int rc; Loading Loading @@ -3947,6 +3948,24 @@ int smblib_get_prop_input_current_settled(struct smb_charger *chg, return smblib_get_charge_param(chg, &chg->param.icl_stat, &val->intval); } int smblib_get_prop_input_current_max(struct smb_charger *chg, union power_supply_propval *val) { int icl_ua = 0, rc; rc = smblib_get_charge_param(chg, &chg->param.usb_icl, &icl_ua); if (rc < 0) return rc; if (is_override_vote_enabled_locked(chg->usb_icl_votable) && icl_ua < USBIN_1000MA) { val->intval = USBIN_1000MA; return 0; } return smblib_get_charge_param(chg, &chg->param.icl_stat, &val->intval); } int smblib_get_prop_input_voltage_settled(struct smb_charger *chg, union power_supply_propval *val) { Loading
drivers/power/supply/qcom/smb5-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,8 @@ int smblib_get_die_health(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_smb_health(struct smb_charger *chg); int smblib_get_prop_connector_health(struct smb_charger *chg); int smblib_get_prop_input_current_max(struct smb_charger *chg, union power_supply_propval *val); int smblib_set_prop_thermal_overheat(struct smb_charger *chg, int therm_overheat); int smblib_get_skin_temp_status(struct smb_charger *chg); Loading