mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
power: android-battery: Provide fake values when fuel gauge missing
Avoid shutdown due to battery capacity or temperature out of range. Change-Id: I54abe4dc54bf2fb8a9b972a3940e6fd93cc60473 Signed-off-by: Todd Poynor <toddpoynor@google.com>
This commit is contained in:
committed by
Arve Hjønnevåg
parent
9993b96e30
commit
57992fa2fb
@@ -148,7 +148,7 @@ static int android_bat_get_property(struct power_supply *ps,
|
||||
|
||||
static void android_bat_get_temp(struct android_bat_data *battery)
|
||||
{
|
||||
int batt_temp = 250000; /* 25.0C */
|
||||
int batt_temp = 42000; /* 4.2C */
|
||||
int health = battery->batt_health;
|
||||
|
||||
if (battery->pdata->get_temperature)
|
||||
@@ -192,12 +192,12 @@ static void android_bat_update_data(struct android_bat_data *battery)
|
||||
|
||||
if (battery->pdata->get_voltage_now) {
|
||||
ret = battery->pdata->get_voltage_now();
|
||||
battery->batt_vcell = ret >= 0 ? ret : -1;
|
||||
battery->batt_vcell = ret >= 0 ? ret : 4242000;
|
||||
}
|
||||
|
||||
if (battery->pdata->get_capacity) {
|
||||
ret = battery->pdata->get_capacity();
|
||||
battery->batt_soc = ret >= 0 ? ret : -1;
|
||||
battery->batt_soc = ret >= 0 ? ret : 42;
|
||||
}
|
||||
|
||||
if (battery->pdata->get_current_now) {
|
||||
|
||||
Reference in New Issue
Block a user