Loading drivers/power/supply/qcom/qpnp-smb2.c +4 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,7 @@ static enum power_supply_property smb2_usb_props[] = { POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_ONLINE, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_PD_CURRENT_MAX, POWER_SUPPLY_PROP_CURRENT_MAX, Loading Loading @@ -401,6 +402,9 @@ static int smb2_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_VOLTAGE_NOW: rc = smblib_get_prop_usb_voltage_now(chg, val); break; Loading drivers/power/supply/qcom/smb-lib.c +22 −0 Original line number Diff line number Diff line Loading @@ -2411,6 +2411,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 == PM660_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/smb-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -475,6 +475,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_usb_voltage_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_current_now(struct smb_charger *chg, Loading Loading
drivers/power/supply/qcom/qpnp-smb2.c +4 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,7 @@ static enum power_supply_property smb2_usb_props[] = { POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_ONLINE, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_PD_CURRENT_MAX, POWER_SUPPLY_PROP_CURRENT_MAX, Loading Loading @@ -401,6 +402,9 @@ static int smb2_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_VOLTAGE_NOW: rc = smblib_get_prop_usb_voltage_now(chg, val); break; Loading
drivers/power/supply/qcom/smb-lib.c +22 −0 Original line number Diff line number Diff line Loading @@ -2411,6 +2411,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 == PM660_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/smb-lib.h +2 −0 Original line number Diff line number Diff line Loading @@ -475,6 +475,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_usb_voltage_now(struct smb_charger *chg, union power_supply_propval *val); int smblib_get_prop_usb_current_now(struct smb_charger *chg, Loading