Loading drivers/power/qpnp-smbcharger.c +22 −0 Original line number Diff line number Diff line Loading @@ -5940,6 +5940,24 @@ static int smbchg_get_prop_batt_charge_counter(struct smbchg_chip *chip) return val.intval; } static int smbchg_get_prop_batt_current_max(struct smbchg_chip *chip) { int rc; union power_supply_propval val; if (!chip->usb_psy) return -EINVAL; rc = power_supply_get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &val); if (rc < 0) { pr_smb(PR_STATUS, "Couldn't get current max rc = %d\n", rc); return rc; } return val.intval; } static void update_typec_capability_status(struct smbchg_chip *chip, const union power_supply_propval *val) { Loading Loading @@ -6118,6 +6136,7 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_VOLTAGE_NOW, Loading Loading @@ -6283,6 +6302,9 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_MAX: val->intval = smbchg_float_voltage_get(chip); break; case POWER_SUPPLY_PROP_CURRENT_MAX: val->intval = smbchg_get_prop_batt_current_max(chip); break; case POWER_SUPPLY_PROP_HEALTH: val->intval = get_prop_batt_health(chip); break; Loading Loading
drivers/power/qpnp-smbcharger.c +22 −0 Original line number Diff line number Diff line Loading @@ -5940,6 +5940,24 @@ static int smbchg_get_prop_batt_charge_counter(struct smbchg_chip *chip) return val.intval; } static int smbchg_get_prop_batt_current_max(struct smbchg_chip *chip) { int rc; union power_supply_propval val; if (!chip->usb_psy) return -EINVAL; rc = power_supply_get_property(chip->usb_psy, POWER_SUPPLY_PROP_CURRENT_MAX, &val); if (rc < 0) { pr_smb(PR_STATUS, "Couldn't get current max rc = %d\n", rc); return rc; } return val.intval; } static void update_typec_capability_status(struct smbchg_chip *chip, const union power_supply_propval *val) { Loading Loading @@ -6118,6 +6136,7 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_TEMP, POWER_SUPPLY_PROP_VOLTAGE_NOW, Loading Loading @@ -6283,6 +6302,9 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_VOLTAGE_MAX: val->intval = smbchg_float_voltage_get(chip); break; case POWER_SUPPLY_PROP_CURRENT_MAX: val->intval = smbchg_get_prop_batt_current_max(chip); break; case POWER_SUPPLY_PROP_HEALTH: val->intval = get_prop_batt_health(chip); break; Loading