summaryrefslogtreecommitdiff
path: root/common/pmu_tps65090.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.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.c')
-rw-r--r--common/pmu_tps65090.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/pmu_tps65090.c b/common/pmu_tps65090.c
index b32000b283..290db145b3 100644
--- a/common/pmu_tps65090.c
+++ b/common/pmu_tps65090.c
@@ -82,7 +82,12 @@ static int pmu_get_event(int *event)
int pmu_is_charger_alarm(void)
{
int status;
- if (pmu_read(CG_STATUS1, &status) || (status & CHARGER_ALARM))
+
+ /**
+ * if the I2C access to the PMU fails, we consider the failure as
+ * non-critical and wait for the next read without send the alert.
+ */
+ if (!pmu_read(CG_STATUS1, &status) && (status & CHARGER_ALARM))
return 1;
return 0;
}
@@ -123,5 +128,3 @@ void pmu_init(void)
*/
pmu_write(CG_CTRL3, 0xbb);
}
-
-