summaryrefslogtreecommitdiff
path: root/common/pmu_tps65090_charger.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-06-22 23:16:47 +0000
committerGerrit <chrome-bot@google.com>2012-06-26 18:15:37 -0700
commit108aab99d49649e1ef61763a8803bd3754c5ad1e (patch)
treeba25f0b9fc5c49e81eb79647b2210155960ad54f /common/pmu_tps65090_charger.c
parentc56b1a7bdbcd596c78290dfff48e65f8c352916c (diff)
downloadchrome-ec-108aab99d49649e1ef61763a8803bd3754c5ad1e.tar.gz
tpschrome: skip bad I2C read
When an I2C read fails, we don't want to switch off the system or even print verbose warnings. Indeed, we are failing all I2C reads and writes to the charger and battery when they are on the same bus as the AP and the AP is ON. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9724 TEST=on Lucas DVT, run the system and see we have no spurious switch off or verbose EC traces. Change-Id: Ieb2f7836c70a0d2ad2c4a0f775aa190ce81a6932 Reviewed-on: https://gerrit.chromium.org/gerrit/26064 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/pmu_tps65090_charger.c')
-rw-r--r--common/pmu_tps65090_charger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c
index d8f8022af2..db13247050 100644
--- a/common/pmu_tps65090_charger.c
+++ b/common/pmu_tps65090_charger.c
@@ -247,7 +247,7 @@ static int calc_next_state(int state)
}
}
/* Check discharging alarm */
- if (battery_status(&alarm) || (alarm & ALARM_DISCHARGING)) {
+ if (!battery_status(&alarm) && (alarm & ALARM_DISCHARGING)) {
CPRINTF("[pmu] discharging: battery alarm %016b\n",
alarm);
return system_off();
@@ -279,4 +279,3 @@ void pmu_charger_task(void)
}
}
}
-