Loading drivers/power/supply/qcom/qg-core.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. */ #ifndef __QG_CORE_H__ Loading Loading @@ -154,6 +154,7 @@ struct qpnp_qg { bool fvss_active; bool tcss_active; bool bass_active; bool first_profile_load; int charge_status; int charge_type; int chg_iterm_ma; Loading drivers/power/supply/qcom/qg-iio.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2020 The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. */ #ifndef __QG_IIO_H Loading Loading @@ -91,6 +91,7 @@ static const struct qg_iio_channels qg_iio_psy_channels[] = { QG_CHAN_RES("esr_actual", PSY_IIO_ESR_ACTUAL) QG_CHAN_RES("esr_nominal", PSY_IIO_ESR_NOMINAL) QG_CHAN_INDEX("soh", PSY_IIO_SOH) QG_CHAN_INDEX("clear_soh", PSY_IIO_CLEAR_SOH) QG_CHAN_ENERGY("cc_soc", PSY_IIO_CC_SOC) QG_CHAN_ACT("fg_reset", PSY_IIO_FG_RESET) QG_CHAN_VOLT("voltage_avg", PSY_IIO_VOLTAGE_AVG) Loading drivers/power/supply/qcom/qpnp-qg.c +8 −0 Original line number Diff line number Diff line Loading @@ -2135,6 +2135,9 @@ static int qg_iio_write_raw(struct iio_dev *indio_dev, if (chip->sp) soh_profile_update(chip->sp, chip->soh); break; case PSY_IIO_CLEAR_SOH: chip->first_profile_load = val1; break; case PSY_IIO_ESR_ACTUAL: chip->esr_actual = val1; break; Loading Loading @@ -2260,6 +2263,9 @@ static int qg_iio_read_raw(struct iio_dev *indio_dev, case PSY_IIO_SOH: *val1 = chip->soh; break; case PSY_IIO_CLEAR_SOH: *val1 = chip->first_profile_load; break; case PSY_IIO_CC_SOC: rc = qg_get_cc_soc(chip, val1); break; Loading Loading @@ -3470,6 +3476,7 @@ static int qg_sanitize_sdam(struct qpnp_qg *chip) rc = qg_sdam_write(SDAM_MAGIC, SDAM_MAGIC_NUMBER); if (!rc) qg_dbg(chip, QG_DEBUG_PON, "First boot. SDAM initilized\n"); chip->first_profile_load = true; } else { /* SDAM has invalid value */ rc = qg_sdam_clear(); Loading @@ -3477,6 +3484,7 @@ static int qg_sanitize_sdam(struct qpnp_qg *chip) pr_err("SDAM uninitialized, SDAM reset\n"); rc = qg_sdam_write(SDAM_MAGIC, SDAM_MAGIC_NUMBER); } chip->first_profile_load = true; } if (rc < 0) Loading include/dt-bindings/iio/qti_power_supply_iio.h +3 −0 Original line number Diff line number Diff line Loading @@ -151,4 +151,7 @@ /* USB */ #define PSY_IIO_MOISTURE_DETECTION_EN 0x7b /* BMS */ #define PSY_IIO_CLEAR_SOH 0x7c #endif /* __QTI_POWER_SUPPLY_IIO_H__ */ Loading
drivers/power/supply/qcom/qg-core.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. */ #ifndef __QG_CORE_H__ Loading Loading @@ -154,6 +154,7 @@ struct qpnp_qg { bool fvss_active; bool tcss_active; bool bass_active; bool first_profile_load; int charge_status; int charge_type; int chg_iterm_ma; Loading
drivers/power/supply/qcom/qg-iio.h +2 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2020 The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. */ #ifndef __QG_IIO_H Loading Loading @@ -91,6 +91,7 @@ static const struct qg_iio_channels qg_iio_psy_channels[] = { QG_CHAN_RES("esr_actual", PSY_IIO_ESR_ACTUAL) QG_CHAN_RES("esr_nominal", PSY_IIO_ESR_NOMINAL) QG_CHAN_INDEX("soh", PSY_IIO_SOH) QG_CHAN_INDEX("clear_soh", PSY_IIO_CLEAR_SOH) QG_CHAN_ENERGY("cc_soc", PSY_IIO_CC_SOC) QG_CHAN_ACT("fg_reset", PSY_IIO_FG_RESET) QG_CHAN_VOLT("voltage_avg", PSY_IIO_VOLTAGE_AVG) Loading
drivers/power/supply/qcom/qpnp-qg.c +8 −0 Original line number Diff line number Diff line Loading @@ -2135,6 +2135,9 @@ static int qg_iio_write_raw(struct iio_dev *indio_dev, if (chip->sp) soh_profile_update(chip->sp, chip->soh); break; case PSY_IIO_CLEAR_SOH: chip->first_profile_load = val1; break; case PSY_IIO_ESR_ACTUAL: chip->esr_actual = val1; break; Loading Loading @@ -2260,6 +2263,9 @@ static int qg_iio_read_raw(struct iio_dev *indio_dev, case PSY_IIO_SOH: *val1 = chip->soh; break; case PSY_IIO_CLEAR_SOH: *val1 = chip->first_profile_load; break; case PSY_IIO_CC_SOC: rc = qg_get_cc_soc(chip, val1); break; Loading Loading @@ -3470,6 +3476,7 @@ static int qg_sanitize_sdam(struct qpnp_qg *chip) rc = qg_sdam_write(SDAM_MAGIC, SDAM_MAGIC_NUMBER); if (!rc) qg_dbg(chip, QG_DEBUG_PON, "First boot. SDAM initilized\n"); chip->first_profile_load = true; } else { /* SDAM has invalid value */ rc = qg_sdam_clear(); Loading @@ -3477,6 +3484,7 @@ static int qg_sanitize_sdam(struct qpnp_qg *chip) pr_err("SDAM uninitialized, SDAM reset\n"); rc = qg_sdam_write(SDAM_MAGIC, SDAM_MAGIC_NUMBER); } chip->first_profile_load = true; } if (rc < 0) Loading
include/dt-bindings/iio/qti_power_supply_iio.h +3 −0 Original line number Diff line number Diff line Loading @@ -151,4 +151,7 @@ /* USB */ #define PSY_IIO_MOISTURE_DETECTION_EN 0x7b /* BMS */ #define PSY_IIO_CLEAR_SOH 0x7c #endif /* __QTI_POWER_SUPPLY_IIO_H__ */