summaryrefslogtreecommitdiff
path: root/include/charge_manager.h
diff options
context:
space:
mode:
authorYilun Lin <yllin@chromium.org>2019-11-05 14:52:45 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-09 07:50:34 +0000
commit053bc5659353c4aa127430f48f55633217a96d2a (patch)
treebb1d68dcb474fd0eb7e40f8d4a91f6287f7b8bb4 /include/charge_manager.h
parent8260bc9ebe7d32fe8154af0447f67d64b0499031 (diff)
downloadchrome-ec-053bc5659353c4aa127430f48f55633217a96d2a.tar.gz
usb_pd: request preferred voltage PDO
Add CONFIG_USB_PD_PREFER_MV to support PD will request preferred voltage. One should define pd_pref_config, including preferd voltage, e.g. 5000, and PD_PREFER_BOOST or PD_PREFER_BUCK based on the board charging efficiency. Also, system PLT power is needed for evaluating board's desired power. The option will try to find a most fit PDO: 1. Pick the PDO which fulfills the system desired power. If a preferred voltage PDO doesn't provide enough power, it will be skipped. 2. If none of the PDO meets the preferred voltage, it will pick the closest voltage PDO based on prefer boost or prefer bulk. 3. The system desired power will be constantly updated when system in constant voltage stage (battery percent > 70%). This is done by monitoring the battery charging current. 4. If the system desired power changes, it will re-evaluate the PDO and send request if has a better fit. TEST=Set prefer_mv to 5000 and ensure PD voltage could pick 9V/12V when desired voltage > 15W (5V/3A) and pick 5V when desired voltage <= 15W BUG=b:141170279 b:141903096 b:144073892 BRANCH=kukui Change-Id: I94646cb1c74c10cf8db889f19c3df6339844042c Signed-off-by: Yilun Lin <yllin@chromium.org> Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1871499
Diffstat (limited to 'include/charge_manager.h')
-rw-r--r--include/charge_manager.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h
index 2a3ca27d74..b68bf34801 100644
--- a/include/charge_manager.h
+++ b/include/charge_manager.h
@@ -206,6 +206,13 @@ int charge_manager_get_charger_current(void);
*/
int charge_manager_get_charger_voltage(void);
+/**
+ * Get the charger supplier.
+ *
+ * @return enum charge_supplier
+ */
+enum charge_supplier charge_manager_get_supplier(void);
+
#ifdef CONFIG_USB_PD_LOGGING
/* Save power state log entry for the given port */
void charge_manager_save_log(int port);