mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
mmi_smbcharger_iio: Get batt cycyle_count from qcom_fg
PROPAGATED_from (CR) For only use a fuelgauge product, Getting the battery cycle_count value via gauge_phy. Change-Id: I31563e3a18a4154d94b8bf7da9f6a85a8e98c7ab Signed-off-by: liuyc20 <liuyc20@lenovo.com> Reviewed-on: https://gerrit.mot.com/3099247 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Haijian Ma <mahj8@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key Signed-off-by: Robert Cabral <robertc@motorola.com> Reviewed-on: https://gerrit.mot.com/3157742 Reviewed-by: Hugo Cuffa <hcuffa@motorola.com> Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
This commit is contained in:
parent
76615754e9
commit
986fcfea9d
1 changed files with 4 additions and 6 deletions
|
|
@ -4510,12 +4510,10 @@ static int batt_get_prop(struct power_supply *psy,
|
|||
val->intval = chip->last_reported_soc;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CYCLE_COUNT:
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,25)
|
||||
rc = power_supply_get_property(chip->qcom_psy,
|
||||
psp, val);
|
||||
#else
|
||||
val->intval = chip->cycles / 100;
|
||||
#endif
|
||||
if (chip->max_main_psy && chip->max_flip_psy)
|
||||
val->intval = chip->cycles / 100;
|
||||
else
|
||||
rc = power_supply_get_property(chip->qcom_psy, psp, val);
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_HEALTH:
|
||||
if (chip->max_main_psy && chip->max_flip_psy)
|
||||
|
|
|
|||
Loading…
Reference in a new issue