diff options
author | Denis Brockus <dbrockus@google.com> | 2020-09-04 13:08:19 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-08 18:37:55 +0000 |
commit | 00446e091f2ac824d17e5d059d12576e6d64b133 (patch) | |
tree | 01c5e498826bd634545f332ce8ce9514201136a0 /include | |
parent | c535c381a70d2062491793841672aa188f619ef2 (diff) | |
download | chrome-ec-00446e091f2ac824d17e5d059d12576e6d64b133.tar.gz |
charge_manager: two charger DUT does not choose correct port
The active charge_port is selected in a delayed call to
charge_manager_refresh. This leaves a big window allowing
a better charger to be detected but not acted upon as
the soon to be active charge_port. This leads to the PD
Policy Engine deciding this better port is not the current
active charge_port and down grading the current limit for
the port to no longer be the best choice. So when the
charge_manager_refresh is called, it starts changing ports
and then later checks for the best port and then swaps
back to a lesser charger.
BUG=b:166228326
BRANCH=none
TEST=USB-C0 45W then attach USB-C1 65W charger
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I23dad1e4690285b3867bd046d9416db9522002e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393863
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/charge_manager.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/charge_manager.h b/include/charge_manager.h index b68bf34801..f4cadd1b6c 100644 --- a/include/charge_manager.h +++ b/include/charge_manager.h @@ -186,6 +186,16 @@ int charge_manager_get_override(void); int charge_manager_get_active_charge_port(void); /** + * Get the current selected charge port, as determined by charge manager. + * This is the charge port that is either active or that we may be + * transitioning to because a better choice has been given as an option + * but that transition has not completed. + * + * @return Current selected charge port. + */ +int charge_manager_get_selected_charge_port(void); + +/** * Get the power limit set by charge manager. * * @return Power limit (uW). |