mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
drivers: power: Add CONFIG_QG_LEGACY for legacy devices
* Fixes battery detection for legacy devices Co-authored-by: marcost2 <marcostolcachir@gmail.com> Change-Id: Ibd13f278a38ca80e593a0d4e0c14389faad580dc
This commit is contained in:
parent
cbfc018bd2
commit
06c7efd80c
4 changed files with 11 additions and 3 deletions
|
|
@ -7,3 +7,11 @@ config MMI_SMBCHARGER_IIO
|
|||
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called mmi-smbcharger-iio.
|
||||
|
||||
config QG_LEGACY
|
||||
bool "Legacy behavior for QG fuel gauge (disable SOH)"
|
||||
depends on MMI_SMBCHARGER_IIO
|
||||
default n
|
||||
help
|
||||
Says Y if you want to disable QG SOH channel and use legacy
|
||||
battery detection path.
|
||||
|
|
|
|||
|
|
@ -4815,7 +4815,7 @@ 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
|
||||
#ifdef CONFIG_QG_LEGACY
|
||||
chip->soh = -EINVAL;
|
||||
#else
|
||||
chip->soh = 100;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ enum qg_chg_iio_channels {
|
|||
SMB5_QG_CYCLE_COUNT,
|
||||
SMB5_QG_CHARGE_FULL_DESIGN,
|
||||
SMB5_QG_TIME_TO_FULL_NOW,
|
||||
#ifndef CONFIG_DENVER_DTB
|
||||
#ifndef CONFIG_QG_LEGACY
|
||||
SMB5_QG_SOH,
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -915,7 +915,7 @@ 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
|
||||
#ifndef CONFIG_QG_LEGACY
|
||||
[SMB5_QG_SOH] = "soh",
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue