summaryrefslogtreecommitdiff
path: root/common/charge_manager.c
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2018-07-25 06:00:46 +0000
committerchrome-bot <chrome-bot@chromium.org>2018-07-26 15:52:02 -0700
commit756250daed2ad994fdde6fc162b6fbc61b787a82 (patch)
treef3e97cfba7a788556d78678fe349f4445ffbb6c7 /common/charge_manager.c
parent5e42c41ed2ac5d9dec952680117825214e4db783 (diff)
downloadchrome-ec-756250daed2ad994fdde6fc162b6fbc61b787a82.tar.gz
Revert "charge_manager: allow finding supply with VOLT > 0 and CUR = 0"
This reverts commit 7b50f88ba02306bd84f4dea1a9a437e57bfd275b. Reason for revert: Revert for make sure type-c ports can go back to disconnect state without any device/charger attached BUG=b:111667665,b:111777351 BRANCH=none TEST=make sure type-c ports can go back to disconnect state without any device/charger attached. Original change's description: > charge_manager: allow finding supply with VOLT > 0 and CUR = 0 > > On Fizz if we boot from type-C and later on plug the BJ, > the BJ available current is set to a non-zero value but the current > is set to 0. Because of this it is impossible to detect at runtime > by the kernel that the BJ has been plugged in. > > This commit is allowing to find power supply information even when > the current is equal to 0 as long as the voltage is > 0. The priority > will still be lower than if PWR > 0. > > BUG=chromium:841944 > BRANCH=none > TEST=Checked that the kernel can see when the BJ is connected. > > Change-Id: I7342829aa3429102d8452e9d2beba38d1701027f > Signed-off-by: Fabien Parent <fparent@baylibre.com> > Reviewed-on: https://chromium-review.googlesource.com/1046594 > Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Bug: chromium:841944 Change-Id: I4ceaee244e0bdd97f4176dd930462b07dd2fc1ee Reviewed-on: https://chromium-review.googlesource.com/1149680 Commit-Ready: Edward Hill <ecgh@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/charge_manager.c')
-rw-r--r--common/charge_manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c
index 07af626f5a..3d78d5874b 100644
--- a/common/charge_manager.c
+++ b/common/charge_manager.c
@@ -251,7 +251,8 @@ static void charge_manager_fill_power_info(int port,
else
/* Find highest priority supplier */
for (i = 0; i < CHARGE_SUPPLIER_COUNT; ++i)
- if (available_charge[i][port].voltage > 0 &&
+ if (available_charge[i][port].current > 0 &&
+ available_charge[i][port].voltage > 0 &&
(sup == CHARGE_SUPPLIER_NONE ||
supplier_priority[i] <
supplier_priority[sup] ||