summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--baseboard/zork/baseboard.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c
index b72e4fb77f..36591bb4f2 100644
--- a/baseboard/zork/baseboard.c
+++ b/baseboard/zork/baseboard.c
@@ -325,10 +325,29 @@ void board_pwrbtn_to_pch(int level)
*/
int board_is_vbus_too_low(int port, enum chg_ramp_vbus_state ramp_state)
{
- int voltage;
+ int voltage = 0;
+ int rv;
+
+ rv = charger_get_vbus_voltage(port, &voltage);
+
+ if (rv) {
+ ccprints("%s rv=%d", __func__, rv);
+ return 0;
+ }
+
+ /*
+ * b/168569046: The ISL9241 sometimes incorrectly reports 0 for unknown
+ * reason, causing ramp to stop at 0.5A. Workaround this by ignoring 0.
+ * This partly defeats the point of ramping, but will still catch
+ * VBUS below 4.5V and above 0V.
+ */
+ if (voltage == 0) {
+ ccprints("%s vbus=0", __func__);
+ return 0;
+ }
- if (charger_get_vbus_voltage(port, &voltage))
- voltage = 0;
+ if (voltage < BC12_MIN_VOLTAGE)
+ ccprints("%s vbus=%d", __func__, voltage);
return voltage < BC12_MIN_VOLTAGE;
}