aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2012-08-22 19:02:26 -0700
committerColin Cross <ccross@android.com>2014-03-19 13:09:21 -0700
commitf03455fa499537fc1001022b511e3e1936d6eadf (patch)
treeccd83c250b68666aaa10e8300a0fbd18e83e4071 /drivers/power
parent0808371a574b616fb13671bd65a0a71c23ddc0e2 (diff)
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/android_battery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/power/android_battery.c b/drivers/power/android_battery.c
index a9708561eaf..cc8e62887ff 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) {