summaryrefslogtreecommitdiff
path: root/include/charge_state.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-03-17 18:39:23 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-20 00:07:30 +0000
commit7badef3bb2620762b119d9d8662aaf0a19c55778 (patch)
tree2c6978e3ce5876af34314b32df82e595d94f96a5 /include/charge_state.h
parent4d1058bf105fb8c424ae1c9d55cd365ba61c9d7a (diff)
downloadchrome-ec-7badef3bb2620762b119d9d8662aaf0a19c55778.tar.gz
charge_state: provide stub definition of charge_want_shutdown
Common power sequencing code (e.g., sc7180 power sequencing) calls charge_want_shutdown() to check there is enough battery. If the charger hasn't been enabled, the power sequencing code is expected to never call charge_want_shutdown (this has already been implemented for intel x86, for example). However, there's a bunch of ARM power sequencing code which does not guard the calls, and adding a bunch of ifdefs or IS_ENABLED to them would look bad. Provide a stub definition which indicates the charger never wants a shutdown if there's no charging enabled. BUG=b:183054226 BRANCH=none TEST=compile sc7180 without charger Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1429be4262c005752be49668aeb7274e540d8342 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774361 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/charge_state.h')
-rw-r--r--include/charge_state.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/charge_state.h b/include/charge_state.h
index 0fa0254071..588cbaf6f9 100644
--- a/include/charge_state.h
+++ b/include/charge_state.h
@@ -119,7 +119,14 @@ __override_proto int charge_is_consuming_full_input_current(void);
/**
* Return non-zero if discharging and battery so low we should shut down.
*/
+#ifdef CONFIG_CHARGER
int charge_want_shutdown(void);
+#else
+static inline int charge_want_shutdown(void)
+{
+ return 0;
+}
+#endif
/**
* Return non-zero if the battery level is too low to allow power on, even if