diff options
author | Jan Dabros <jsd@semihalf.com> | 2021-02-25 10:28:20 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-26 16:56:28 +0000 |
commit | 8f1f03521cb5eeb3fdf647ab00ac4b65a11808d5 (patch) | |
tree | dc32c1b5cc7599bf49a3fffb7572a91d99732567 /board/servo_v4p1 | |
parent | 2862dd300587c2b7bcec24c4d4cea548d7e17519 (diff) | |
download | chrome-ec-8f1f03521cb5eeb3fdf647ab00ac4b65a11808d5.tar.gz |
servo_v4p1: Disable USB power in case of fault
Previously, the only action in case of overcurrent event on USB ports
was to log the information to the user. Actually more important thing is
to disable USB power signal, even though load switch should disable
VBUS.
Additional positive side-effect is that servod controls like
'image_usbkey_pwr' will be in sync with actual state of VBUS signal.
BUG=none
BRANCH=main
TEST=Generate overcurrent event on A0 USB3 port. Verify that A0 pwr
signal is off by issuing:
`dut-control image_usbkey_pwr`
Signed-off-by: Jan Dabros <jsd@semihalf.com>
Change-Id: I083f68e0a6f02d7de087b125790225fbffc941e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718869
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/servo_v4p1')
-rw-r--r-- | board/servo_v4p1/ioexpanders.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/board/servo_v4p1/ioexpanders.c b/board/servo_v4p1/ioexpanders.c index 50690321fd..7a8c409fea 100644 --- a/board/servo_v4p1/ioexpanders.c +++ b/board/servo_v4p1/ioexpanders.c @@ -43,14 +43,20 @@ static void ioexpanders_irq(void) fault = read_faults(); irqs = read_irqs(); - if (!(fault & USERVO_FAULT_L)) + if (!(fault & USERVO_FAULT_L)) { + ec_uservo_power_en(0); ccprintf("FAULT: Microservo USB A port load switch\n"); + } - if (!(fault & USB3_A0_FAULT_L)) + if (!(fault & USB3_A0_FAULT_L)) { + ec_usb3_a0_pwr_en(0); ccprintf("FAULT: USB3 A0 port load switch\n"); + } - if (!(fault & USB3_A1_FAULT_L)) + if (!(fault & USB3_A1_FAULT_L)) { + ec_usb3_a1_pwr_en(0); ccprintf("FAULT: USB3 A1 port load switch\n"); + } if (!(fault & USB_DUTCHG_FLT_ODL)) ccprintf("FAULT: Overcurrent on Charger or DUT CC/SBU lines\n"); |