drivers: power: Guard SMB5_QG_SOH function

* Fixes battery detection for denver

Change-Id: I16087f472b8f06002486141dec23e4a2ef3f9688
This commit is contained in:
Vivekachooz 2025-08-18 12:00:47 +05:30
commit e7e3836bc3
No known key found for this signature in database
GPG key ID: B7434A1044B09189
3 changed files with 8 additions and 0 deletions

View file

@ -4815,7 +4815,11 @@ static int qpnp_qg_probe(struct platform_device *pdev)
chip->sys_soc = INT_MIN;
chip->full_soc = QG_SOC_FULL;
chip->chg_iterm_ma = INT_MIN;
#ifdef CONFIG_DENVER_DTB
chip->soh = -EINVAL;
#else
chip->soh = 100;
#endif
chip->esr_actual = -EINVAL;
chip->esr_nominal = -EINVAL;
chip->batt_age_level = -EINVAL;

View file

@ -33,7 +33,9 @@ enum qg_chg_iio_channels {
SMB5_QG_CYCLE_COUNT,
SMB5_QG_CHARGE_FULL_DESIGN,
SMB5_QG_TIME_TO_FULL_NOW,
#ifndef CONFIG_DENVER_DTB
SMB5_QG_SOH,
#endif
};
enum mmi_cp_iio_channels {

View file

@ -915,7 +915,9 @@ static const char * const smblib_qg_ext_iio_chan[] = {
[SMB5_QG_CYCLE_COUNT] = "cycle_count",
[SMB5_QG_CHARGE_FULL_DESIGN] = "charge_full_design",
[SMB5_QG_TIME_TO_FULL_NOW] = "time_to_full_now",
#ifndef CONFIG_DENVER_DTB
[SMB5_QG_SOH] = "soh",
#endif
};
static int smblib_read_iio_prop(struct smb_charger *chg,