milletltetmo: fix battery counting

Before, device booted only with charger plugged in and showed 0%. Source wasn't ok to handle sec-fuelgauge correctly.

Change-Id: If19ed4877fc965c588e65a2deef3977a192aa30a
This commit is contained in:
prototype74
2020-12-09 16:03:14 +01:00
committed by Francescodario Cuzzocrea
parent b9965297b1
commit 33ebfecd87
3 changed files with 16 additions and 3 deletions
@@ -2304,9 +2304,9 @@ CONFIG_POWER_SUPPLY=y
# CONFIG_QPNP_CHARGER is not set
# CONFIG_QPNP_SEC_CHARGER is not set
# CONFIG_LTC4088_CHARGER is not set
CONFIG_BATTERY_BCL=y
# CONFIG_BATTERY_BCL is not set
# CONFIG_CHARGER_SMB347 is not set
CONFIG_QPNP_BMS=y
# CONFIG_QPNP_BMS is not set
CONFIG_HWMON=y
# CONFIG_HWMON_VID is not set
# CONFIG_HWMON_DEBUG_CHIP is not set
@@ -3800,7 +3800,8 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE=""
# CONFIG_FUELGAUGE_DUMMY is not set
# CONFIG_FUELGAUGE_MAX17042 is not set
# CONFIG_FUELGAUGE_MAX17048 is not set
# CONFIG_FUELGAUGE_MAX17050 is not set
CONFIG_FUELGAUGE_MAX17050=y
CONFIG_FUELGAUGE_MAX17050_COULOMB_COUNTING=y
# CONFIG_FUELGAUGE_MAX77823 is not set
# CONFIG_CHARGER_DUMMY is not set
# CONFIG_CHARGER_SMB328 is not set
+10
View File
@@ -2072,8 +2072,13 @@ static int get_fuelgauge_soc(struct i2c_client *client)
goto return_soc;
}
#if defined(ANDROID_ALARM_ACTIVATED)
current_time = alarm_get_elapsed_realtime();
ts = ktime_to_timespec(current_time);
#else
current_time = ktime_get_boottime();
ts = ktime_to_timespec(current_time);
#endif
/* check fullcap range */
fullcap_check_interval =
@@ -2218,8 +2223,13 @@ bool sec_hal_fg_init(struct i2c_client *client)
ktime_t current_time;
struct timespec ts;
#if defined(ANDROID_ALARM_ACTIVATED)
current_time = alarm_get_elapsed_realtime();
ts = ktime_to_timespec(current_time);
#else
current_time = ktime_get_boottime();
ts = ktime_to_timespec(current_time);
#endif
board_fuelgauge_init(fuelgauge);
@@ -18,7 +18,9 @@
#ifndef __MAX17050_FUELGAUGE_H
#define __MAX17050_FUELGAUGE_H __FILE__
#if defined(ANDROID_ALARM_ACTIVATED)
#include <linux/android_alarm.h>
#endif
#if defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || \
defined(CONFIG_MACH_LT03LGT) || defined(CONFIG_MACH_MONDRIAN)