Loading drivers/power/supply/qcom/qpnp-smb5.c +27 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -1215,7 +1215,9 @@ static enum power_supply_property smb5_batt_props[] = { POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_QNOVO, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_QNOVO, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, POWER_SUPPLY_PROP_TEMP, Loading Loading @@ -1293,10 +1295,18 @@ static int smb5_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->fv_votable, BATT_PROFILE_VOTER); break; case POWER_SUPPLY_PROP_VOLTAGE_QNOVO: val->intval = get_client_vote_locked(chg->fv_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_NOW: rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_CURRENT_NOW, val); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: val->intval = get_client_vote_locked(chg->fcc_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: val->intval = get_client_vote(chg->fcc_votable, BATT_PROFILE_VOTER); Loading Loading @@ -1397,6 +1407,10 @@ static int smb5_batt_set_prop(struct power_supply *psy, chg->batt_profile_fv_uv = val->intval; vote(chg->fv_votable, BATT_PROFILE_VOTER, true, val->intval); break; case POWER_SUPPLY_PROP_VOLTAGE_QNOVO: vote(chg->fv_votable, QNOVO_VOTER, (val->intval >= 0), val->intval); break; case POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED: chg->step_chg_enabled = !!val->intval; break; Loading @@ -1411,6 +1425,18 @@ static int smb5_batt_set_prop(struct power_supply *psy, chg->batt_profile_fcc_ua = val->intval; vote(chg->fcc_votable, BATT_PROFILE_VOTER, true, val->intval); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: vote(chg->pl_disable_votable, PL_QNOVO_VOTER, val->intval != -EINVAL && val->intval < 2000000, 0); if (val->intval == -EINVAL) { vote(chg->fcc_votable, BATT_PROFILE_VOTER, true, chg->batt_profile_fcc_ua); vote(chg->fcc_votable, QNOVO_VOTER, false, 0); } else { vote(chg->fcc_votable, QNOVO_VOTER, true, val->intval); vote(chg->fcc_votable, BATT_PROFILE_VOTER, false, 0); } break; case POWER_SUPPLY_PROP_SET_SHIP_MODE: /* Not in ship mode as long as the device is active */ if (!val->intval) Loading drivers/power/supply/qcom/smb1355-charger.c +2 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "SMB1355: %s: " fmt, __func__ Loading Loading @@ -1357,7 +1357,7 @@ static int smb1355_probe(struct platform_device *pdev) chip->c_charger_temp_max = -EINVAL; mutex_init(&chip->write_lock); INIT_DELAYED_WORK(&chip->die_temp_work, die_temp_work); chip->disabled = true; chip->disabled = false; chip->die_temp_deciDegC = -EINVAL; chip->regmap = dev_get_regmap(chip->dev->parent, NULL); Loading drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ enum print_reason { #define SW_QC3_VOTER "SW_QC3_VOTER" #define AICL_RERUN_VOTER "AICL_RERUN_VOTER" #define SW_ICL_MAX_VOTER "SW_ICL_MAX_VOTER" #define PL_QNOVO_VOTER "PL_QNOVO_VOTER" #define QNOVO_VOTER "QNOVO_VOTER" #define BATT_PROFILE_VOTER "BATT_PROFILE_VOTER" #define OTG_DELAY_VOTER "OTG_DELAY_VOTER" Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +27 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -1215,7 +1215,9 @@ static enum power_supply_property smb5_batt_props[] = { POWER_SUPPLY_PROP_INPUT_CURRENT_LIMITED, POWER_SUPPLY_PROP_VOLTAGE_NOW, POWER_SUPPLY_PROP_VOLTAGE_MAX, POWER_SUPPLY_PROP_VOLTAGE_QNOVO, POWER_SUPPLY_PROP_CURRENT_NOW, POWER_SUPPLY_PROP_CURRENT_QNOVO, POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, POWER_SUPPLY_PROP_TEMP, Loading Loading @@ -1293,10 +1295,18 @@ static int smb5_batt_get_prop(struct power_supply *psy, val->intval = get_client_vote(chg->fv_votable, BATT_PROFILE_VOTER); break; case POWER_SUPPLY_PROP_VOLTAGE_QNOVO: val->intval = get_client_vote_locked(chg->fv_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CURRENT_NOW: rc = smblib_get_prop_from_bms(chg, POWER_SUPPLY_PROP_CURRENT_NOW, val); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: val->intval = get_client_vote_locked(chg->fcc_votable, QNOVO_VOTER); break; case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: val->intval = get_client_vote(chg->fcc_votable, BATT_PROFILE_VOTER); Loading Loading @@ -1397,6 +1407,10 @@ static int smb5_batt_set_prop(struct power_supply *psy, chg->batt_profile_fv_uv = val->intval; vote(chg->fv_votable, BATT_PROFILE_VOTER, true, val->intval); break; case POWER_SUPPLY_PROP_VOLTAGE_QNOVO: vote(chg->fv_votable, QNOVO_VOTER, (val->intval >= 0), val->intval); break; case POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED: chg->step_chg_enabled = !!val->intval; break; Loading @@ -1411,6 +1425,18 @@ static int smb5_batt_set_prop(struct power_supply *psy, chg->batt_profile_fcc_ua = val->intval; vote(chg->fcc_votable, BATT_PROFILE_VOTER, true, val->intval); break; case POWER_SUPPLY_PROP_CURRENT_QNOVO: vote(chg->pl_disable_votable, PL_QNOVO_VOTER, val->intval != -EINVAL && val->intval < 2000000, 0); if (val->intval == -EINVAL) { vote(chg->fcc_votable, BATT_PROFILE_VOTER, true, chg->batt_profile_fcc_ua); vote(chg->fcc_votable, QNOVO_VOTER, false, 0); } else { vote(chg->fcc_votable, QNOVO_VOTER, true, val->intval); vote(chg->fcc_votable, BATT_PROFILE_VOTER, false, 0); } break; case POWER_SUPPLY_PROP_SET_SHIP_MODE: /* Not in ship mode as long as the device is active */ if (!val->intval) Loading
drivers/power/supply/qcom/smb1355-charger.c +2 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "SMB1355: %s: " fmt, __func__ Loading Loading @@ -1357,7 +1357,7 @@ static int smb1355_probe(struct platform_device *pdev) chip->c_charger_temp_max = -EINVAL; mutex_init(&chip->write_lock); INIT_DELAYED_WORK(&chip->die_temp_work, die_temp_work); chip->disabled = true; chip->disabled = false; chip->die_temp_deciDegC = -EINVAL; chip->regmap = dev_get_regmap(chip->dev->parent, NULL); Loading
drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ enum print_reason { #define SW_QC3_VOTER "SW_QC3_VOTER" #define AICL_RERUN_VOTER "AICL_RERUN_VOTER" #define SW_ICL_MAX_VOTER "SW_ICL_MAX_VOTER" #define PL_QNOVO_VOTER "PL_QNOVO_VOTER" #define QNOVO_VOTER "QNOVO_VOTER" #define BATT_PROFILE_VOTER "BATT_PROFILE_VOTER" #define OTG_DELAY_VOTER "OTG_DELAY_VOTER" Loading