diff options
author | Fabien Parent <fparent@baylibre.com> | 2018-05-07 09:37:56 +0200 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-11 12:13:23 -0700 |
commit | 7b50f88ba02306bd84f4dea1a9a437e57bfd275b (patch) | |
tree | 6569076068c7bf223a3e88d134de3a7514c0958e /common | |
parent | 7729665d73469bab4975ab04c0f20fd62271004b (diff) | |
download | chrome-ec-7b50f88ba02306bd84f4dea1a9a437e57bfd275b.tar.gz |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/charge_manager.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/charge_manager.c b/common/charge_manager.c index 2abb770667..ee49210c7e 100644 --- a/common/charge_manager.c +++ b/common/charge_manager.c @@ -251,8 +251,7 @@ 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].current > 0 && - available_charge[i][port].voltage > 0 && + if (available_charge[i][port].voltage > 0 && (sup == CHARGE_SUPPLIER_NONE || supplier_priority[i] < supplier_priority[sup] || |