summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-05-23 18:08:55 -0700
committerChromeBot <chrome-bot@google.com>2013-05-24 07:40:26 -0700
commitc3aa27602647069d21a200d3ff4b8f14bd2c7a26 (patch)
treec5e01628f54eb41561f9ebef9fe43c58f1b6260f
parent4122b222859db34cb6eee827cba4988df458d916 (diff)
downloadchrome-ec-c3aa27602647069d21a200d3ff4b8f14bd2c7a26.tar.gz
spring: boot with depleted battery if the right charger is plugged
From our experiments, on EVT2 hardware, we can at least boot to the firmware low battery screen with our power brick and no battery connected. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=spring BUG=chrome-os-partner:18927 TEST=on Spring, with a drained battery, try to boot with our brick and a random cable. Change-Id: Ibf282a84409a25c88bf49fe6e3738b6405a638ec Reviewed-on: https://gerrit.chromium.org/gerrit/56544 Reviewed-by: Puneet Kumar <puneetster@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/board.h3
-rw-r--r--board/spring/usb_charging.c5
-rw-r--r--common/pmu_tps65090_charger.c11
3 files changed, 19 insertions, 0 deletions
diff --git a/board/spring/board.h b/board/spring/board.h
index 662188fb80..4362bb7849 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -185,6 +185,9 @@ int board_get_usb_current_limit(void);
/* Properly limit input power on EC boot */
void board_pwm_init_limit(void);
+/* Do we have enough AC power to boot without a battery */
+int board_has_high_power_ac(void);
+
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c
index 8a5533bbff..5715431fcc 100644
--- a/board/spring/usb_charging.c
+++ b/board/spring/usb_charging.c
@@ -278,6 +278,11 @@ static int board_probe_video(int device_type)
}
}
+int board_has_high_power_ac(void)
+{
+ return board_get_usb_dev_type() & TSU6721_TYPE_CHG12;
+}
+
void board_pwm_duty_cycle(int percent)
{
if (current_ilim_config != ILIM_CONFIG_PWM)
diff --git a/common/pmu_tps65090_charger.c b/common/pmu_tps65090_charger.c
index c79b97954a..5201f06110 100644
--- a/common/pmu_tps65090_charger.c
+++ b/common/pmu_tps65090_charger.c
@@ -392,6 +392,14 @@ enum charging_state charge_get_state(void)
return current_state;
}
+int __board_has_high_power_ac(void)
+{
+ return 0;
+}
+
+int board_has_high_power_ac(void)
+ __attribute__((weak, alias("__board_has_high_power_ac")));
+
int charge_keep_power_off(void)
{
int charge;
@@ -399,6 +407,9 @@ int charge_keep_power_off(void)
if (BATTERY_AP_OFF_LEVEL == 0)
return 0;
+ if (board_has_high_power_ac())
+ return 0;
+
if (battery_remaining_capacity(&charge))
return current_state != ST_CHARGING_ERROR;