summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-04-23 13:36:00 -0700
committerChromeBot <chrome-bot@google.com>2013-04-24 00:05:52 -0700
commitc747652e4904d60dd3e7de8d7c112e0ca22048fb (patch)
tree25be65fd1574bb02bfb0aea7478335143b50fe2a
parentc6e5d592cbfe95bd9978e14aba30a5bb17c19d90 (diff)
downloadchrome-ec-c747652e4904d60dd3e7de8d7c112e0ca22048fb.tar.gz
Allow building without battery charging
Some experimental boards may want to build without a battery charging task to make bringup easier. BUG=chrome-os-partner:18343 TEST=build all boards BRANCH=none Change-Id: I4269fea4046325241ad7720ec3457b0534aadda3 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48974 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/lm4/switch.c2
-rw-r--r--include/charge_state.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/chip/lm4/switch.c b/chip/lm4/switch.c
index 237f130712..5c08ee4575 100644
--- a/chip/lm4/switch.c
+++ b/chip/lm4/switch.c
@@ -373,8 +373,10 @@ static void state_machine(uint64_t tnow)
* Otherwise we could power on the AP only to shut it right
* back down due to insufficient battery.
*/
+#ifdef CONFIG_TASK_CHARGER
if (charge_get_state() == PWR_STATE_INIT)
break;
+#endif
/*
* Power the system on if possible. Gating due to insufficient
diff --git a/include/charge_state.h b/include/charge_state.h
index e55a7c529c..68ae1d08b4 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -146,7 +146,10 @@ int charge_get_percent(void);
/**
* Return non-zero if discharging and battery so low we should shut down.
*/
+#ifdef CONFIG_TASK_CHARGER
int charge_want_shutdown(void);
-
+#else
+static inline int charge_want_shutdown(void) { return 0; }
+#endif
#endif /* __CROS_EC_CHARGE_STATE_H */