From 57992fa2fbffc48eb4d007b9eaf8b0f0bd7728c9 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Wed, 22 Aug 2012 19:02:26 -0700 Subject: [PATCH] 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 --- drivers/power/android_battery.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) { -- 2.34.1