diff options
author | Karthikeyan Ramasubramanian <kramasub@chromium.org> | 2019-01-15 12:11:29 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2019-01-22 16:49:43 +0000 |
commit | 3e96c18e592a18684744c73f1e4b76cb2c742201 (patch) | |
tree | dea16a4787072d21796413d8ba661e34ab439407 | |
parent | e6c83ae0444afcf318ddbc3be5b3cc3927473570 (diff) | |
download | chrome-ec-3e96c18e592a18684744c73f1e4b76cb2c742201.tar.gz |
driver/ppc/nx20p348.c: Handle overcurrent event
Currently the overcurrent event is logged but not handled. Report the
overcurrent event to the USB PD framework which in turn will handle the
overcurrent event further.
BUG=b:115475862
BRANCH=octopus
TEST=Boot to ChromeOS in grabbiter. No overcurrent events reported when
the sink is drawing <= 3.20 A. Overcurrent events are reported when the
sink is drawing > 3.25 A. After 3 reports, the port is latched off and
power delivery is stopped. The port is re-enabled only after the sink is
disconnected. Also when the sink is drawing current at 3.24 A, there is
one report of overcurrent. The port gets disabled in response to that
event. But the port is re-enabled after 1 second since overcurrent event
is reported only once. After the port is re-enabled, the sink is able to
draw the set current. When the overcurrent event is reported, I can see in
the kernel logs that the overcurrent condition is detected by the kernel.
EC Logs:
[3391.984462 C1: PPC detected Vbus overcurrent!]
[3391.984953 C1: overcurrent!]
[3392.044935 C1: PPC detected Vbus overcurrent!]
[3392.045425 C1: overcurrent!]
[3392.061404 C1: PPC detected Vbus overcurrent!]
[3392.061894 C1: overcurrent!]
[3392.062142 C1: OC event limit reached! Source path disabled until
physical disconnect.]
[3392.077226 C1: PPC detected Vbus overcurrent!]
[3392.077532 C1: overcurrent!]
[3392.077891 C1: OC event limit reached! Source path disabled until
physical disconnect.]
[3392.092660 C1: PPC detected Vbus overcurrent!]
[3392.092966 C1: overcurrent!]
[3392.093213 C1: OC event limit reached! Source path disabled until
physical disconnect.]
Kernel Logs:
[ 3356.560456] usb usb2-port1: over-current condition
[ 3356.768434] usb usb2-port2: over-current condition
[ 3356.976446] usb usb2-port4: over-current condition
[ 3357.184441] usb usb2-port5: over-current condition
[ 3357.392445] usb usb2-port6: over-current condition
Change-Id: I0af69a132fdd1dd5bab4d530c3b060b2a5aea501
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1412448
Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1426150
Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Commit-Queue: Karthikeyan Ramasubramanian <kramasub@chromium.org>
Trybot-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org>
-rw-r--r-- | driver/ppc/nx20p348x.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c index 8a0d45851e..35202c8fe8 100644 --- a/driver/ppc/nx20p348x.c +++ b/driver/ppc/nx20p348x.c @@ -15,6 +15,7 @@ #include "tcpm.h" #include "usb_charge.h" #include "usb_pd_tcpm.h" +#include "usb_pd.h" #include "usbc_ppc.h" #include "util.h" @@ -322,11 +323,7 @@ static void nx20p348x_handle_interrupt(int port) /* Check for 5V OC interrupt */ if (reg & NX20P348X_INT1_OC_5VSRC) { CPRINTS("C%d: PPC detected Vbus overcurrent!", port); - /* - * TODO (b/69935262): The overcurrent action hasn't - * been completed yet, but is required for TI PPC. When that - * work is complete, tie it in here. - */ + pd_handle_overcurrent(port); } /* Check for Vbus reverse current protection */ |