From: Todd Poynor Date: Thu, 23 Aug 2012 02:02:26 +0000 (-0700) Subject: power: android-battery: Provide fake values when fuel gauge missing X-Git-Tag: firefly_0821_release~4090^2~687 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=57992fa2fbffc48eb4d007b9eaf8b0f0bd7728c9;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/drivers/power/android_battery.c b/drivers/power/android_battery.c index a9708561eaf8..cc8e62887ffb 100644 --- a/drivers/power/android_battery.c +++ b/drivers/power/android_battery.c @@ -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) {