summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-02-09 19:15:22 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-11 04:48:37 +0000
commitea3dbb98b4f7e566107e50103146961c3f3f5e6b (patch)
treed05d8d29caa4455eee8528013910042835473feb /include
parentc1fe8f2173c0c0ccad4c3e48f14bfb34e97ff684 (diff)
downloadchrome-ec-ea3dbb98b4f7e566107e50103146961c3f3f5e6b.tar.gz
charge_manager: Minimize log spew
Previously, we tried to minimize log spew by keeping track of previous log entries and not writing new entries in some cases. Instead, we can write a log on the following events only: 1. A port becomes active or 2. A port becomes inactive or 3. The active charge port power limit changes or 4. Any supplier change on an inactive port Also, make charge_manager_save_log a non-static charge manager API function, so that other modules can record a log, if they have reason to believe a port has changed outside of a charge manager change. BUG=chrome-os-partner:33248 TEST=Manual on Samus. Make various power actions and observe logging. BRANCH=Samus Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I5d5d3e186e85fdb1c59797ffbfb2f5a6ec04d94d Reviewed-on: https://chromium-review.googlesource.com/247891 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/charge_manager.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index 0b5c4f7cb4..d761f131fc 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -46,6 +46,11 @@ int charge_manager_get_override(void);
/* Returns the current active charge port, as determined by charge manager */
int charge_manager_get_active_charge_port(void);
+#ifdef CONFIG_USB_PD_LOGGING
+/* Save power state log entry for the given port */
+void charge_manager_save_log(int port);
+#endif
+
/* Board-level callback functions */
/*