Loading drivers/power/supply/qcom/qpnp-smbcharger.c +31 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, 2018-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1133,6 +1133,28 @@ static int get_prop_batt_voltage_max_design(struct smbchg_chip *chip) return uv; } static int get_prop_batt_charge_counter(struct smbchg_chip *chip) { int bcc = 0, rc; rc = get_property_from_fg(chip, POWER_SUPPLY_PROP_CHARGE_COUNTER, &bcc); if (rc) pr_smb(PR_STATUS, "Couldn't get charge_counter rc = %d\n", rc); return bcc; } static int get_prop_batt_cycle_count(struct smbchg_chip *chip) { int bcc = 0, rc; rc = get_property_from_fg(chip, POWER_SUPPLY_PROP_CYCLE_COUNT, &bcc); if (rc) pr_smb(PR_STATUS, "Couldn't get cycle_count rc = %d\n", rc); return bcc; } static int get_prop_batt_health(struct smbchg_chip *chip) { if (chip->batt_hot) Loading Loading @@ -5899,6 +5921,8 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_RESTRICTED_CHARGING, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_CYCLE_COUNT, }; static int smbchg_battery_set_property(struct power_supply *psy, Loading Loading @@ -6118,6 +6142,12 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED: val->intval = chip->max_pulse_allowed; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: val->intval = get_prop_batt_charge_counter(chip); break; case POWER_SUPPLY_PROP_CYCLE_COUNT: val->intval = get_prop_batt_cycle_count(chip); break; default: return -EINVAL; } Loading Loading
drivers/power/supply/qcom/qpnp-smbcharger.c +31 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, 2018-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1133,6 +1133,28 @@ static int get_prop_batt_voltage_max_design(struct smbchg_chip *chip) return uv; } static int get_prop_batt_charge_counter(struct smbchg_chip *chip) { int bcc = 0, rc; rc = get_property_from_fg(chip, POWER_SUPPLY_PROP_CHARGE_COUNTER, &bcc); if (rc) pr_smb(PR_STATUS, "Couldn't get charge_counter rc = %d\n", rc); return bcc; } static int get_prop_batt_cycle_count(struct smbchg_chip *chip) { int bcc = 0, rc; rc = get_property_from_fg(chip, POWER_SUPPLY_PROP_CYCLE_COUNT, &bcc); if (rc) pr_smb(PR_STATUS, "Couldn't get cycle_count rc = %d\n", rc); return bcc; } static int get_prop_batt_health(struct smbchg_chip *chip) { if (chip->batt_hot) Loading Loading @@ -5899,6 +5921,8 @@ static enum power_supply_property smbchg_battery_properties[] = { POWER_SUPPLY_PROP_RESTRICTED_CHARGING, POWER_SUPPLY_PROP_ALLOW_HVDCP3, POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED, POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_CYCLE_COUNT, }; static int smbchg_battery_set_property(struct power_supply *psy, Loading Loading @@ -6118,6 +6142,12 @@ static int smbchg_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_MAX_PULSE_ALLOWED: val->intval = chip->max_pulse_allowed; break; case POWER_SUPPLY_PROP_CHARGE_COUNTER: val->intval = get_prop_batt_charge_counter(chip); break; case POWER_SUPPLY_PROP_CYCLE_COUNT: val->intval = get_prop_batt_cycle_count(chip); break; default: return -EINVAL; } Loading