Loading drivers/power/supply/qcom/qpnp-smb5.c +4 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,7 @@ static enum power_supply_property smb5_usb_props[] = { POWER_SUPPLY_PROP_SDP_CURRENT_MAX, POWER_SUPPLY_PROP_CONNECTOR_TYPE, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_SCOPE, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_HVDCP_OPTI_ALLOWED, Loading Loading @@ -572,6 +573,9 @@ static int smb5_usb_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_MAX: rc = smblib_get_prop_usb_voltage_max(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: rc = smblib_get_prop_usb_voltage_max_design(chg, val); break; case POWER_SUPPLY_PROP_PD_CURRENT_MAX: val->intval = get_client_vote(chg->usb_icl_votable, PD_VOTER); break; Loading drivers/power/supply/qcom/smb5-lib.c +22 −0 Original line number Diff line number Diff line Loading @@ -1890,6 +1890,28 @@ int smblib_get_prop_usb_online(struct smb_charger *chg, int smblib_get_prop_usb_voltage_max(struct smb_charger *chg, union power_supply_propval *val) { switch (chg->real_charger_type) { case POWER_SUPPLY_TYPE_USB_HVDCP: case POWER_SUPPLY_TYPE_USB_HVDCP_3: if (chg->smb_version == PMI632_SUBTYPE) val->intval = MICRO_9V; else val->intval = MICRO_12V; break; case POWER_SUPPLY_TYPE_USB_PD: val->intval = chg->voltage_max_uv; break; default: val->intval = MICRO_5V; break; } return 0; } int smblib_get_prop_usb_voltage_max_design(struct smb_charger *chg, union power_supply_propval *val) { switch (chg->real_charger_type) { case POWER_SUPPLY_TYPE_USB_HVDCP: Loading drivers/power/supply/qcom/smb5-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -495,6 +495,8 @@ int smblib_get_prop_usb_suspend(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_voltage_max(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_voltage_max_design(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_typec_cc_orientation(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_typec_power_role(struct smb_charger *chg, Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +4 −0 Original line number Diff line number Diff line Loading @@ -535,6 +535,7 @@ static enum power_supply_property smb5_usb_props[] = { POWER_SUPPLY_PROP_SDP_CURRENT_MAX, POWER_SUPPLY_PROP_CONNECTOR_TYPE, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_SCOPE, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_HVDCP_OPTI_ALLOWED, Loading Loading @@ -572,6 +573,9 @@ static int smb5_usb_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_MAX: rc = smblib_get_prop_usb_voltage_max(chg, val); break; case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: rc = smblib_get_prop_usb_voltage_max_design(chg, val); break; case POWER_SUPPLY_PROP_PD_CURRENT_MAX: val->intval = get_client_vote(chg->usb_icl_votable, PD_VOTER); break; Loading
drivers/power/supply/qcom/smb5-lib.c +22 −0 Original line number Diff line number Diff line Loading @@ -1890,6 +1890,28 @@ int smblib_get_prop_usb_online(struct smb_charger *chg, int smblib_get_prop_usb_voltage_max(struct smb_charger *chg, union power_supply_propval *val) { switch (chg->real_charger_type) { case POWER_SUPPLY_TYPE_USB_HVDCP: case POWER_SUPPLY_TYPE_USB_HVDCP_3: if (chg->smb_version == PMI632_SUBTYPE) val->intval = MICRO_9V; else val->intval = MICRO_12V; break; case POWER_SUPPLY_TYPE_USB_PD: val->intval = chg->voltage_max_uv; break; default: val->intval = MICRO_5V; break; } return 0; } int smblib_get_prop_usb_voltage_max_design(struct smb_charger *chg, union power_supply_propval *val) { switch (chg->real_charger_type) { case POWER_SUPPLY_TYPE_USB_HVDCP: Loading
drivers/power/supply/qcom/smb5-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -495,6 +495,8 @@ int smblib_get_prop_usb_suspend(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_voltage_max(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_voltage_max_design(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_typec_cc_orientation(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_typec_power_role(struct smb_charger *chg, Loading