From 02b80c49f473b872360a782f6a95c607c6734717 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 22 Aug 2016 17:11:27 +0200 Subject: pd: manage total source current available Add a policy to handle the case where the device can source the `CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT` over one of its type-C port if there is no sink connected on the other ones. Signed-off-by: Vincent Palatin BRANCH=none BUG=chrome-os-partner:56110 TEST=manual: on Kevin, plug and unplug various devices on the 2 ports, while measuring the type-C pull-up with Twinkie. Change-Id: Id5961f04d0a1b1073f5ab340068efd9079918209 Reviewed-on: https://chromium-review.googlesource.com/373818 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Shawn N --- include/charge_manager.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/charge_manager.h') diff --git a/include/charge_manager.h b/include/charge_manager.h index 28546e22a1..7427d12aca 100644 --- a/include/charge_manager.h +++ b/include/charge_manager.h @@ -91,6 +91,17 @@ int charge_manager_get_charger_current(void); void charge_manager_save_log(int port); #endif +/* Update whether a given port is sourcing current. */ +void charge_manager_source_port(int port, int enable); + +/* + * Get PD source power data objects. + * + * @param src_pdo pointer to the data to return. + * @return number of PDOs returned. + */ +int charge_manager_get_source_pdo(const uint32_t **src_pdo); + /* Board-level callback functions */ /* -- cgit v1.2.1