diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-11-17 15:01:52 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-12-19 22:28:46 -0800 |
commit | 363853006e95854c4319126666636d0bd483cfcf (patch) | |
tree | cc8216e098cb2472010c7c0176379312f8321773 /board/fizz | |
parent | 752851a5240469b2f5b02fb7c57fea3776c830c4 (diff) | |
download | chrome-ec-363853006e95854c4319126666636d0bd483cfcf.tar.gz |
Fizz: Avoid activating BJ port if unplugged
This patch makes EC check the presence of power from a barrel jack
adapter before activating the BJ port.
BUG=none
BRANCH=none
TEST=Boot Fizz on type-c. Boot Fizz on BJ.
Switch power from type-c to BJ at G3 and S0.
Switch power from BJ to type-c at G3 and S0.
Change-Id: Iec982278e1ceb9b997069f66eb0e14f2e361efd2
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/777824
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'board/fizz')
-rw-r--r-- | board/fizz/usb_pd_policy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/board/fizz/usb_pd_policy.c b/board/fizz/usb_pd_policy.c index 0184fe43ec..afa91bc390 100644 --- a/board/fizz/usb_pd_policy.c +++ b/board/fizz/usb_pd_policy.c @@ -287,7 +287,10 @@ int board_set_active_charge_port(int port) gpio_set_level(GPIO_AC_JACK_CHARGE_L, 1); gpio_enable_interrupt(GPIO_ADP_IN_L); break; - case CHARGE_PORT_BARRELJACK : + case CHARGE_PORT_BARRELJACK: + /* Make sure BJ adapter is sourcing power */ + if (gpio_get_level(GPIO_ADP_IN_L)) + return EC_ERROR_INVAL; gpio_set_level(GPIO_AC_JACK_CHARGE_L, 0); /* If this is switching from type-c to BJ, we have to wait until * PU3 comes up to keep the system continuously powered. |