diff options
author | johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> | 2021-06-09 18:18:52 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-10 10:48:49 +0000 |
commit | 2ce3beec20501d1975acb69053d724c6b391f849 (patch) | |
tree | a51f0d922688c22d1b040e639a0dce10a677c3d9 /board/cret/board.c | |
parent | 3286ace9ad8ce336e0dfd6f4d87b54e5a49cd33e (diff) | |
download | chrome-ec-2ce3beec20501d1975acb69053d724c6b391f849.tar.gz |
cret/raa489000: Control ASGATE statestabilize-14026.B-main
There is 0.1V leakage from Charger to Vbus
when a charger is removed in S5.
Control ASGATE state to prevent the leakage.
This commit uses the charger side registers to
control the ASGATE when selecting our active charge port.
This is done in addition to the existing implementation
which uses the TCPCI registers to control ASGATE.
BUG=b:189299803
BRANCH=dedede
TEST=Build and flash Cret, the leakage has been improved
from 0.1V to 0.001V
Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>
Change-Id: Ib81ca651b0708149fae7b4df27f66107b47f8490
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2948604
Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/cret/board.c')
-rw-r--r-- | board/cret/board.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/board/cret/board.c b/board/cret/board.c index f8d0d566fa..56e80bc388 100644 --- a/board/cret/board.c +++ b/board/cret/board.c @@ -258,10 +258,11 @@ int board_set_active_charge_port(int port) /* Disable all ports. */ if (port == CHARGE_PORT_NONE) { - for (i = 0; i < board_get_usb_pd_port_count(); i++) + for (i = 0; i < board_get_usb_pd_port_count(); i++) { tcpc_write(i, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_LOW); - + raa489000_enable_asgate(i, false); + } return EC_SUCCESS; } @@ -282,6 +283,7 @@ int board_set_active_charge_port(int port) if (tcpc_write(i, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_LOW)) CPRINTS("p%d: sink path disable failed.", i); + raa489000_enable_asgate(i, false); } /* @@ -292,7 +294,8 @@ int board_set_active_charge_port(int port) charger_discharge_on_ac(1); /* Enable requested charge port. */ - if (tcpc_write(port, TCPC_REG_COMMAND, + if (raa489000_enable_asgate(port, true) || + tcpc_write(port, TCPC_REG_COMMAND, TCPC_REG_COMMAND_SNK_CTRL_HIGH)) { CPRINTS("p%d: sink path enable failed.", port); charger_discharge_on_ac(0); |